Home > Backend Development > PHP Tutorial > Tongda OA2015 version workflow plug-in and list control data analysis

Tongda OA2015 version workflow plug-in and list control data analysis

PHP中文网
Release: 2023-02-28 21:02:02
Original
2351 people have browsed it

Data analysis of Tongda OA workflow plug-in and list control:

The reference code is as follows:

<?
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=&#39;gangweizhiwu&#39; 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=&#39;gangweidengji&#39; 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=&#39;gangji&#39; 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[&#39;data_57&#39;];
}
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=&#39;".$PARENT_NO."&#39; and CODE_NAME=&#39;$CODE_NAME&#39;";
$cursor = exequery( TD::conn( ), $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$CODE_NO = $ROW[&#39;CODE_NO&#39;]; 
}
return $CODE_NO;
} 
?>
</body></html>
Copy after login

The above introduces the data analysis of Tongda OA2015 version of workflow plug-in and list control, including the content. I hope you are interested in PHP tutorials. Friends help.

Related articles:

PHP workflow custom form solution

How to implement workflow easily?

Introducing a workflow design reference (including PHP implementation) that is truly in line with China’s national conditions

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template