<?php
header('Content-type: text/html; charset=utf-8');
//$spellercss = '/speller/spellerStyle.css'; // by FredCK
$spellercss = '../spellerStyle.css'; // by FredCK
//$word_win_src = '/speller/wordWindow.js'; // by FredCK
$word_win_src = '../wordWindow.js'; // by FredCK
$textinputs = $_POST['textinputs']; # array
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
$lang = 'en_US';
//$aspell_opts = "-a --lang=$lang --encoding=utf-8"; // by FredCK
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; // by FredCK
$tempfiledir = "./";
$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 = '" . escape_quote( $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] );
$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>
没有合适的资源?快使用搜索试试~ 我知道了~
C#房屋中介信息管理系统 v2.3源码
共475个文件
gif:191个
cs:72个
aspx:52个
需积分: 10 12 下载量 82 浏览量
2010-06-22
19:26:21
上传
评论
收藏 1.38MB RAR 举报
温馨提示
房屋中介信息管理系统 v2.3源码 房屋中介信息管理系统 v2.3源码
资源推荐
资源详情
资源评论
收起资源包目录
C#房屋中介信息管理系统 v2.3源码 (475个子文件)
GetInfoUserControl.ascx 12KB
SaleInfoUserControl.ascx 11KB
SystemMenuControl.ascx 2KB
HousehireMenuControl.ascx 2KB
UccLeftMenuControl.ascx 2KB
UserrecMenuControl.ascx 2KB
CallinrecMenuControl.ascx 2KB
HireAgreementControl.ascx 1KB
AgreementLcUserControl.ascx 1KB
ImageUserControl.ascx 1KB
PageCtrl.ascx 1KB
TopMenuControl.ascx 1KB
SalePriceUserControl.ascx 884B
HirePriceUserControl.ascx 884B
MianJiUserControl.ascx 880B
AreaControl.ascx 878B
LcControl.ascx 851B
HxControl.ascx 848B
CaoXiangControl.ascx 812B
ZhuangxiuControl.ascx 806B
UpFile.ascx 585B
Fcoa.asmx 67B
HousehireManage.aspx 70KB
HousesaleManage.aspx 70KB
HireAgreementManage.aspx 54KB
SaleAgreementManage.aspx 54KB
CallinrecManage.aspx 50KB
CallinrecsManage.aspx 50KB
Main.aspx 46KB
SystemUserManage.aspx 42KB
Housesale.aspx 32KB
Househire.aspx 32KB
HiresuccList.aspx 28KB
SalesuccList.aspx 28KB
SystemDept.aspx 27KB
SystemSaleLog.aspx 26KB
SystemHireLog.aspx 26KB
SalesuccDeptList.aspx 26KB
HiresuccDeptList.aspx 26KB
HouseSaleRecycle.aspx 26KB
HousehireRecycle.aspx 25KB
SystemMiddleman.aspx 25KB
HousesaleSearch.aspx 24KB
UserInformaion.aspx 24KB
SystemUser.aspx 24KB
HousehireSearch.aspx 24KB
HousesaleView.aspx 22KB
HousehireView.aspx 22KB
SaleAgreementList.aspx 22KB
SystemPubClass.aspx 22KB
NotifyList.aspx 21KB
HireAgreementList.aspx 21KB
PublicInfoList.aspx 20KB
Checkonwork.aspx 20KB
HireAgreementView.aspx 20KB
SaleAgreementView.aspx 20KB
UserrecManage.aspx 19KB
CallinrecList.aspx 18KB
CallinrecDeptList.aspx 18KB
SystemAddRole.aspx 16KB
SystemBase.aspx 14KB
UserrecList.aspx 14KB
UserrecUserList.aspx 13KB
GenJinManageDialog.aspx 12KB
UserrecDeptList.aspx 12KB
Install.aspx 11KB
HousePicManager.aspx 10KB
Login.aspx 8KB
CheckonworkList.aspx 8KB
HousehirePic.aspx 3KB
connector.aspx 959B
upload.aspx 930B
ValidateCode.aspx 133B
LogOut.aspx 97B
fckeditor.cfc 7KB
spellchecker.cfm 5KB
Web.Config 5KB
WebLibrary.config 3KB
UpFile.ascx.cs 20KB
PageCtrl.ascx.cs 9KB
CheckonworkList.aspx.cs 6KB
HiresuccList.aspx.cs 6KB
SalesuccList.aspx.cs 6KB
Househire.aspx.cs 6KB
SalesuccDeptList.aspx.cs 6KB
Housesale.aspx.cs 6KB
HiresuccDeptList.aspx.cs 6KB
Checkonwork.aspx.cs 6KB
HousesaleSearch.aspx.cs 6KB
HousehireSearch.aspx.cs 5KB
SystemAddRole.aspx.cs 5KB
CallinrecDeptList.aspx.cs 5KB
CallinrecList.aspx.cs 5KB
HireAgreementList.aspx.cs 5KB
SaleAgreementList.aspx.cs 5KB
SystemHireLog.aspx.cs 4KB
SystemSaleLog.aspx.cs 4KB
Install.aspx.cs 4KB
HouseSaleRecycle.aspx.cs 4KB
HousehireRecycle.aspx.cs 4KB
共 475 条
- 1
- 2
- 3
- 4
- 5
资源评论
dongjuna
- 粉丝: 2
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功