PHP语言 -- 处理流程
chuli.php
<body> <h1>流程处理</h1> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr> <td>流程名称</td> <td>发起者</td> <td>内容</td> <td>是否结束</td> <td>发起时间</td> <td>操作</td> </tr> <?php session_start(); $uid = $_SESSION["uid"]; include "DBDA.php"; $db= new DBDA(); $sqlall="select * from UserFlow"; $attr = $db->Query($sqlall); foreach($attr as $arr) { list($ids,$code,$yh,$nr,$isok,$rq,$where) = $arr; //根据登录者和流程代号取出该登录者在流程中的次序 $sqlorder = "select Orders from FlowPath where Uids='{$uid}' and Code ='{$code}'"; $order = $db->StrQuery($sqlorder); //判断该用户在流程中的次序和流程走到哪个地方的关系 if($where>=$order) { //处理流程名称 $sqlname= "select Name from LiuCheng where Code='{$code}'"; $name=$db->StrQuery($sqlname); //处理发起者名称 $sqln = "select Name from Users where Uid='{$yh}'"; $n=$db->StrQuery($sqln); //处理是否结束 $ok = $isok?"<span>已结束</span>":"<span>处理中</span>" //处理操作 $cz = $where==$order?"<a href='shenhe.php?ids={$ids}'>审核</a>":"<span>已通过</span>" echo "<tr> <td>{$name}</td> <td>{$n}</td> <td>{$nr}</td> <td>{$ok}</td> <td>{$rq}</td> <td>{$cz}</td> </tr>"; } } ?> </table> </body>
shenhe.php
<?php $ids = $_GET["ids"]; include "DBDA.php"; $db= new DBDA(); $sql = "update UserFlow set ToWhere=ToWhere+1 where Ids={$ids}"; $db->Query($sql,0); //找到流程代号 $sqlcode= "select * from UserFlow where Ids={$ids}"; $attr = $db->Query($sqlcode); $lccode = $attr[0][1]; $where = $attr[0][6]; //根据流程代号查节点个数 $sqljd = "select count(*) from FlowPath where Code='{$lccode}'"; $count = $db->StrQuery($sqljd,0); if($where>=$count) { $sqlok = "update UserFlow set IsOk=true where Ids={$dis}"; $db->Query($sqlok); } header("location:chuli.php")