通達OA工作流程外掛程式和清單控制項資料解析:
參考代碼如下:
<?include_once("inc/auth.inc.php");include_once("inc/utility_org.php" );$HTML_PAGE_TITLE = _("工作流程外掛程式測試");include_once("inc/header.inc.php");/** author: 孫忠海* 15645091570 * QQ:1027167227*///$FLOW_ID=341;//$RUN_ID=69222;//$sql="select * from flow_data_".$FLOW_ID." where run_id=".$RUN_ID;//$cur_sql=exequery(TD::conn(),$sql);?><body class="bodycolor" style="font-size:12px" topmargin="5"><?echo $_SESSION["LOGIN_USER_ID"]."<br>";$query="select * from x_hr_code where parent_no='gangweizhiwu' order by code_no asc";$cursor=exequery(TD::conn(),$query);while($row=mysql_fetch_array($cursor)){echo $row["CODE_NAME"].",";}echo "<hr>";$query="select * from x_hr_code where parent_no='gangweidengji' order by code_no asc";$cursor=exequery(TD::conn(),$query);while($row=mysql_fetch_array($cursor)){echo $row["CODE_NAME"].",";}echo "<hr>";$query="select * from x_hr_code where parent_no='gangji' order by code_no asc";$cursor=exequery(TD::conn(),$query);while($row=mysql_fetch_array($cursor)){echo $row["CODE_NAME"].",";}echo "<hr>";$query2="select data_57 from flow_data_316 where run_id=44436 limit 1";$cursor2=exequery(TD::conn(),$query2);while($row2=mysql_fetch_array($cursor2)){$mingxi=$row2['data_57'];}echo $mingxi."<br>"; $mingxi=str_replace("\r",",",$mingxi);//\r是斷行符號 佔用兩個字元,資料表data_3中儲存的是斷行符號,而不是空格,將斷行符號替換為“,”逗號;echo $mingxi."<br>";$mingxi=substr($mingxi,0,-2);//去掉最後的兩個字元,包括逗號echo $mingxi."<br>";$arr=explode(",",$mingxi);//使用,逗號拆分,將列表中的每條記錄分開`print_r($arr);//echo "<br>";$count=count($arr);//有多少條記錄echo $count."<br>";for($i=0;$i<$count;$i++){$update_str="";$bianhao="";$ganweizhiwu="";$gangweidengji="";$gangji="";$arr[$i]=substr($arr[$i],0,-1);//去掉最後一個字元`substr($arr[$i],-1)就可以或得到這個點echo $arr[$i]."<br>";$arr[$i]=explode(""`,$arr[$i]);//拆分成二維數組print_r($arr[$i]);$bianhao=$arr[$i][1];$gangweizhiwu=GET_CODE_NO($arr[$i][4],"gangweizhiwu");//崗位名稱$gangweidengji=GET_CODE_NO($arr[$i][5],"gangweidengji");//崗位等級$gangji=GET_CODE_NO($arr[$i][6],"gangji");//崗級echo "<br>";echo $bianhao."----".$gangweizhiwu."----".$gangweidengji."-----".$gangji."---";echo "<hr>";if($gangweizhiwu!=""){$update_str=" gangweizhiwu=".$gangweizhiwu.",";}if($gangweidengji!=""){$update_str.=" gangweidengji=".$gangweidengji.",";} if($gangji!=""){$update_str.=" gangji=".$gangji.",";} if($bianhao!=""){$update_str.=" STAFF_NO=".$bianhao." ";$query3="update x_hr_staff_info set ".$update_str." where STAFF_NO=".$bianhao." " ;echo $query3."<br>";exequery(TD::conn(),$query3);} }function GET_CODE_NO( $CODE_NAME, $PARENT_NO ){if ( $CODE_NAME == "" || $PARENT_NO == "" ){return "";}$query = "SELECT CODE_NO from X_HR_CODE where PARENT_NO='".$PARENT_NO."' and CODE_NAME='$CODE_NAME'";$cursor = exequery( TD::conn( ), $query );while ( $ROW = mysql_fetch_array( $cursor ) ){$CODE_NO = $ROW['CODE_NO']; }return $CODE_NO;} ?></body></html>
以上就介紹了 通達OA2015版工作流程外掛程式和清單控制項資料解析,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。
相關文章:
PHP 工作流程 自訂表格單解決方案
怎麼簡單實現工作流程?
介紹一個真正符合中國國情的工作流程設計參考(包括PHP實現)