function addShortCutByDate($datefield, $showText = '') { if ($showText == '') { $showText = $datefield; } global $db, $SYSTEM_ADD_SQL, $SYSTEM_PRINT_SQL; global $增加对查询日期快捷方式的支持_是否启用; $增加对查询日期快捷方式的支持_是否启用 = 1; session_register("增加对查询日期快捷方式的支持"); if ($_SESSION['增加对查询日期快捷方式的支持'] == '') { $_SESSION['增加对查询日期快捷方式的支持'] = '设置为1'; } if ($_GET['增加对查询日期快捷方式的支持GET'] == "设置为0") { $_SESSION['增加对查询日期快捷方式的支持'] = '设置为0'; } elseif ($_GET['增加对查询日期快捷方式的支持GET'] == "设置为1") { $_SESSION['增加对查询日期快捷方式的支持'] = '设置为1'; } //print $_SESSION['增加对查询日期快捷方式的支持']; if (($_GET['action'] == "" || $_GET['action'] == "init_default") && $_SESSION['增加对查询日期快捷方式的支持'] == '设置为1') { print "<form name=formadd><table class=TableBlock width=100% ><tr><td nowrap class=TableContent align=left>"; if ($_GET['当前搜索方式'] == "当天") { $_GET['当前搜索方式'] = "当天 "; } if ($_GET['当前搜索方式'] == "") { $_GET['当前搜索方式'] = "没有选择"; } print "<font color=green>按 " . $showText . " 搜索:" . $_GET['当前搜索方式'] . ""; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "当天"); print " <a href=\"?{$FormPageAction}\">当天</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d") - 3, date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近三天"); print " <a href=\"?{$FormPageAction}\">最近三天</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d") - 7, date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近一周"); print " <a href=\"?{$FormPageAction}\">最近一周</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d") - 15, date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近半月"); print " <a href=\"?{$FormPageAction}\">最近半月</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m") - 1, date("d"), date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近一月"); print " <a href=\"?{$FormPageAction}\">最近一月</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m") - 2, date("d"), date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近两月"); print " <a href=\"?{$FormPageAction}\">最近两月</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m") - 3, date("d"), date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近三月"); print " <a href=\"?{$FormPageAction}\">最近三月</a>"; $FormPageAction = FormPageAction("开始时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m") - 6, date("d"), date("Y"))), "结束时间ADD", date("Y-m-d", mktime(0, 0, 1, date("m"), date("d"), date("Y"))), '', "当前搜索方式", "最近六月"); print " <a href=\"?{$FormPageAction}\">最近六月</a>"; print " <a href='?" . FormPageAction("增加对查询日期快捷方式的支持GET", "设置为0") . "'><font color=gray>关闭显示</font></a>"; print "</font></td></tr></table></form><BR>"; if ($_GET['开始时间ADD'] != "" && $_GET['结束时间ADD'] != "") { $SYSTEM_ADD_SQL .= "and {$datefield}>='" . $_GET['开始时间ADD'] . " 00:00:00' and {$datefield}<='" . $_GET['结束时间ADD'] . " 23:59:59'"; } } //$SYSTEM_PRINT_SQL = "1"; }
} $return = FormPageAction("action", "init_default"); print_infor("<b>审核通过</b>", 'trip', "location='?{$return}'", "?" . $return, 1); exit; } if ($_POST['action'] == "FouJue") { page_css(); $billid = $_GET['id']; $sql = "update crm_shenqingbaobei set state='3',shenheman='" . $_SESSION['LOGIN_USER_ID'] . "',shenhetime=now(),piyu='" . $_POST['piyu'] . "' where id='{$billid}'"; $rs = $db->Execute($sql); $return = FormPageAction("action", "init_default"); print_infor("<b>审核否决</b>", 'trip', "location='?{$return}'", "?" . $return, 1); exit; } if ($_GET['action'] == "edit_FouJue") { page_css(); $billid = $_GET['id']; $sql = "update crm_shenqingbaobei set state='1',shenheman='',shenhetime=null,piyu='' where id='{$billid}'"; $rs = $db->Execute($sql); deleteMessage("项目报备", $billid); $return = FormPageAction("action", "init_default"); print_infor("<b>撤销审核</b>", 'trip', "location='?{$return}'", "?" . $return, 1); exit; } addShortCutByDate("createtime", "申请时间"); $SYSTEM_ADD_SQL = getCustomerRoleByCustID($SYSTEM_ADD_SQL, "customerid"); //数据表模型文件,对应Model目录下面的crm_shenqingbaobei_newai.ini文件 //如果是需要复制此模块,则需要修改$parse_filename参数的值,然后对应到Model目录 新文件名_newai.ini文件 $filetablename = 'crm_shenqingbaobei'; $parse_filename = 'crm_shenqingbaobei'; require_once 'include.inc.php';
function show_submit_element($action_submit, $align = 'middle') { global $common_html, $_GET; global $tablename, $primarykey_index, $print_title; $temp_array = explode('_', $_GET['action']); $mark = $temp_array[1]; $action_model_array = explode(',', $action_submit); // var_dump($action_model_array);//by cwf for ($i = 0; $i < sizeof($action_model_array); $i++) { $index_mid = $action_model_array[$i]; $index_array = explode('_', $index_mid); $index = $index_array[0]; $index_array = explode(':', $index); $index0 = $index_array[0]; $index1 = $index_array[1]; if ($index1 != '') { $index_name = $index1; } else { $index_name = $index0; } switch ($index0) { case 'submit': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = ""; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'submit'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'submit'; // var_dump($array);//by cwf break; case 'cancel': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "if((is_ie && history.length==0) || (!is_ie && history.length==1)) window.close();else history.back();"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'cancel'; break; case 'return': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "history.back();"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; //角色权限时用到MySubmit //角色权限时用到MySubmit case 'mysubmit': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "mysubmit();"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['mysubmit'] = 'mysubmit'; $array[$i]['name'] = 'mysubmit'; break; case 'userdefine': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = ""; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'submit'; $array[$i]['name'] = 'IsSendMail_Button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['userdefine'] = 'userdefine'; break; case 'userdefine1': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "UserDefaultAdd();"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['name'] = 'userdefine1'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['userdefine1'] = 'userdefine1'; break; case 'modifyrecord': $array[$i]['value'] = $common_html['common_html'][$index_name]; $array[$i]['title'] = $common_html['common_html'][$index_name]; $array[$i]['url'] = "window.open('../JXC/modifyrecord_newai.php?" . base64_encode("tablename={$tablename}&keyfield=" . $primarykey_index . "&keyvalue=" . $_GET[$primarykey_index]) . "');"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['name'] = 'modifyrecord'; $array[$i]['shortcut'] = $index_array[2]; break; case 'add': $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "location='?action=" . $index0 . "_" . $mark . "'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'add'; break; case 'init': //print_R($index_array); if ($index_array[3] == 'email' || $index_array[3] == 'sms') { $temp_mark = $index_array[1]; } else { $temp_mark = $mark; } $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "location='?action=" . $index0 . "_" . $temp_mark . "'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; case 'delete': global $primarykey_index; $newarray = returnpagearray(); $newarray['action'] = 'delete_array'; //$newarray['returnmodel']=''; $newarray['pageid'] = $_GET['pageid'] != '' ? $_GET['pageid'] : 1; $newarray['selectid'] = $_GET[$primarykey_index] . ","; $makestring = makestring($newarray); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "javascript:if(confirm('" . $common_html['common_html']['reallydelete'] . "'))location='?{$makestring}'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; case 'set': $return = FormPageAction(); global $tablename; $temp_index = explode(':', $index_mid); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "location='?action=" . $temp_index[0] . "&table_name={$tablename}&table_action=" . $_GET['action'] . "'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; case 'print': $return = FormPageAction(); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "print_control();"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'print'; break; case 'export': $return = FormPageAction(); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "XExportToExcel('" . $print_title . "');"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'export'; break; case 'savelink': $return = FormPageAction(); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "form1.action=form1.action+'&addlink=1'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'submit'; $array[$i]['shortcut'] = $index_array[2]; $array[$i]['name'] = 'savelink'; break; case 'reply': //$actionValue=explode("_",$_GET['action']); $actionValueText = ""; //for($m=1;$m<sizeof($actionValue);$m++) { //$actionValueText.="_".$actionValue[$m]; //} $actionValueText = "edit_reply"; $return = FormPageAction("action", $actionValueText); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "location='?{$return}'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; case 'forward': //$actionValue=explode("_",$_GET['action']); $actionValueText = ""; //for($m=1;$m<sizeof($actionValue);$m++) { //$actionValueText.="_".$actionValue[$m]; //} $actionValueText = "edit_forward"; $return = FormPageAction("action", $actionValueText); $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " "; $array[$i]['url'] = "location='?{$return}'"; $array[$i]['class'] = 'SmallButton'; $array[$i]['type'] = 'button'; $array[$i]['shortcut'] = $index_array[2]; break; } } is_array($array) ? print_submit_element_array($array, $align, 6) : ''; }
ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); error_reporting(E_WARNING | E_ERROR); require_once 'lib.inc.php'; $GLOBAL_SESSION = returnsession(); validateMenuPriv("报销单审核"); if ($_GET['action'] == "shenhedan") { $CaiWu = new CaiWu($db); $db->StartTrans(); $billid = $_GET['单号']; $feiyonginfo = returntablefield("v_feiyong_sq", "单号", $billid, "金额,费用类型"); $jine = $feiyonginfo['金额']; $fytype = $feiyonginfo['费用类型']; $sql = "update crm_feiyong_sq set 是否审核='4',出纳员='" . $_SESSION['LOGIN_USER_ID'] . "',支付时间=now() where 单号='{$billid}'"; $rs = $db->Execute($sql); $CaiWu->insertFeiYongAccount($fytype, $jine, 1, $_SESSION['LOGIN_USER_ID'], -1); //是否事务出现错误 if ($db->HasFailedTrans()) { print "<script language=javascript>alert('错误:" . str_replace("'", "\\'", $db->ErrorMsg()) . "');window.history.back(-1);</script>"; } else { page_css("报销单审核"); $return = $return . "?" . FormPageAction("action", "init_default"); print_infor("已报销", 'trip', "location='?{$return}'", "{$return}", 0); } $db->CompleteTrans(); exit; } addShortCutByDate("创建时间", "申请时间"); $filetablename = 'v_feiyong_sq'; $parse_filename = 'v_feiyong_sq'; require_once 'include.inc.php';
} $showlistfieldfilter = $file_ini[$action]['showlistfieldfilter']; $primarykey_index = $columns[$primarykey]; $html_etc = returnsystemlang($tablename, $SYTEM_CONFIG_TABLE); page_css($IE_TITLE); require_once 'systemsetting.php'; if (sizeof($action_array) >= 3 && $action_array[2] != 'config') { $formnewvar = formnewvar($file_ini[$action], $_GET['FLD_STR']); updatesystemsetting($formnewvar); $return = returnpageaction($mode = 'edit_init', array('index_name' => 'action', 'index_id' => $returnmodel)); print_infor($common_html['common_html']['setsuccess'], 'trip', "location='?{$return}'", "?{$return}"); exit; } else { if (sizeof($action_array) >= 3 && $action_array[2] == 'config') { usesystemsetting(); $return = FormPageAction("action", $returnmodel); //$return=returnpageaction($mode='edit_init',array('index_name'=>'action','index_id'=>$returnmodel)); print_infor($common_html['common_html']['systemconfigsuccess'], 'trip', "location='?{$return}'", "?{$return}"); exit; } } $showlistfieldlist_array = explode(',', $showlistfieldlist); for ($i = 0; $i < sizeof($showlistfieldlist_array); $i++) { $value['record'][$i]['name'] = $html_etc[$tablename][(string) $columns['' . $showlistfieldlist_array[$i] . '']]; $value['record'][$i]['value'] = $showlistfieldlist_array[$i]; } //$showlistfieldlist=returnsystemsetting($tablename,$action,'FIELD_LIST',$showlistfieldlist); //$showlistfieldlist_array=explode(',',$showlistfieldlist); $value['table_name'] = $tablename; $value['table_action'] = $_GET['table_action']; $value['titleleft'] = $common_html['common_html']['yoursetinfor'];
function parent_group() { global $common_html, $db, $group_user, $_GET; global $SUNSHINE_USER_NAME_VAR, $SUNSHINE_USER_ID_VAR, $_SESSION; $group_array = return_parent_group(); //print_R($group_array['sql_text']); $array_pop = array_pop($group_array['sql_text']); switch ($db->databaseType) { case 'mssql': $select_text = "[" . join('],[', $group_array['sql_text']) . "]"; break; case 'mysql': default: $select_text = join(',', $group_array['sql_text']); break; } //end switch $user_session = $_SESSION[$SUNSHINE_USER_NAME_VAR]; $parentvalue = isset($parentvalue) ? $parentvalue : $_GET[(string) $group_array['sql_text'][id]]; $parentvalue = isset($parentvalue) ? $parentvalue : 0; $_GET['GROUP_TWO'] = isset($_GET['GROUP_TWO']) ? $_GET['GROUP_TWO'] : 0; switch ($array_pop) { case 'user': break; case 'group': $temp_field = $group_array['sql_text'][user]; $user_session = $_GET[$temp_field]; $add_text_group = $group_array['sql_text'][user] . "=" . $user_session . ""; break; default: break; } //print_R($group_array); //$sql="select $select_text from ".$group_array['tablename']." where ".$group_array['sql_text'][user]."='$user_session' and ".$group_array['sql_text'][parent]."='$parentvalue'"; switch ($db->databaseType) { case 'mssql': $sql = "select {$select_text} from [" . $group_array['tablename'] . "] where [" . $group_array['sql_text'][user] . "]='{$user_session}' and [" . $group_array['sql_text'][parent] . "]='{$parentvalue}'"; break; case 'mysql': default: $sql = "select {$select_text} from " . $group_array['tablename'] . " where " . $group_array['sql_text'][user] . "='{$user_session}' and " . $group_array['sql_text'][parent] . "='{$parentvalue}'"; break; } //end switch $rs = $db->Execute($sql); $navigation = return_parent_group_all($group_array, $select_text, $user_session); $navigation['index_name'][0] = 'Root'; $navigation_name = $_GET[(string) $group_array['sql_text'][id]]; $navigation_name = isset($navigation_name) ? $navigation_name : 0; $nav_array = return_navigation($navigation, $navigation_name); print "<TR bgColor='#FFFFFF' onMouseOut=bgColor='#FFFFFF' onMouseOver=bgColor='#E6F2FF'>\n"; print "<TD noWrap align=left colspan=32> \n"; for ($i = 0; $i < sizeof($nav_array); $i++) { $return_parent = FormPageAction($group_array['sql_text'][id], $nav_array[$i]); //$return_parent=returnpageaction($mode='group_filter',array('index_name'=>$group_array['sql_text'][id],'index_id'=>$nav_array[$i])); //if($i!=sizeof($nav_array)-1) { print "<a href=\"?{$return_parent}\">" . $navigation['index_name'][(string) $nav_array[$i]] . "</a> >> "; //} //else { // print $navigation['index_name'][(string)$nav_array[$i]]; //} } print "</TD></TR>\n"; global $row_element; while (!$rs->EOF) { $counter++; print "<TR bgColor='#FFFFFF' onMouseOut=bgColor='#FFFFFF' onMouseOver=bgColor='#E6F2FF'>\n"; print "<TD noWrap align=left colspan=32> \n"; //$return=returnpageaction($mode='group_filter',array('index_name'=>$group_array['sql_text'][id],'index_id'=>$rs->fields[(string)$group_array['sql_text'][id]])); $return = FormPageAction($group_array['sql_text'][id], $rs->fields[(string) $group_array['sql_text'][id]]); print "<a href=\"?{$return}\">" . $rs->fields[(string) $group_array['sql_text'][name]] . "</a>\n"; if ($row_element != '') { print "¡¡[<a href='?action=edit_group&" . $group_array['sql_text'][id] . "=" . $rs->fields[(string) $group_array['sql_text'][id]] . "&" . $group_array['sql_text'][parent] . "=" . $rs->fields[(string) $group_array['sql_text'][parent]] . "&{$add_text_group}'>" . $common_html['common_html']['edit'] . "</a>\n"; print "<a href=\"javascript:if(confirm('" . $common_html['common_html']['reallydeletefolder'] . "'))location='?action=delete_group&" . $group_array['sql_text'][id] . "=" . $rs->fields[(string) $group_array['sql_text'][id]] . "&" . $group_array['sql_text'][parent] . "=" . $rs->fields[(string) $group_array['sql_text'][parent]] . "&{$add_text_group}'\">" . $common_html['common_html']['delete'] . "</a>]\n"; } //end if--row_element print "</TD>\n"; print "</TR>\n"; $rs->MoveNext(); } }
function newaiinit_bottom($rc, $pageid, $pagenums, $ROWS_PAGE, $add, $add_var, $action_page = 'action_page', $action_page_value = 'action_page_value') { global $common_html, $html_etc; global $_GET, $_POST, $read_type; global $bottom_element; //print $bottom_element; global $edit_attribute, $group_user, $primarykey_index; global $row_element, $primarykey, $columns; global $tablename; $primarykey_index = $columns[$primarykey]; global $fields; $row_element_array = explode(',', $bottom_element); for ($i = 0; $i < sizeof($row_element_array); $i++) { $row_element_array_element = explode(':', $row_element_array[$i]); $row_element_index[(string) $row_element_array_element[0]] = $row_element_array_element[1]; //print_R($row_element_index); $row_element_index[(string) $row_element_array_element[2]] = $row_element_array_element[3]; //print_R($row_element_index); } $init = $_GET['action']; $init_array = explode('_', $init); $init = $init_array[0] . "_" . $init_array[1]; //require_once("lib2.inc.php"); print "<tr>\n"; print "<td class=TableData noWrap colspan=" . $fields['table']['colspan'] . ">"; if ($rc == 0) { $disabled = 'disabled'; } else { $disabled = ''; } $bottom_array = explode(',', $bottom_element); for ($i = 0; $i < sizeof($bottom_array); $i++) { $element_array = explode(':', $bottom_array[$i]); $index_name = $element_array[1] == '' ? $element_array[0] : $element_array[1]; switch ($element_array[0]) { case 'chooseall': print "<input type=\"checkbox\" name=\"allbox\" id='allbox' {$disabled} accesskey='c' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+C\" onClick=\"check_all();\">" . $common_html['common_html']['chooseall'] . " \n"; break; case 'delete': $row_element_index_delete = $row_element_index['delete']; $temp_array = explode('_', $row_element_index_delete); //print_R(sizeof($temp_array)); sizeof($temp_array) == 1 ? $row_element_index_delete = 'delete_array' : ''; $row_element_index_delete = $element_array[1]; $row_element_index_delete != "" ? '' : ($row_element_index_delete = "delete_array"); print "<input type=\"button\" accesskey='d' value=\"" . $common_html['common_html']['delete'] . "\" class=\"SmallButton\" {$disabled} onClick=\"delete_element('{$init}','{$row_element_index_delete}');\" title=\"" . $common_html['common_html']['accesskey'] . ":ALT+D " . $common_html['common_html']['accesskeyusermethod'] . "\"> \n"; break; case 'operation': case 'operation': $row_element_index_delete = $row_element_index['operation']; $temp_array = explode('_', $row_element_index_delete); sizeof($temp_array) == 1 ? $row_element_index_delete = 'operation_' : ($row_element_index_delete = ''); $lastactionname = "action=" . $row_element_index_delete . $element_array[1]; print "<input type=\"button\" value=\"" . $common_html['common_html'][$index_name] . "\" class=\"SmallButton\" {$disabled} onClick=\"operation_element('{$lastactionname}','{$element_array['3']}');\" title=\"" . $common_html['common_html'][$index_name] . "\"> \n"; //$return_forward=FormPageAction("action","report_default"); //print "<input type=\"button\" accesskey='d' value=\"".$common_html['common_html'][$index_name]."\" class=\"SmallButton\" $disabled onClick=\"operation_element('$return_add');\" title=\"".$common_html['common_html'][$index_name]."\"> \n"; break; case 'edit': $actionValueText = ""; if ($element_array[1] == "edit") { $element_array[1] = "edit_default"; } $actionValue = explode("_", $element_array[1]); for ($m = 1; $m < sizeof($actionValue); $m++) { $actionValueText .= "_" . $actionValue[$m]; } $actionValueText = "edit" . $actionValueText; $title1 = $common_html['common_html']['edit']; $title2 = $actionValueText; if ($html_etc[$tablename][$title2] == "") { $titleText = $title1; } else { $titleText = $html_etc[$tablename][$title2]; } //print_R($tablename); $return_add = FormPageAction("action", $actionValueText, '', '', "selectid"); $row_element_index_edit = $row_element_index['edit']; print "<input type=\"button\" accesskey='e' value=\"" . $titleText . "\" class=\"SmallButton\" {$disabled} onClick=\"edit_element('{$init_array['1']}','{$return_add}');\" title=\" " . $common_html['common_html']['accesskey'] . ":ALT+E " . $common_html['common_html']['accesskeyusermethod'] . "\"> \n"; break; case 'move': print "<input type=\"button\" accesskey='m' value=\"" . $common_html['common_html']['move'] . "\" class=\"SmallButton\" {$disabled} onClick=\"move_element('{$init}');\" title=\"" . $common_html['common_html']['move'] . "\"> \n"; break; } //end switch } //print_R($add_var);; //print $return=returnpageaction($mode='page',array('index_name'=>'pageid','index_id'=>1)); if ($add != "" && $add_var != "") { /* if($pageid<=1) {echo "".$common_html['common_html']['firstpage']." ";echo "".$common_html['common_html']['prevpage']." ";} else { $return=FormPageAction("pageid",1); echo "<a href=\"?$return\" accesskey='f' title=\"".$common_html['common_html']['firstpage']."\">".$common_html['common_html']['firstpage']."</a> "; $return=FormPageAction("pageid",$pageid-1); echo "<a href=\"?$return\" accesskey='p' title=\"".$common_html['common_html']['prevpage']."\">".$common_html['common_html']['prevpage']."</a> "; }//end if if($pageid==$pagenums) {echo "".$common_html['common_html']['nextpage']." ";echo "".$common_html['common_html']['lastpage']."";} else { $return=FormPageAction("pageid",$pageid+1); echo "<a href=\"?$return\" accesskey='n' title=\"".$common_html['common_html']['nextpage']."\">".$common_html['common_html']['nextpage']."</a> "; $return=FormPageAction("pageid",$pagenums); echo "<a href=\"?$return\" accesskey='l' title=\"".$common_html['common_html']['lastpage']."\">".$common_html['common_html']['lastpage']."</a> "; }//end if */ if ($pagenums <= 30) { for ($i = 1; $i <= $pagenums; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } } $PrevPageNumber = 8; $LastPageNumber = 4; $tempNumber = $pagenums - $LastPageNumber; if ($pagenums > 30) { if ($pageid <= $LastPageNumber) { for ($i = 1; $i <= $PrevPageNumber; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print "... "; $leftNumber = $pagenums - $PrevPageNumber - $LastPageNumber; $leftNumber = ceil($leftNumber / 2); $MiddleNumber = ceil($pagenums / 2); if ($leftNumber > 2) { $leftNumber = 2; } $BeginNumber = $MiddleNumber - $leftNumber; for ($i = $BeginNumber; $i <= $BeginNumber + 4; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print "... "; for ($i = $tempNumber; $i <= $pagenums; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } } else { if ($pageid > 8 && $pageid <= $tempNumber) { for ($i = 1; $i <= 5; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print "... "; if ($tempNumber - $pageid >= $LastPageNumber) { $Begin = $pageid - 4; $End = $pageid + $LastPageNumber; } else { $Begin = $pageid - 6; $End = $tempNumber - 1; } //print $tempNumber."||".$pageid."||".$Begin."||".$End; for ($i = $Begin; $i <= $End; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print ".... "; if ($pageid == $tempNumber) { $结束数字 = $pagenums - 3; $开始数字 = $tempNumber - 3; } else { $结束数字 = $pagenums; $开始数字 = $tempNumber; } for ($i = $开始数字; $i <= $结束数字; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } } else { //########################################################### if ($pageid == $PrevPageNumber) { $结束数字 = $PrevPageNumber + 3; $开始数字 = 3; } else { $结束数字 = $PrevPageNumber; $开始数字 = 1; } for ($i = $开始数字; $i <= $结束数字; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print "... "; $leftNumber = $pagenums - $PrevPageNumber - $LastPageNumber; $leftNumber = ceil($leftNumber / 2); $MiddleNumber = ceil($pagenums / 2); if ($leftNumber > 2) { $leftNumber = 2; } $BeginNumber = $MiddleNumber - $leftNumber; for ($i = $BeginNumber; $i <= $BeginNumber + 4; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } print ".... "; for ($i = $tempNumber; $i <= $pagenums; $i++) { if ($pageid == $i) { $IText = "<B>{$i}</B>"; } else { $IText = $i; } $return = FormPageAction("pageid", $i); print "<a href=\"{$PHP_SELF}?{$return}\">{$IText}</a> "; } } } } //分页结束 } else { if ($pageid <= 1) { echo "" . $common_html['common_html']['firstpage'] . " "; echo "" . $common_html['common_html']['prevpage'] . " "; } else { $return = FormPageAction("pageid", 1); echo "<a href=\"?{$return}\" accesskey='f' title=\"" . $common_html['common_html']['firstpage'] . "\">" . $common_html['common_html']['firstpage'] . "</a> "; $return = FormPageAction("pageid", $pageid - 1); echo "<a href=\"?{$return}\" accesskey='p' title=\"" . $common_html['common_html']['prevpage'] . "\">" . $common_html['common_html']['prevpage'] . "</a> "; } //end if if ($pageid == $pagenums) { echo "" . $common_html['common_html']['nextpage'] . " "; echo "" . $common_html['common_html']['lastpage'] . " "; } else { $return = FormPageAction("pageid", $pageid + 1); echo "<a href=\"?{$return}\" accesskey='n' title=\"" . $common_html['common_html']['nextpage'] . "\">" . $common_html['common_html']['nextpage'] . "</a> "; $return = FormPageAction("pageid", $pagenums); echo "<a href=\"?{$return}\" accesskey='l' title=\"" . $common_html['common_html']['lastpage'] . "\">" . $common_html['common_html']['lastpage'] . "</a> "; } //end if } //print $add_var; print "(" . $common_html['common_html']['page'] . " " . $pageid . "/" . $pagenums . " " . $common_html['common_html']['allnumbers'] . " " . $rc . ") \n"; if ($add == '' || $add_var == '') { $add = 'add'; $add_var = 'add_var'; } print "<input type=\"hidden\" name=\"ADD_INPUT\" value=\"{$add}\">\n"; print "<input type=\"hidden\" name=\"ADD_VAR_INPUT\" value=\"{$add_var}\">\n"; print "<input type=\"hidden\" name=\"action_page\" value=\"{$action_page}\">\n"; //$return=returnpageaction($mode='init_delete',array()); $return_array = explode('&', $return); array_shift($return_array); array_pop($return_array); $return = join('&', $return_array); print "<input type=\"hidden\" name=\"action_page_value\" value=\"{$return}\">\n"; //print "<input type=\"button\" accesskey='j' value=\"".$common_html['common_html']['indexto']."\" class=\"SmallButton\" onclick=\"set_page('$init');\" title=\"".$common_html['common_html']['indexto']."\"> \n"; print "<input type=\"hidden\" name=\"PAGE_NUM\" value=\"{$pageid}\" accesskey='m' class=\"SmallInput\">\n"; //定义什么情况下面显示页面数字的排列,当此变量为1时不显示,没有定义或其它值时显示,默认为不定义此变量,显示 global $pagestop_model; if ($pagestop_model != "1") { print "<select class=\"SmallSelect\" title=\"" . $common_html['common_html']['selectpage'] . "\" onChange=\"var jmpURL='?' + this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}\" name=\"PageSelect\" >\n<option value='1' >" . $common_html['common_html']['selectpage'] . "</option>\n"; $_GET['pageid'] == '' ? $_GET['pageid'] = 1 : ''; $MaxPageNum = 200; if ($pagenums > $MaxPageNum) { $BeginPage = $_GET['pageid'] - $MaxPageNum; $EndPage = $_GET['pageid'] + $MaxPageNum; } else { $BeginPage = 1; $EndPage = $pagenums; } $BeginPage < 1 ? $BeginPage = 1 : ''; for ($i = $BeginPage; $i <= $EndPage; $i++) { $PageLinkUrl = FormPageAction("pageid", $i); if ($_GET['pageid'] == $i) { $SelectText = "selected"; } else { $SelectText = ""; } print "<option value='{$PageLinkUrl}' {$SelectText} > " . $common_html['common_html']['page'] . " {$i}</option>\n"; } print "</select>\n"; } //定义页面数字排列结束 //提示排序显示文本 2010-9-16 16:05 global $systemorder; if ($systemorder != "") { $systemorderDESCTEXT = array("desc" => "倒序", "asc" => "顺序"); $systemorderArray = explode(',', $systemorder); $systemorderTextArray = array(); for ($iA = 0; $iA < sizeof($systemorderArray); $iA++) { $systemorderArray2 = explode(':', $systemorderArray[$iA]); $systemorderID = $systemorderArray2[0]; $systemorderDESC = $systemorderArray2[1]; $systemorderNAME = $html_etc[$tablename][$columns[$systemorderID]]; if ($systemorderNAME != "") { $systemorderTextArray[] .= $systemorderNAME . "," . $systemorderDESCTEXT[$systemorderDESC] . ""; } } $systemorderText = join(' ', $systemorderTextArray); $systemorderText = "<font color=gray>[本页面排序方式:" . $systemorderText . "]</font>"; } print "{$systemorderText}</td></tr>\n"; }
function show_new_element($action_model, $location_title = '') { global $common_html, $action_model, $_GET, $tablename; global $group_user, $_SESSION; //权限体系分配; $USER_PRIV_ID = $_SESSION['SUNSHINE_USER_PRIV']; $USER_PRIV = returntablefield("user_priv", "USER_PRIV", $USER_PRIV_ID, "PRIV_Name"); $action_model_array = explode(',', $action_model); // var_dump($action_model_array);//by cwf ={'add_default','new','n'} for ($i = 0; $i < sizeof($action_model_array); $i++) { $model_index_array = explode(':', $action_model_array[$i]); // var_dump($model_index_array);//---by cwf $index_mid = $model_index_array[0]; //=add_default ---by cwf $index = $model_index_array[1]; //=new ---by cwf if ($index == 'export' && $_SESSION['LOGIN_USER_PRIV'] == 3) { continue; } if ($index == '') { $index_array = explode('_', $index_mid); $index = $index_array[0]; } //得到系统文件分配权限 $USER_PRIV_USER = $model_index_array[3]; if ($USER_PRIV_USER == "" || ($USER_PRIV_USER == $USER_PRIV || $USER_PRIV == '1' || $USER_PRIV == '2')) { switch ($index) { case 'set': //$url="?action=".$index_mid."&table_name=$tablename&table_action=".$_GET['action']; $actionValue = explode("_", $_GET['action']); $actionValueText = ""; for ($m = 1; $m < sizeof($actionValue); $m++) { $actionValueText .= "_" . $actionValue[$m]; } $actionValueText = "set" . $actionValueText; $return = FormPageAction("action", $actionValueText, "table_name", $tablename, '', "table_action", $_GET['action'], "returnmodel", $_GET['action']); $url = "?" . $url; break; case 'setlang': $url = "systemlang.php?action=init_default&tablename={$tablename}"; break; case 'exportadv': $return = FormPageAction("actionadv", $index_mid); //$return=returnpageaction($mode='init_exportadv',array('index_name'=>'action','index_id'=>$index_mid)); $url = "?{$return}"; break; case 'export': $return = FormPageAction("action", $index_mid); //$return=returnpageaction($mode='init_exportadv',array('index_name'=>'action','index_id'=>$index_mid)); $url = "?{$return}"; break; default: $group_array = return_parent_group(); //此函数在newai.php中定义 // var_dump($group_array);//返回group_user相关的信息 ---by cwf if (sizeof($group_array['sql_text']) > 1) { $temp_get_parent = isset($_GET[(string) $group_array['sql_text']['parent']]) ? $_GET[(string) $group_array['sql_text']['parent']] : 0; $temp_get = $_GET[(string) $group_array['sql_text']['id']]; $temp_get = isset($temp_get) ? $temp_get : 0; switch ($group_array['sql_text']['type']) { case 'group': $sql_text_user = $group_array['sql_text']['user'] . "=" . $_GET[(string) $group_array['sql_text']['user']]; break; case 'user': $sql_text_user = ''; break; default: $sql_text_user = ''; break; } } else { //$return=FormPageAction("action",$index_mid); //exit($return); $return = base64_encode("action=" . $index_mid); //$return=returnpageaction($mode='init_add',array('index_name'=>'action','index_id'=>$index_mid)); $url = "?{$return}"; } break; } //if($index!='init') $array[$i]['value'] = " " . $common_html['common_html'][$index] . " "; $array[$i]['title'] = " " . $common_html['common_html'][$index] . " "; $array[$i]['url'] = $url; $array[$i]['shortcut'] = $model_index_array[2]; $array[$i]['class'] = 'SmallButton'; //} } //end switch } //end 用户权限划分 //系统调试模式 global $systemmode; if ($systemmode == 'test') { $array[$i + 1]['value'] = " " . $common_html['common_html']['setlang'] . " "; $array[$i + 1]['title'] = " " . $common_html['common_html']['setlang'] . " "; $array[$i + 1]['url'] = "systemlang_newai.php?action=init_default&tablename={$tablename}"; $array[$i + 1]['shortcut'] = 't'; $array[$i + 1]['class'] = 'SmallButton'; } // print_R($array); print_new_element_array($array, $location_title); }