This article mainly introduces the php+ajax initiation process and review process (taking leave as an example). Friends who need it can refer to it
The previous essay has mentioned how to create a new process, so now Let’s take a look at how to initiate a process and review process~~~
Let’s talk about the idea first:
(1) Log in with session Obtain the user's id
(2) The user initiates a process
Note: You need to write the application reason
(3) The reviewer at the node will review it in sequence
Three tables: Step 1: Make a simple login page first, and use session to get the user name: denglu.php pagestrquery($sql); if($pwd==$mm && !empty($pwd)) { $_SESSION["uid"]=$uid; header("location:liucheng.php"); } else { echo "密码或登录名输入错误"; } ?>
query($sql,0); header("location:liucheng.php"); ?>
流程审核页面
=(select orders from liuchengjiedian b where b.code = a.code and b.uids = '{$uid}')"; $arr = $db->query($sql); //var_dump($arr); echo "
流程代号 | 发起者 | 发起内容 | 发起时间 | 是否结束 | 操作 |
{$v[1]} | {$v[2]} | {$v[3]} | {$v[4]} | {$v[5]} | {$zt} |
query($sql,0); //当流程走到最后一个审核的人时,流程要结束 //获取该流程最大的orders $sql =" select max(orders) from liuchengjiedian where code = (select code from liuchengpath where ids ='{$ids}')"; $maxorders = $db->strquery($sql); //获取该用户处于哪个位置,也就是towhere等于多少 $sql ="select towhere from liuchengpath where ids ='{$ids}'"; $towhere = $db->strquery($sql); //判断是否已到达最后一个审核的人 if($towhere>$maxorders) { $sql = "update liuchengpath set isok=1 where ids='{$ids}'"; // var_dump($sql); $db->query($sql,0); } header("location:shenhe.php"); ?>
##Click After "Audit failed", whether the end changes to 1; the operation changes to green "Audit passed"~~~
The above is the detailed content of PHP+ajax tutorial on initiating and reviewing leave request process. For more information, please follow other related articles on the PHP Chinese website!