利用ajax和PHP实现简单的流程管理(2)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>审核</title> </head> <body> <h1>审核页面</h1> <table cellpadding="0" cellspacing="0"> <tr> <td>流程代号</td> <td>发起者</td> <td>发起内容</td> <td>是否结束</td> <td>发起时间</td> <td>操作</td> </tr> <?php session_start(); include("../FENGZHUANG/DBDA.class.php"); $db = new DBDA(); $uid = $_SESSION["uid"]; echo $uid; //查找登录者参与的所有流程 $sql = "select * from userflow where code in(select code from flowpath where uids='{$uid}')"; $arr = $db->Query($sql); //显示 foreach($arr as $v) { //判断该流程走到登录者 $lcdh = $v[1]; //流程代号 $towhere = $v[6];//流程走到哪 $sql = "select orders from flowpath where code='{$lcdh}' and uids='{$uid}'"; $order = $db->StrQuery($sql);//该人员在流程中的次序 if($towhere>=$order) { $caozuo = ""; if($towhere==$order) { $caozuo="<a href='tongguo.php?code={$v[0]}'>通过</a>"; } else { $caozuo="<span>已通过</span>"; } echo "<tr> <td>{$v[1]}</td> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$v[5]}</td> <td>{$caozuo}</td> </tr>"; } } ?> </table> </body> </html>

利用ajax和PHP实现简单的流程管理

tongguo.php

<?php session_start(); include("../FENGZHUANG/DBDA.class.php"); $db = new DBDA(); //流程往下走 $code = $_GET["code"]; $sql = "update userflow set towhere=towhere+1 where ids='{$code}'"; //使流程向下走 $db->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");

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/24303bcdafe4e3373efb45327df6301a.html