First, there is a page for the new process xinjian.php
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Database pictures:
Handling Page chuli.php
<?phpsession_start (); Include (".. /fengzhuang/dbda.class.php "), $db = new Dbda (), $type = $_post[" type "];switch ($type) {case 0://add load data for the node, Add data to the session array $uid = $_post["UID"]; if (Empty ($_session["user"])) {$arr = array ($uid); $_session["user"] = $arr; } else {$arr = $_session["user"]; Array_push ($arr, $uid); $_session["user"] = $arr; } break; Case 1://The index of the node, then delete, re-index $key = $_post["Key"]; $arr = $_session["user"]; Unset ($arr [$key]); Delete $arr = Array_values ($arr); Re-index $_session["user"] = $arr; Break Case 2: $name = $_post["name"]; $code = time (); Add process $sql = "INSERT into Liucheng values (' {$code} ', ' {$name} ')"; $db->query ($sql, 0); Add process node $arr = $_session["user"]; foreach ($arr as $k = + $v) {$sql = "insert into Flowpath values (", ' {$code} ', ' {$v} ', ' {$k} ')"; $db->query ($sql, 0); } break; Case 3://user initiated process $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 }
Initiation Process Page faqi.php
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Audit Page shenhe.php
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
tongguo.php
<?Phpsession_start (); Include (".. /fengzhuang/dbda.class.php"); $db=NewDbda ();//process goes down$code = $_get["Code"]; $sql="Update Userflow set towhere=towhere+1 where ids= ' {$code} '";//make the process go down$db->query ($sql,0);//determine if the process is over$sql ="SELECT * from Userflow where ids= ' {$code} '"; $arr= $dbQuery ($sql); $LCDH= $arr [0][1];//Process Code$TW = $arr [0][6];//where does the process go?$sql="Select COUNT (*) from Flowpath where code= ' {$LCDH} '"; $count= $db->strquery ($sql);//number of nodes in the processif($TW >=$count) {$sql="Update Userflow set isok=1 where ids= ' {$code} '";//If you end the process, change the isOK entry to end. $db->query ($sql,0);} Header ("location:shenhe.php");
This blog was transferred from http://www.cnblogs.com/gaobint/
How to use Ajax with PHP time simple process Management