HRMS文件解析2

returntablefieldColorFilterGray()函数在/lib/select_menu.php文件中,函数如下:

  1 function returntablefieldColorFilterGray($tablename,$what,$value,$return,$groupfield='',$groupvalue='',$字段名称='',$hascolor=false)        { // 仅用于TABLEFILTERCOLOR函数
  2 
  3     /*
  4      global $return_sql_line;
  5      $where_sql = $return_sql_line['where_sql'];;
  6      $where_sql_array = explode("where",$where_sql);
  7      if(trim($where_sql_array[1])!=""&&$字段名称!="")        {
  8         $ADD_SQL_WHERE_TEXT = " and $return in (select distinct $字段名称 $where_sql)";
  9         }
 10         else    {
 11         $ADD_SQL_WHERE_TEXT = "";
 12         }
 13         */
 14     global $db;
 15     if($value=='')
 16         return;
 17     if($groupfield!=""&&$groupvalue!="")        {
 18         $sql = "select  $return,$what from $tablename where $what='$value' and $groupfield='$groupvalue' $ADD_SQL_WHERE_TEXT";
 19         $TEMP_TAR = 1;
 20     }
 21     else    {
 22         $sql = "select  $return,$what from $tablename where $what='$value' $ADD_SQL_WHERE_TEXT";  // select DEPT_NAME,DEPT_NAME from department where DEPT_NAME='网络与数据中心'
 23         $TEMP_TAR = 0;
 24     }
 25     
 26     
 27     $return2 = '';
 28     $rs=$db->CacheExecute(15,$sql);
 29     
 30     $rs_a = $rs->GetArray();
 31     
 32             if(sizeof($rs_a)==0 || $rs_a[0][$return]=="")            {  // 是否有返回值
 33                 $return2 = "<font color=gray title='在".$tablename."表关联信息中,找不到与本值对应的信息.'>$value</font>"; // 没有返回值,这个值颜色变灰色
 34             }
 35             else
 36             {                            //有返回值,进行着色处理
 37                 
 38                 $cutvalue=cutStr($rs_a[0][$return],13);
 39                 $tip='';
 40                 if($rs_a[0][$return]!=$cutvalue)
 41                 {
 42                     $tip="title='".$rs_a[0][$return]."'";
 43                     $rs_a[0][$return]=$cutvalue."..";
 44                 }
 45                 
 46                 $colorValue = setColorByName($value); //根据 汉族 这个词语,进行涂色,函数定义也在select_menu.php中
 47                 if($value=="是")
 48                     $colorValue="green";
 49                 else if($value=="否")
 50                     $colorValue="red";
 51                 //print "".strval($value)."";exit;
 52                 //print_r($rs_a);exit;
 53                 
 54                 if($tablename == 'customer'){
 55                     
 56                     $id = $rs_a[0][$what];
 57                     
 58                     $return2 = "<a target='_blank' $tip href='../JXC/customer_newai.php?".base64_encode("action=view_default&ROWID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
 59                 }elseif($tablename == 'supply'){
 60                     
 61                     $id = $rs_a[0][$what];
 62                     
 63                     $return2 = "<a target='_blank' $tip href='../JXC/supply_newai.php?".base64_encode("action=view_default&ROWID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
 64                     
 65                 }elseif($tablename == 'linkman'){
 66                     //$id = isset($rs_a[0]['ROWID'])?$rs_a[0]['ROWID']:$value;
 67                     
 68                     if(isset($rs_a[0]['ROWID'])){
 69                         $id = $rs_a[0]['ROWID'];
 70                         $qq=returntablefield("linkman", "rowid", $id, "fax");
 71                         
 72                         $return2 = "<a target='_blank' $tip href='../JXC/linkman_newai.php?".base64_encode("action=view_default&ROWID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
 73                     }
 74                     else 
 75                         $return2=$rs_a[0][$return];
 76                 }elseif($tablename == 'supplylinkman'){
 77                     //$id = isset($rs_a[0]['ROWID'])?$rs_a[0]['ROWID']:$value;
 78                     if(isset($rs_a[0]['ROWID'])){
 79                         $id = $rs_a[0]['ROWID'];
 80                     }else{
 81                         $sql = "select ROWID from $tablename where supplyname='".$value."'";
 82                         $rowid_rs=$db->CacheExecute(15,$sql);
 83                         $rowid = $rowid_rs->GetArray();
 84                         $id = $rowid[0]['ROWID'];
 85                     }
 86                     $return2 = "<a target='_blank' $tip href='../JXC/supplylinkman_newai.php?".base64_encode("action=view_default&ROWID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
 87                     
 88                 }elseif($tablename == 'user'){
 89                     if(isset($rs_a[0]['ROWID'])){
 90                         $id = $rs_a[0]['ROWID'];
 91                     }else{
 92                         $sql = "select UID from $tablename where USER_ID='".$value."'";
 93                         $rowid_rs=$db->CacheExecute(15,$sql);
 94                         $rowid = $rowid_rs->GetArray();
 95                         $id = $rowid[0]['UID'];
 96                     }
 97                     $return2 = "<a target='_blank' $tip href='../Framework/user_newai.php?".base64_encode("action=view_default&UID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
 98                     
 99                 }elseif($tablename == 'crm_chance'){
100                     if(isset($rs_a[0]['编号'])){
101                         $id = $rs_a[0]['编号'];
102                     }else{
103                         $sql = "select 编号  from $tablename where 机会主题='".$value."'";
104                         $rowid_rs=$db->CacheExecute(15,$sql);
105                         $rowid = $rowid_rs->GetArray();
106                         $id = $rowid[0]['编号'];
107                     }
108                     $return2 = "<a target='_blank' $tip href='../JXC/crm_chance_newai.php?".base64_encode("action=view_default&编号=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
109                     
110                 }
111                 elseif($tablename == 'product'){
112                     
113                     $return2 = "<a target='_blank' $tip href='../JXC/product_newai.php?".base64_encode("action=view_default&productid=".$value)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
114                     
115                 }
116                 elseif($tablename == 'sellplanmain'){
117                     
118                         $id = $rs_a[0]['billid'];
119                         
120                         $billtype=returntablefield($tablename, "billid", $id, "billtype");
121                         
122                         if($billtype==1)    
123                             $urlName="sellcontract";
124                         else if($billtype==2)
125                             $urlName="sellplanmain";
126                         else if($billtype==3)
127                             $urlName="sellonemain";
128                     $return2 = "<a target='_blank' $tip href='../JXC/".$urlName."_newai.php?".base64_encode("action=view_default&billid=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
129                     
130                 }
131                 elseif($tablename == 'buyplanmain'){
132                     
133                         $id = $rs_a[0]['billid'];
134                     
135                     $return2 = "<a target='_blank' $tip href='../JXC/buyplanmain_newai.php?".base64_encode("action=view_default&billid=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
136                     
137                 }
138                 elseif($tablename == 'stock'){
139                     
140                     $id = $rs_a[0]['ROWID'];
141                     $return2 = "<a target='_blank' $tip href='../JXC/store_product_newai.php?".base64_encode("action=init_default&storeid=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
142                     
143                 }
144                 elseif($tablename == 'bank'){
145                     
146                     $id = $rs_a[0][$what];
147                     $return2 = "<a target='_blank' $tip href='../JXC/v_accessbank_newai.php?".base64_encode("action=init_default&银行账户=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
148                     
149                 }
150                 elseif($tablename == 'fahuotype'){
151                     
152                     $id = $rs_a[0]['id'];
153                     $return2 = "<a target='_blank' $tip href='../JXC/fahuodan_newai.php?".base64_encode("action=init_default&fahuotype=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
154                     
155                 }
156                 elseif($tablename == 'customerproduct'){
157                     
158                     $id = $rs_a[0]['ROWID'];
159                     $return2 = "<a target='_blank' $tip href='../JXC/customerproduct_newai.php?".base64_encode("action=view_default&ROWID=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
160                     
161                 }
162                 elseif($tablename == 'customer_xuqiu'){
163                     
164                     $id = $rs_a[0][$what];
165                     $return2 = "<a target='_blank' $tip href='../JXC/customer_xuqiu_newai.php?".base64_encode("action=view_default&$what=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
166                     
167                 }
168                 elseif($tablename == 'crm_shenqingbaobei'){
169                     
170                     $id = $rs_a[0][$what];
171                     $return2 = "<a target='_blank' $tip href='../JXC/crm_shenqingbaobei_newai.php?".base64_encode("action=view_default&$what=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
172                     
173                 }
174                 elseif($tablename == 'workplanmain'){
175                     
176                     $id = $rs_a[0][$what];
177                     $return2 = "<a target='_blank' $tip href='../CRM/workplanmain_newai.php?".base64_encode("action=view_default&$what=".$id)."'><font color=$colorValue>".$rs_a[0][$return]."</font></a>";
178                     
179                 }
180                 else{
181                     
182                     if($hascolor)
183                         $return2 = "<span $tip><font color=$colorValue>".$rs_a[0][$return]."</font></span>";
184                     else 
185                         $return2 ="<span $tip>".$rs_a[0][$return]."</span>";
186                 }
187             }
188 
189     
190     //print $return2;print $value;print "<BR>";
191     //if($value=="50001")        exit;
192     //print $return2;exit;
193     //if($TEMP_TAR == 1)    print_R($return2);
194     return $return2;
195 }

 print_search_element_array()在html_element.php文件中,函数如下:

  1 function print_search_element_array($name,$value,$mark='default',$affixation=array(),$affixation_index)    {
  2     global $common_html,$db,$action_model,$action_search,$location_title;
  3     global $read_type,$email_filter,$sms_filter,$_GET,$html_etc,$tablename;
  4     global $primarykey_index;
  5     global $fields;
  6     $action="init_".$mark."_search"; // init_default_search
  7     if(isset($action_search))                                {
  8     form_begin('Form2',"$action",'get'); // 执行,也在html_element.php文件中,见下
  9     print "<THEAD >\n";  // table的表头,建立了一个空的表头
 10     print "<TR>";
 11     print "<TD noWrap colspan=".$fields['table']['colspan'].">\n";
 12 //            不换行      65 列
 13     print "<table width=100% class=Small border=0><THEAD ><tr ><td  noWrap>";
 14     
 15     if(isset($action_model)) // ini文件中存在$action_model
 16         show_new_element($action_model,$location_title); // 设置3个按键 
 17     //print $common_html['common_html']['search'].":\n";
 18     $addtext=$affixation[0]['index_name'];
 19     //print_R($affixation);&&$_GET['actionadv']==''
 20     //当高级搜索打开时,此部分不进行显示,高级搜索关闭时,此部分显示
 21     if($_GET['actionadv']=='')            {
 22     print "<input type=hidden name=action value=$action>";
 23 //    print "<input type=hidden name='".$addtext."' value='".$_GET[$addtext]."'>";
 24 
 25     print "<select class=\"SmallSelect\" name=\"searchfield\" onkeydown=\"if(event.keyCode==13)event.keyCode=9\" >\n";
 26 
 27     //当GETSEARCHFIELD不为空时,进行SESSION注册操作
 28     if($_GET['searchfield']!="")        {
 29         //session_register("SYSTEM_INITVIEW_SEARCH_LIST_DEFAULT");
 30         $_SESSION['SYSTEM_INITVIEW_SEARCH_LIST_DEFAULT'] = $_GET['searchfield'];
 31         //session_register("SYSTEM_INITVIEW_SEARCH_VALUE_DEFAULT");
 32         $_SESSION['SYSTEM_INITVIEW_SEARCH_VALUE_DEFAULT'] = $_GET['searchvalue'];
 33     }
 34 
 35     for($i=0;$i<sizeof($name);$i++)    { // 35个option逐项添加
 36         if($_SESSION['SYSTEM_INITVIEW_SEARCH_LIST_DEFAULT']==$value[$i])    {
 37             $temp = "selected";
 38         }
 39         else
 40             $temp = "";
 41         print "<option value=\"".$value[$i]."\" $temp>".$name[$i]."</option>\n";
 42     }
 43 
 44     print "</select>\n";
 45     print "<INPUT type=\"text\" class=\"SmallInput\" maxLength=200 size=\"12\" name=\"searchvalue\" value=\"".$_SESSION['SYSTEM_INITVIEW_SEARCH_VALUE_DEFAULT']."\">\n"; // 添加一个输入文本框
 46     print "<INPUT class=SmallButton title=\"".$common_html['common_html']['accesskey'].":ALT+F\"\" type=submit accesskey=\"f\"  value=\"".$common_html['common_html']['search']."\" name=button>\n";  // 添加一个submit按钮
 47 
 48     }//高级搜索部分判断结束
 49 
 50     //print_R($affixation);
 51     global $SYTEM_CONFIG_TABLE;
 52     $SYTEM_CONFIG_TABLE!=""?$tablename=$SYTEM_CONFIG_TABLE:'';
 53     if(is_array($affixation)&&sizeof($affixation)>0)        {
 54     foreach($affixation as $list)        {  // 附加的搜索项
 55         switch($list['attribute'])        {
 56             case 'text':
 57                 print "<select class=\"SmallSelect\" >\n";
 58                 print "<option value=\"\" >".$affixation_index."</option>\n";
 59                 print "</select>\n";
 60                 break;
 61             case 'hidden':
 62                 break;
 63             case 'fixed':
 64                 break;
 65             default:
 66                 //$return=returnpageaction($mode='group_filter',array('index_name'=>$list['index_name'],'index_id'=>''));
 67                 //print $_GET['DEPT_ID_NAME'];;
 68                 $FormPageAction=FormPageAction2("action",$_GET[action],'','',$list['index_name']); // pageid=1&action=init_default
 69                 //print "<font color=black>".$html_etc[$tablename][$list['index_name']].":</font>&nbsp;";
 70                 print "<select class=\"SmallSelect\" onChange=\"var jmpURL='?".$FormPageAction."&".$list['index_name']."=' + this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}\" name=\"".$list['index_name']."\" >\n"; // select的option发生变化,jmpURL变量可能为pageid=1&action=init_default&所属部门=业务一部,name值为 业务一部,window.location为向本页传递参数。
 71                 //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n";                    
 72                 print "<option value=\"\" >".$html_etc[$tablename][$list['index_name']]."[".$common_html['common_html']['allrecords']."]</option>\n"; // $tablename为hrms_file,$list['index_name']为 所属部门,然后 [全部记录] 第一个默认option
 73                 // 下面是附加域group_filter的option
 74                 for($i=0;$i<sizeof($list['fieldid']);$i++)    {
 75 
 76                     print "<option value=\"".$list['fieldid'][$i]."\" ".$list['selected'][$i].">".$list['fieldname'][$i]."</option>\n";
 77                 }
 78                 print "</select>\n";
 79         }//end switch
 80     }//end foreach
 81     }//end if
 82 
 83 
 84 
 85     if($email_filter!="")
 86         $temp=$email_filter;
 87     else if($sms_filter!='')
 88         $temp=$sms_filter;
 89     else $temp='';
 90 
 91     if($temp)                                    {
 92         $array_filter=explode(',',$temp);
 93         if($_GET['action']=='init_default')            {
 94             $_GET['action']=='init_inbox';
 95         }
 96         print "<select class=\"SmallSelect\" onChange=\"var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}\" name=\"".$list['index_name']."_NAME\" >\n";
 97         for($i=0;$i<sizeof($array_filter);$i++)    {
 98             if("init_".$array_filter[$i]==$_GET['action'])    $selected='selected';
 99             else    $selected='';
100             print "<option value=\"?action=init_".$array_filter[$i]."\" $selected>".$common_html['common_html'][(String)$array_filter[$i]]."</option>\n";
101         }
102         print "</select>\n";
103     }
104 
105     global $增加对查询日期快捷方式的支持_是否启用;
106     if($增加对查询日期快捷方式的支持_是否启用==1&&$_SESSION['增加对查询日期快捷方式的支持']=='设置为0')        {
107         print "&nbsp;&nbsp;<a href='?".FormPageAction("增加对查询日期快捷方式的支持GET","设置为1")."'><font color=gray title=\"启用'增加对查询日期快捷方式的支持'功能\">打开查询日期显示</font></a>";
108     }
109     //提示信息显示
110     print "</td>\n";
111     print "<td nowrap width=60%><DIV class=InputError id=Searchvalue_CSS></DIV></td>\n";
112     print "</tr></THEAD></table>";
113 
114     print "</TD></TR>\n";
115     print "</THEAD>\n";
116     form_end();  //  form表单结束
117 
118 
119     //###############################################################################
120     //###############################################################################
121     //###############################################################################
122     global $USER_DEFINE_FUNCTION_PAGE_NAME;
123     if($USER_DEFINE_FUNCTION_PAGE_NAME!= "")    {
124         $USER_DEFINE_FUNCTION_PAGE_NAME();
125     }
126 
127     }
128 }

 

form_begin()函数在文件html_element.php中,函数如下:

 1 function form_begin($name="form1",$action="init",$method="post",$infor='')    {
 2     if(is_array($infor))    {
 3         formcheck($name,$infor);
 4         print "<FORM name=$name id=form onsubmit=\"return FormCheck();\" \n action=\"$PHP_SELF?$action&pageid=".$_GET['pageid']."\" method=$method encType=multipart/form-data>\n";
 5     }
 6     else    {  // 执行  action中$PHP_SELF为自身,就是action动作发生变化,$name=form2,$action = init_default_search,$method = get
 7         print "<FORM name=$name id=form action=\"$PHP_SELF?$action&pageid=".$_GET['pageid']."\" method=$method encType=multipart/form-data>\n";
 8     }
 9     print "<input type=hidden name='userdefine' value=''>";
10 }

 

show_new_element()函数在html_element.php中,函数如下:

  1 function show_new_element($action_model,$location_title='')        {
  2     global $common_html,$action_model,$_GET,$tablename;
  3     global $group_user,$_SESSION;
  4     //权限体系分配;
  5     $USER_PRIV_ID = $_SESSION['SUNSHINE_USER_PRIV']; //null
  6     $USER_PRIV = returntablefield("user_priv","USER_PRIV",$USER_PRIV_ID,"PRIV_Name");  //null
  7     
  8     $action_model_array=explode(',',$action_model);  // array(3)
  9     for($i=0;$i<sizeof($action_model_array);$i++)    {
 10         $model_index_array=explode(':',$action_model_array[$i]);
 11         $index_mid=$model_index_array[0];
 12         $index=$model_index_array[1];
 13         if($index=='export' && $_SESSION['LOGIN_USER_PRIV']==3)
 14             continue;
 15         if($index=='')    {
 16             $index_array=explode('_',$index_mid);
 17             $index=$index_array[0];
 18         }
 19         
 20         //得到系统文件分配权限
 21         $USER_PRIV_USER = $model_index_array[3];
 22         if($USER_PRIV_USER==""||($USER_PRIV_USER==$USER_PRIV||$USER_PRIV=='1'||$USER_PRIV=='2'))        {
 23         switch($index)        { //第一个是new,到default
 24             case 'set':
 25                 //$url="?action=".$index_mid."&table_name=$tablename&table_action=".$_GET['action'];
 26                 $actionValue=explode("_",$_GET['action']);
 27                 $actionValueText="";
 28                 for($m=1;$m<sizeof($actionValue);$m++)    {
 29                     $actionValueText.="_".$actionValue[$m];
 30                 }
 31                 $actionValueText="set".$actionValueText;
 32                 $return=FormPageAction("action",$actionValueText,"table_name",$tablename,'',"table_action",$_GET['action'],"returnmodel",$_GET['action']);
 33                 $url="?".$url;
 34                 break;
 35             case 'setlang':
 36                 $url="systemlang.php?action=init_default&tablename=$tablename";
 37                 break;
 38             case 'exportadv':
 39                 $return=FormPageAction("actionadv",$index_mid);
 40                 //$return=returnpageaction($mode='init_exportadv',array('index_name'=>'action','index_id'=>$index_mid));
 41                 $url="?$return";
 42                 break;
 43             case 'export':  // 第二项导出功能,函数在init.php文件中
 44                 $return=FormPageAction("action",$index_mid);
 45                 //$return=returnpageaction($mode='init_exportadv',array('index_name'=>'action','index_id'=>$index_mid));
 46                 $url="?$return";  // 明码为?pageid=1&action=export_default
 47                 break;
 48             default:
 49                 $group_array=return_parent_group();  // 没有定义内容
 50                 
 51                 if(sizeof($group_array['sql_text'])>1)        {
 52                     $temp_get_parent=isset($_GET[(string)$group_array['sql_text']['parent']])?$_GET[(string)$group_array['sql_text']['parent']]:0;
 53                     $temp_get=$_GET[(string)$group_array['sql_text']['id']];
 54                     $temp_get=isset($temp_get)?$temp_get:0;
 55                     switch($group_array['sql_text']['type'])        {
 56                         case 'group':
 57                             $sql_text_user=$group_array['sql_text']['user']."=".$_GET[(string)$group_array['sql_text']['user']];
 58                             break;
 59                         case 'user':
 60                             $sql_text_user='';
 61                             break;
 62                         default:
 63                             $sql_text_user='';
 64                             break;
 65                     }
 66 
 67                 }
 68                 else        {
 69 
 70                     //$return=FormPageAction("action",$index_mid);
 71                     //exit($return);
 72                     $return=base64_encode("action=".$index_mid); // add_default
 73                     //$return=returnpageaction($mode='init_add',array('index_name'=>'action','index_id'=>$index_mid));
 74                     $url="?$return";
 75 
 76                 }
 77                 break;
 78         }
 79         //if($index!='init')
 80         
 81         $array[$i]['value']=" ".$common_html['common_html'][$index]." ";
 82         $array[$i]['title']=" ".$common_html['common_html'][$index]." ";
 83         $array[$i]['url']=$url;  // 保存action
 84         $array[$i]['shortcut']=$model_index_array[2];
 85         $array[$i]['class']='SmallButton';
 86         //}
 87     }//end switch
 88     }//end 用户权限划分
 89 
 90     //系统调试模式
 91     global $systemmode;
 92     if($systemmode=='test')            {
 93         $array[$i+1]['value']=" ".$common_html['common_html']['setlang']." ";
 94         $array[$i+1]['title']=" ".$common_html['common_html']['setlang']." ";
 95         $array[$i+1]['url']="systemlang_newai.php?action=init_default&tablename=$tablename";
 96         $array[$i+1]['shortcut']='t';
 97         $array[$i+1]['class']='SmallButton';
 98     }
 99     //print_R($array);
100     print_new_element_array($array,$location_title);  // $location_title为sunshine_inside,在html_element.php中,见下
101 }

print_new_element_array()函数如下:

 1 function print_new_element_array($array,$location_title='')    {
 2     global $html_etc,$common_html;
 3     global $lang;
 4     if($location_title!='sunshine_inside')    {
 5         print "<div align=\"center\">\n";
 6     }
 7     if(!is_array($array))    $array = array();
 8     foreach($array as $list)                {
 9         if(Trim($list['value'])!=""&&$_GET['actionadv']=='')
10             print "<input type=\"button\" accesskey=\"".$list['shortcut']."\" value=\"".$list['value']."\" class=".$list['class']." onClick=\"location='".$list['url']."';\" title=\"".$common_html['common_html']['accesskey'].":ALT+".$list['shortcut']."\">\n";  // 为每一个按钮设置值,onClick也是向自身传递参数
11     }
12     if($location_title!='sunshine_inside')    {
13         print "</div>\n";
14         print "<br>\n";
15     }
16 }

 

 FormPageAction()函数在init.php文件中,函数如下:

 1 //形成新的_GET字符变量
 2 function FormPageAction($actionname='',$actionvalue='',$actionname2='',$actionvalue2='',$delete='',$actionname3='',$actionvalue3='',$actionname4='',$actionvalue4='')    {
 3     global $_GET;
 4     //print_R($_REQUEST);
 5     //##################################################################
 6     //2009-3-23增加在搜索情况下面对分页条件的支持 旧版:$_GET2 = $_GET;
 7     //##################################################################
 8     //变量初始化
 9     $_GET['action'] = $_GET['action'];
10     $_GET2 = $_GET;
11     
12     //附加新的变量值
13     if($actionname!=""&&$actionvalue!="") // 对action进行修改
14         $_GET2[$actionname]=$actionvalue;
15     if($actionname2!=""&&$actionvalue2!="")
16         $_GET2[$actionname2]=$actionvalue2;
17     if($actionname3!=""&&$actionvalue3!="")
18         $_GET2[$actionname3]=$actionvalue3;
19     if($actionname4!=""&&$actionvalue4!="")
20         $_GET2[$actionname4]=$actionvalue4;
21     //构成KEY表
22     $array_keys = array_keys($_GET2);//print_R($_GET2);// 就2项:pageid:1,action:export_default
23     //过滤,形成新的数组
24     for($i=0;$i<sizeof($array_keys);$i++)        {
25         if($_GET2[(String)$array_keys[$i]]!=""&&$array_keys[$i]!=$delete)    {// 执行
26             $urlitem=$_GET2[(String)$array_keys[$i]]; // 1
27             $urlitem=str_replace("\'","'",$urlitem);  // 1
28             if(stripos($urlitem,"'")!==false)
29                 $urlitem=urlencode($urlitem);   // 解码  1
30             $array_line[$i] = $array_keys[$i]."=".$urlitem;// 0:pageid=1,1:action=export_default
31         }
32         else    {
33         }
34     }
35     
36     if(sizeof($array_line)>0)
37         $newtext = join("&",$array_line);// 为pageid=1&action=export_default
38     
39     //return $newtext;
40     return base64_encode($newtext);
41 }

 

posted on 2015-02-23 00:11  n哖苡逅  阅读(757)  评论(0编辑  收藏  举报

导航