📄 math.php
字号:
<?php
function stripslashesarray( &$array )
{
is_array( $array ) ? array_walk( $array, "stripslashesArray" ) : ( $array = stripslashes( $array ) );
}
function html_transform_with_space( $string )
{
$string = htmlentities( $string, ENT_QUOTES, "GB2312" );
$string = preg_replace( "/ /", " ", $string );
return $string;
}
function html_transform_without_space( $string )
{
$string = htmlentities( $string, ENT_QUOTES, "GB2312" );
return $string;
}
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/utility_html.php" );
if ( get_magic_quotes_gpc( ) )
{
stripslashesarray( &$GLOBALS['_GET'] );
stripslashesarray( &$GLOBALS['_POST'] );
stripslashesarray( &$GLOBALS['_COOKIE'] );
stripslashesarray( &$GLOBALS['_FILES'] );
stripslashesarray( &$GLOBALS['_REQUEST'] );
}
ini_set( "magic_quotes_runtime", "0" );
ini_set( "magic_quotes_sybase", "0" );
require_once( "eval_expr_to_rpn.php" );
require_once( "eval_rpn.php" );
require_once( "eval_my_function.php" );
$expr = "";
$ans = "";
$ans_style = "ans_normal";
if ( array_key_exists( "expr", $_GET ) )
{
$expr = $_GET['expr'];
$exprtmp = preg_replace( "#\\[\\[.*?\\]\\]#e", "1010", $expr );
$ans = eval_expr_to_rpn( $exprtmp );
$error = get_error_info( );
if ( $error === null )
{
$ans = eval_rpn( $ans );
$error = get_error_rpn( );
if ( $error !== null )
{
$ans_style = "ans_error";
$ans = get_error_rpn( );
}
}
else
{
$ans_style = "ans_error";
$ans = get_error_info( );
}
}
$re_userinput = html_transform_without_space( $expr );
$expr = html_transform_with_space( $expr );
$ans = html_transform_with_space( $ans );
if ( strlen( $_REQUEST['relationval'] ) == 2 || $expr == "" )
{
$ans_style = "ans_normal";
}
$connection = openconnection( );
$query = "select * from FLOW_TYPE where FLOW_ID={$FLOW_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FORM_ID = $ROW['FORM_ID'];
$FLOW_DOC = $ROW['FLOW_DOC'];
}
$query = "select * from FLOW_PROCESS where FLOW_ID={$FLOW_ID} and ID={$ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRCS_ITEM = $ROW['PRCS_ITEM'];
$PRCS_ITEM = str_replace( "+", "+", $PRCS_ITEM );
$PRCS_ITEM = str_replace( "#", "#", $PRCS_ITEM );
$PRCS_ITEM_VIEW = $ROW['PRCS_ITEM_VIEW'];
$PRCS_ITEM_VIEW = str_replace( "+", "+", $PRCS_ITEM_VIEW );
$PRCS_ITEM_VIEW = str_replace( "#", "#", $PRCS_ITEM_VIEW );
$PRCS_ITEM_CAPACITY = $ROW['PRCS_ITEM_CAPACITY'];
$PRCS_ITEM_CAPACITY = str_replace( "+", "+", $PRCS_ITEM_CAPACITY );
$PRCS_ITEM_CAPACITY = str_replace( "#", "#", $PRCS_ITEM_CAPACITY );
$PRCS_ITEM_AUTO = $ROW['PRCS_ITEM_AUTO'];
$PRCS_ITEM_AUTO = str_replace( "+", "+", $PRCS_ITEM_AUTO );
$PRCS_ITEM_AUTO = str_replace( "#", "#", $PRCS_ITEM_AUTO );
}
$query = "select * from FLOW_FORM_TYPE where FORM_ID={$FORM_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRINT_MODEL = $ROW['PRINT_MODEL'];
}
$ELEMENT_ARRAY = html_element( $PRINT_MODEL );
$ARRAY_COUNT = sizeof( $ELEMENT_ARRAY );
$I = 0;
for ( ; $I < $ARRAY_COUNT; ++$I )
{
$E_TITLE = get_attr( $ELEMENT_ARRAY[$I], "TITLE" );
$E_VALUE = get_attr( $ELEMENT_ARRAY[$I], "VALUE" );
$ITEM_NAME_ALL .= $E_TITLE.",";
$ITEM_VALUE_ALL .= $E_VALUE.",";
}
$ITEM_NAME_ALL = str_replace( "+", "+", $ITEM_NAME_ALL );
$ITEM_NAME_ALL = str_replace( "#", "#", $ITEM_NAME_ALL );
$itemArray = explode( ",", $ITEM_NAME_ALL );
$valueArray = explode( ",", $ITEM_VALUE_ALL );
$winheight = 120 + count( $itemArray ) * 27;
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n\r\n<head>\r\n<title>条件设置器</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n<link rel=\"stylesheet\" href=\"/images/module/term/style.css\" type=\"text/css\" media=\"all\" />\r\n";
echo "<s";
echo "cript type=\"text/javascript\" src=\"action.js\"></script>\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"1\" leftmargin=\"2\">\r\n<table border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"2\" >\r\n\r\n\r\n<tr class=\"TableHeader\">\r\n <td align=\"center\">设置条件</td>\r\n</tr>\r\n</table>\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" >\r\n <tr class=\"tablehead2\">\r\n <td >\r\n\t<BUTTON class=btn onclick=\"submitForm()";
echo ";\"><table><tr valign=middle ><td><img src=\"/images/workflow/save.gif\" align=\"center\"></td> <td> 保 存</td></tr></table></BUTTON> \r\n </td>\r\n </tr>\r\n</table>\r\n\r\n\r\n<div id=\"box\" style=\"padding:3px\">\r\n\t<div class=\"";
echo $ans_style;
echo "\">\r\n\r\n\t\t<div id=\"line\">\r\n\t\t\t<div class=\"s\">\t\r\n\t\t\t\t";
echo "<s";
echo "elect name=\"ITEM_NAME\">\r\n\t\t\t\t";
$iacount = 0;
$i = 0;
for ( ; $i < count( $itemArray ) - 1; ++$i )
{
if ( $itemname != "[A@]" )
{
++$iacount;
$itemname = $itemArray[$i];
}
echo "\t\t\t\t\t<option value=\"";
echo $itemname;
echo "\" ";
if ( $_REQUEST['fieldval'] == $itemname )
{
echo "selected";
}
echo ">";
echo $itemname;
echo "</option>\r\n\t\t\t\t";
}
echo "\t\t\t\t</select>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"r\">\r\n\t\t\t\t";
echo "<s";
echo "elect name=\"RELATION\" class=\"SmallSelect\">\r\n\t\t\t\t\t<option value=\"1\" ";
if ( $_REQUEST['relationval'] == 1 )
{
echo "selected";
}
echo ">等于</option>\r\n\t\t\t\t\t<option value=\"2\" ";
if ( $_REQUEST['relationval'] == 2 )
{
echo "selected";
}
echo ">大于</option>\r\n\t\t\t\t\t<option value=\"3\" ";
if ( $_REQUEST['relationval'] == 3 )
{
echo "selected";
}
echo ">小于</option>\r\n\t\t\t\t\t<option value=\"4\" ";
if ( $_REQUEST['relationval'] == 4 )
{
echo "selected";
}
echo ">大于等于</option>\r\n\t\t\t\t\t<option value=\"5\" ";
if ( $_REQUEST['relationval'] == 5 )
{
echo "selected";
}
echo ">小于等于</option>\r\n\t\t\t\t\t<option value=\"6\" ";
if ( $_REQUEST['relationval'] == 6 )
{
echo "selected";
}
echo ">不等于</option>\r\n\t\t\t\t\t<option value=\"11\" ";
if ( $_REQUEST['relationval'] == 11 )
{
echo "selected";
}
echo ">字符等于</option>\r\n\t\t\t\t\t<option value=\"12\" ";
if ( $_REQUEST['relationval'] == 12 )
{
echo "selected";
}
echo ">开始字符</option>\r\n\t\t\t\t\t<option value=\"13\" ";
if ( $_REQUEST['relationval'] == 13 )
{
echo "selected";
}
echo ">包含字符</option>\r\n\t\t\t\t\t<option value=\"14\" ";
if ( $_REQUEST['relationval'] == 14 )
{
echo "selected";
}
echo ">结束字符</option>\r\n\t\t\t\t</select>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"q\">\r\n\t\t\t\t值:<input type=\"text\" name=\"EXPRESSION\" class=\"inputReadOnly\" value=\"";
echo $expr;
echo "\" size=\"55\" readonly>\r\n\t\t </div>\r\n\t\t\t\r\n\t\t</div>\r\n\t\t";
if ( $ans_style == "ans_error" )
{
echo "\t\t<div id=\"line2\">\r\n\t\t\t<div class=\"a\">";
if ( $ans_style == "ans_error" )
{
echo "<span style='color:red;'>{$ans}</span>";
}
else
{
echo $ans;
}
echo "</div>\r\n\t\t</div>\r\n\t\t";
}
echo "\t</div>\r\n\t<div id =\"keyboard\">\r\n\t\t<div id=\"function\">\r\n\t\t\t<ul class=\"number\">\r\n\t\t\t\t<li id=\"key_1\">7</li>\r\n\t\t\t\t<li id=\"key_2\">4</li>\r\n\t\t\t\t<li id=\"key_3\">1</li>\r\n\t\t\t\t<li id=\"key_4\">0</li>\r\n\t\t\t</ul>\r\n\t\t\t<ul class=\"number\">\r\n\t\t\t\t<li id=\"key_5\">8</li>\r\n\t\t\t\t<li id=\"key_6\">5</li>\r\n\t\t\t\t<li id=\"key_7\">2</li>\r\n\t\t\t\t<li id=\"key_8\">.</li>\r\n\t\t\t</ul>\r\n\t\t\t<ul class=\"number\">\r\n\t\t\t\t<li id=\"key_9\">9</li>\r\n\t\t\t\t<li id=\"key_10\">6</li>\r\n\t\t\t\t<li id=";
echo "\"key_11\">3</li>\r\n\t\t\t\t<li id=\"key_121\">字段</li>\r\n\t\t\t</ul>\r\n\t\t\t<ul class=\"fun\">\r\n\t\t\t\t<li id=\"key_13\" title=\"除\">/</li>\r\n\t\t\t\t<li id=\"key_14\" title=\"乘\">*</li>\r\n\t\t\t\t<li id=\"key_15\" title=\"减\">-</li>\r\n\t\t\t\t<li id=\"key_16\" title=\"加\">+</li>\r\n\t\t\t</ul>\r\n\t\t\t<ul class=\"fun\">\r\n\t\t\t\t<li id=\"key_17\" title=\"次方\">^</li>\r\n\t\t\t\t<li id=\"key_18\" title=\"取模\">%</li>\r\n\r\n\t\t\t\t<li id=\"key_20\">(</li>\r\n\t\t\t\t<li id=\"key_24\">)</li>\r\n\t\t\t</ul>\r\n\r\n\t\t\t<ul";
echo " class=\"fun\">\r\n\t\t\t\t<li id=\"key_33\" title=\"取绝对值\">abs(</li>\r\n\t\t\t\t<li id=\"key_34\" title=\"进一取整\">ceil(</li>\r\n\t\t\t\t<li id=\"key_35\" title=\"舍去法取整\">floor(</li>\r\n\t\t\t\t<li id=\"key_36\" title=\"对浮点数进行四舍五入\">round(</li>\r\n\t\t\t</ul>\r\n\t\t\t<ul class=\"op\">\r\n\t\t\t\t<li id=\"key_37\">←</li>\r\n\t\t\t\t<li id=\"key_38\">清空</li>\r\n\t\t\t\t<li id=\"key_39\" style=\"height:37px;line-height:37px\">验证</li>\r\n\t\t\t</ul>\r\n\t\t</div>\r\n\t</div>\r\n\t<d";
echo "iv id=\"expression\">\r\n\t\t<textarea name=\"userinput\" id=\"userinput\" cols=\"65\" rows=\"2\"/>";
echo $re_userinput;
echo "</textarea>\r\n\t</div>\r\n</div>\r\n<div id=\"LayerField\" >\r\n<table width=\"100%\" bgcolor=\"#666666\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\r\n\r\n\t";
$iacount = 0;
unset( $itemname );
$i = 0;
for ( ; $i < count( $itemArray ) - 1; ++$i )
{
if ( $itemname != "[A@]" )
{
++$iacount;
$itemname = $itemArray[$i];
}
echo "\t\t<tr>\r\n\t\t\t<td style=\"cursor:hand\" class=\"TableLine1\" onclick=\"GetFieldValue('[[";
echo $itemname;
echo "]]')\">\r\n\t\t\t";
echo $itemname;
echo "\t\t\t</td>\r\n\t\t</tr>\r\n\t";
}
echo "</table>\r\n</div>\r\n<br>\r\n<form id=\"exprform\" action=\"math.php\" method=\"get\">\r\n<input name=\"expr\" id='exprinput' type=\"hidden\" value=\"\" />\r\n<input name=\"fieldval\" id='fieldval' type=\"hidden\" value=\"\" />\r\n<input name=\"relationval\" id='relationval' type=\"hidden\" value=\"\" />\r\n<input name=\"FLOW_ID\" type=\"hidden\" value=\"";
echo $_REQUEST['FLOW_ID'];
echo "\" />\r\n<input name=\"ID\" type=\"hidden\" value=\"";
echo $_REQUEST['ID'];
echo "\" />\r\n<input name=\"prcToPrc\" type=\"hidden\" value=\"";
echo $_REQUEST['prcToPrc'];
echo "\" />\r\n</form>\r\n<div>\r\n";
echo "<s";
echo "pan id=\"textNote\" style=\"padding:5px\">\r\n注意<br>\r\n1,字符等于,开始字符,结束字符,包含字符 用于字符型的表达式,字符型表达式不需要验证。字符运算中,只有“+”号有效,使字符字段连接,别的运算符将会以字符显示。<br>\r\n2,数字运算,如果字段的值为字符,此字段的值将会以0处理。\r\n</span>\r\n\r\n</div>\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -