"区经代码","khdm"=>"客户代码"); $json_data="{"; if($priv[0]=="n"){ //没有操作权限 $json_data.="\"error\":\"没有操作权限\",\"code\":0,\"msg\":\"\",\"count\":0,\"data\":[],"; }else{ $json_data.="\"uid\":".$uid.","; switch($_a){ //----------------------------------------------------------------------导入EXCEL case "import": //目录权限 $arr_path=array( "cache"=>"admin/cache" ); $json_data.="\"path_priv\":["; $tmp=""; foreach($arr_path as $path_real => $path_title){ $tmp.="{\"title\":\"".$path_title."\",\"priv\":"; if(new_is_writeable($path_real)==1){ $tmp.="\"y\""; }else{ $tmp.="\"n\""; } $tmp.="},"; } $json_data.=substr($tmp,0,-1)."],"; break; case "import_check": $file1=$_FILES["up_file"]; $tmp_file_name=save_tmp_file($file1); $tmp_content=get_tmp_content($tmp_file_name); $arr_content=explode("\n",$tmp_content); $arr_thead=get_table_thead($tmp_content); $arr_column=check_table_thead($arr_thead,$arr_column_qjqx); $msg=""; if(count($arr_column[0])==0){ $msg.="未检测到可导入字段,请返回检查EXCEL文件!"; del_tmp_file($tmp_file_name); $json_data.="\"code\":0,\"msg\":\"".$msg."\","; }else{ // $column=""; foreach($arr_column_qjqx as $k => $v){ $column.=$v.","; } if($column) $column=substr($column,0,-1); $msg1=array(); $msg1[0]=array("可导入正确字段",$column); // $column=""; for($i=0;$i".$arr_thead[$i].","; } if($column) $column=substr($column,0,-1); // $msg1[1]=array("检测到的有效字段",$column); // $total=count($arr_content)-1; $msg1[2]=array("记录条数",$total); $m1=""; for($i=0;$i $arr_username){ $m_qj=get_db_msg("select id from ".$table_pre."client where username='".$qjdm."' and face='2'"); if($m_qj["id"]>0){ $arr_uid=array(); for($j=0;$jquery($q); while($m=$db->fetch_array($r)){ $arr_uid[]=$m["id"]; } } } $str_uid=arr_to_str($arr_uid); $arr1=get_qj_charge($arr_uid); $q="update ".$table_pre."client set charge_path='".$arr1[0]."',charge_path_real='".$arr1[1]."',charge_uid='".$str_uid."' where id='".$m_qj["id"]."'"; //echo $q."
"; $db->query($q); $log_remark.=$qjdm.","; } } del_tmp_file($tmp_file_name); $log_remark=$import_flag; set_log("导入 区经权限",$log_remark); break; } } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>