How to implement process management in php?

coldplay.xixi
Release: 2023-03-02 16:08:02
Original
2700 people have browsed it

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. .

How to implement process management in php?

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}--
"; } } ?>

请输入流程名称:

Copy after login

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; }
Copy after login

The completed effect is as shown in the picture:

How to implement process management in php?

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:

How to implement process management in php?

Click save and save to the database:

How to implement process management in php?

How to implement process management in php?

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

    无标题文档 
Copy after login

faqi.php

    无标题文档

发起流程

请选择发起的流程:

请输入内容:

Copy after login

shenhe.php

    无标题文档 

审核页面

Query($sql); //显示 foreach($arr as $v) { //判断该流程走到登录者 $lcdh = $v[1]; //流程代号 $towhere = $v[6];//流程走到哪 $sql = "select orders from lc_flowpath where code='{$lcdh}' and uids='{$uid}'"; $order = $db->StrQuery($sql);//该人员在流程中的次序 if($towhere>=$order) { $caozuo = ""; if($towhere==$order) { $caozuo="通过"; } else { $caozuo="已通过"; } echo ""; } } ?>
流程代号 发起者 发起内容 是否结束 发起时间 操作
{$v[1]} {$v[2]} {$v[3]} {$v[4]} {$v[5]} {$caozuo}
Copy after login

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");
Copy after login

How to implement process management in php?

Zhang San sends a leave application process,

How to implement process management in php?

Li Si’s page:

How to implement process management in php?

Click After passing

How to implement process management in php?

database:towhere becomes 1

How to implement process management in php?

Then the horse seven:

How to implement process management in php?

Then there is Zhang San:

How to implement process management in php?

Database: isok becomes 1

How to implement process management in php?

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!

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 Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!