php method to implement process management: first create a new process page and build a node; then click to select node personnel to adjust the list of all personnel from the database; finally, be a logged-in user and submit all steps of the leave process. .
php method to implement process management:
We first create a new process page and complete the nodes first
xinjian.php
无标题文档 新建流程
请选择节点人员:
$v) { $sname = "select name from lc_users where uid='{$v}'"; $name = $db->StrQuery($sname); echo "{$k}--{$name}--"; } } ?>
请输入流程名称:
chuli.php
Query($sql,0); //添加流程节点 $arr = $_SESSION["user"]; foreach($arr as $k=>$v) { $sql = "insert into lc_flowpath values('','{$code}','{$v}','{$k}')"; $db->Query($sql,0); } break; case 3: //用户发起流程 $code = $_POST["code"]; $nr = $_POST["content"]; $uid = $_SESSION["uid"]; $time = date("Y-m-d H:i:s"); $sql = "insert into lc_userflow values('','{$code}','{$uid}','{$nr}',0,'{$time}',0)"; $db->Query($sql,0); break; }
The completed effect is as shown in the picture:
Click to select node personnel to call the list of all personnel from the database. Now put Li Si, Ma Qi and Zhang San into the process and make a leave request process:
Click save and save to the database:
Note: Code must use varchar , time cannot be used because the timestamp is used above
Now we are making a login user and submitting all steps of the leave process:
weilogin.php A fake account
faqi.php
shenhe.php
无标题文档 审核页面
流程代号 | 发起者 | 发起内容 | 是否结束 | 发起时间 | 操作 |
{$v[1]} | {$v[2]} | {$v[3]} | {$v[4]} | {$v[5]} | {$caozuo} |
tongguo.php
Query($sql,0); //判断流程是否结束 $sql = "select * from lc_userflow where ids='{$code}'"; $arr = $db->Query($sql); $lcdh = $arr[0][1]; //流程代号 $tw = $arr[0][6]; //流程走到哪 $sql = "select count(*) from lc_flowpath where code='{$lcdh}'"; $count = $db->StrQuery($sql); //该流程节点人数 if($tw>=$count) { $sql = "update lc_userflow set isok=1 where ids='{$code}'"; $db->Query($sql,0); } header("location:shenhe.php");
Zhang San sends a leave application process,
Li Si’s page:
Click After passing
database:towhere becomes 1
Then the horse seven:
Then there is Zhang San:
Database: isok becomes 1
Related learning recommendations:PHP programming from entry to proficiency
The above is the detailed content of How to implement process management in php?. For more information, please follow other related articles on the PHP Chinese website!