How to use Ajax with PHP time simple process Management

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.