<?php
header('Content-type: text/html; charset=utf-8');
// The following variables values must reflect your installation needs.
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
$lang = 'en_US';
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
$tempfiledir = "./";
$spellercss = '../spellerStyle.css'; // by FredCK
$word_win_src = '../wordWindow.js'; // by FredCK
$textinputs = $_POST['textinputs']; # array
$input_separator = "A";
# set the JavaScript variable to the submitted text.
# textinputs is an array, each element corresponding to the (url-encoded)
# value of the text control submitted for spell-checking
function print_textinputs_var() {
global $textinputs;
foreach( $textinputs as $key=>$val ) {
# $val = str_replace( "'", "%27", $val );
echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
}
}
# make declarations for the text input index
function print_textindex_decl( $text_input_idx ) {
echo "words[$text_input_idx] = [];\n";
echo "suggs[$text_input_idx] = [];\n";
}
# set an element of the JavaScript 'words' array to a misspelled word
function print_words_elem( $word, $index, $text_input_idx ) {
echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
}
# set an element of the JavaScript 'suggs' array to a list of suggestions
function print_suggs_elem( $suggs, $index, $text_input_idx ) {
echo "suggs[$text_input_idx][$index] = [";
foreach( $suggs as $key=>$val ) {
if( $val ) {
echo "'" . escape_quote( $val ) . "'";
if ( $key+1 < count( $suggs )) {
echo ", ";
}
}
}
echo "];\n";
}
# escape single quote
function escape_quote( $str ) {
return preg_replace ( "/'/", "\\'", $str );
}
# handle a server-side error.
function error_handler( $err ) {
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
}
## get the list of misspelled words. Put the results in the javascript words array
## for each misspelled word, get suggestions and put in the javascript suggs array
function print_checker_results() {
global $aspell_prog;
global $aspell_opts;
global $tempfiledir;
global $textinputs;
global $input_separator;
$aspell_err = "";
# create temp file
$tempfile = tempnam( $tempfiledir, 'aspell_data_' );
# open temp file, add the submitted text.
if( $fh = fopen( $tempfile, 'w' )) {
for( $i = 0; $i < count( $textinputs ); $i++ ) {
$text = urldecode( $textinputs[$i] );
// Strip all tags for the text. (by FredCK - #339 / #681)
$text = preg_replace( "/<[^>]+>/", " ", $text ) ;
$lines = explode( "\n", $text );
fwrite ( $fh, "%\n" ); # exit terse mode
fwrite ( $fh, "^$input_separator\n" );
fwrite ( $fh, "!\n" ); # enter terse mode
foreach( $lines as $key=>$value ) {
# use carat on each line to escape possible aspell commands
fwrite( $fh, "^$value\n" );
}
}
fclose( $fh );
# exec aspell command - redirect STDERR to STDOUT
$cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
if( $aspellret = shell_exec( $cmd )) {
$linesout = explode( "\n", $aspellret );
$index = 0;
$text_input_index = -1;
# parse each line of aspell return
foreach( $linesout as $key=>$val ) {
$chardesc = substr( $val, 0, 1 );
# if '&', then not in dictionary but has suggestions
# if '#', then not in dictionary and no suggestions
# if '*', then it is a delimiter between text inputs
# if '@' then version info
if( $chardesc == '&' || $chardesc == '#' ) {
$line = explode( " ", $val, 5 );
print_words_elem( $line[1], $index, $text_input_index );
if( isset( $line[4] )) {
$suggs = explode( ", ", $line[4] );
} else {
$suggs = array();
}
print_suggs_elem( $suggs, $index, $text_input_index );
$index++;
} elseif( $chardesc == '*' ) {
$text_input_index++;
print_textindex_decl( $text_input_index );
$index = 0;
} elseif( $chardesc != '@' && $chardesc != "" ) {
# assume this is error output
$aspell_err .= $val;
}
}
if( $aspell_err ) {
$aspell_err = "Error executing `$cmd`\\n$aspell_err";
error_handler( $aspell_err );
}
} else {
error_handler( "System error: Aspell program execution failed (`$cmd`)" );
}
} else {
error_handler( "System error: Could not open file '$tempfile' for writing" );
}
# close temp file, delete file
unlink( $tempfile );
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
<script language="javascript" src="<?php echo $word_win_src ?>"></script>
<script language="javascript">
var suggs = new Array();
var words = new Array();
var textinputs = new Array();
var error;
<?php
print_textinputs_var();
print_checker_results();
?>
var wordWindowObj = new wordWindow();
wordWindowObj.originalSpellings = words;
wordWindowObj.suggestions = suggs;
wordWindowObj.textInputs = textinputs;
function init_spell() {
// check if any error occured during server-side processing
if( error ) {
alert( error );
} else {
// call the init_spell() function in the parent frameset
if (parent.frames.length) {
parent.init_spell( wordWindowObj );
} else {
alert('This page was loaded outside of a frameset. It might not display properly');
}
}
}
</script>
</head>
<!-- <body onLoad="init_spell();"> by FredCK -->
<body onLoad="init_spell();" bgcolor="#ffffff">
<script type="text/javascript">
wordWindowObj.writeBody();
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
ASP.NET+SQL车辆管理系统--毕业设计
共612个文件
gif:299个
js:126个
html:49个
4星 · 超过85%的资源 需积分: 10 130 下载量 149 浏览量
2015-04-14
11:41:40
上传
评论 5
收藏 3.4MB ZIP 举报
温馨提示
一: 车辆情况管理 车辆基本特征 车辆统计 车辆年度情况 二: 车辆技术档案管理 车辆变动登记 技术状况检查 气缸磨损登记 车辆保养登记 车辆小修登记 车辆大修登记 车辆事故登记 三: 车辆派遣管理 用车申请 用车批复 四:安全教育管理(教育课程名称 教育日期 组织单位 参加单位 参加人数) 五:驾驶员信息管理(驾驶员档案 驾驶员信息统计) 六:车材 油材管理(车材资源库 车材入库单 车材出库单 油料入库单 油料发放单) 七:计划管理(运输保障方案 保养维修计划 车场日计划 车辆动用计划 车辆训练计划) 八:系统维护 系统备份 系统还原 系统检查 ">一: 车辆情况管理 车辆基本特征 车辆统计 车辆年度情况 二: 车辆技术档案管理 车辆变动登记 技术状况检查 气缸磨损登记 车辆保养登记 车辆小修登记 车辆大修登记 车辆事故登记 三: 车辆派遣管理 用车申请 用 [更多]
资源推荐
资源详情
资源评论
收起资源包目录
ASP.NET+SQL车辆管理系统--毕业设计 (612个子文件)
config.ascx 5KB
Left.aspx 21KB
List.aspx 10KB
List.aspx 9KB
Edit.aspx 6KB
Edit.aspx 5KB
Edit.aspx 4KB
connector.aspx 1KB
upload.aspx 1KB
Main.aspx 935B
VdCode.aspx 99B
login.aspx 92B
Default.aspx 92B
spellchecker.cfm 5KB
Web.Config 2KB
DB.cs 27KB
db_Vehicle.cs 10KB
db_Class.cs 9KB
db_employ.cs 9KB
db_Pilot.cs 9KB
db_User.cs 9KB
db_Technology.cs 9KB
db_Material.cs 9KB
db_Plan.cs 8KB
db_Technology.cs 5KB
VdCode.aspx.cs 5KB
PageBase.cs 5KB
db_Vehicle.cs 4KB
db_employ.cs 4KB
db_Pilot.cs 4KB
db_Material.cs 4KB
db_Class.cs 4KB
db_Plan.cs 4KB
db_User.cs 4KB
MessageBox.cs 3KB
db_Technology.cs 2KB
List.aspx.cs 2KB
List.aspx.cs 2KB
Edit.aspx.cs 2KB
Edit.aspx.cs 2KB
Default.aspx.cs 2KB
Edit.aspx.cs 2KB
db_Vehicle.cs 2KB
db_Class.cs 1KB
db_employ.cs 1KB
db_Pilot.cs 1KB
db_Material.cs 1KB
db_Plan.cs 1KB
db_User.cs 745B
Left.aspx.cs 718B
Main.aspx.cs 515B
css.css 16KB
style.css 12KB
fck_editor.css 8KB
head.css 6KB
fck_dialog.css 6KB
control.css 5KB
login.css 5KB
common1.css 4KB
fck_internal.css 4KB
datepicker.css 4KB
datepicker.css 4KB
css.css 3KB
style.css 3KB
fck_editorarea.css 3KB
scayt_dialog.css 2KB
fck_dialog_common.css 2KB
fck_showtableborders_gecko.css 2KB
browser.css 2KB
style0.css 1KB
spellerStyle.css 890B
WdatePicker.css 158B
Thumbs.db 259KB
AspNetPager.dll 60KB
FredCK.FCKeditorV2.dll 44KB
entries 850B
entries 695B
entries 663B
entries 571B
entries 544B
welcome.gif 164KB
top03.gif 23KB
load.gif 8KB
ico15.gif 8KB
ico14.gif 8KB
ico16.gif 8KB
ico13.gif 7KB
left-2-1.gif 6KB
logo.gif 6KB
fck_strip.gif 5KB
login_p_img05.gif 4KB
nav03.gif 4KB
nav01.gif 4KB
desktop_01.gif 4KB
desktop_02.gif 4KB
desktop_03.gif 3KB
shape01.gif 3KB
left-1-2.gif 2KB
left-1-3.gif 2KB
logo_fckeditor.gif 2KB
共 612 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- simon1122312015-07-10可以参考一下
- mjt12502017-12-05有病毒的。。。。。
- bcptttptp2017-05-26感谢分享!
jsjlw7
- 粉丝: 1
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功