This article mainly introduces ajax andPHPto implement simple process management in detail, which has certain reference value. Interested friends can refer to the examples of
I have shared with you ajax and PHP to implement simple process management for your reference. The specific content is as follows
First, you must have a page for creating a new process xinjian.php
新建 新建流程
请选择节点人员:
$v) //索引为$k,取值为$v { $sname = "select name from users where uid='{$v}'"; //取出名称 $name = $db->StrQuery($sname); echo "
{$k}--{$name}--
"; //向处理页面传的是key的值 } } ?>
请输入流程名称:
Database picture:
##Processing Page chuli.phpQuery($sql,0); //添加流程节点 $arr = $_SESSION["user"]; foreach($arr as $k=>$v) { $sql = "insert into 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 userflow values('','{$code}','{$uid}','{$nr}',0,'{$time}',0)"; $db->Query($sql,0); break; }
AuditPage shenhe.php
审核 审核页面
流程代号 | 发起者 | 发起内容 | 是否结束 | 发起时间 | 操作 |
{$v[1]} | {$v[2]} | {$v[3]} | {$v[4]} | {$v[5]} | {$caozuo} |
##tongguo.php
Query($sql,0); //判断流程是否结束 $sql = "select * from userflow where ids='{$code}'"; $arr = $db->Query($sql); $lcdh = $arr[0][1]; //流程代号 $tw = $arr[0][6]; //流程走到哪 $sql = "select count(*) from flowpath where code='{$lcdh}'"; $count = $db->StrQuery($sql); //该流程节点人数 if($tw>=$count) { $sql = "update userflow set isok=1 where ids='{$code}'"; //如果结束了流程,将isok项改为结束。 $db->Query($sql,0); } header("location:shenhe.php");
The above is the detailed content of Detailed explanation of simple process management using PHP and ajax (pictures and text). For more information, please follow other related articles on the PHP Chinese website!