Share the process initiation and review process instance with php + ajax-php Tutorial

Source: Internet
Author: User
This article mainly introduces the php + ajax initiation process and review process (take leave as an example ), for more information about the php + ajax initiation process and review process (take leave as an example ),

The previous article mentioned how to create a process. now let's take a look at how to initiate a process and review the process ~~~

Let's talk about the following ideas:

(1) log on to use session to get the user id

(2) the user initiates a process

Note: You need to write the application reason

(3) the reviewer at the node reviews the node in sequence.

Note: after each review, the corresponding towhere field must be added with 1. after the review ends, the corresponding isok field must be changed to 1 (here 1 indicates the end, 0 indicates the end is not completed)

Shared to three tables:

  
      

Denglu-cl.php web page


 Strquery ($ SQL); if ($ pwd ==$ mm &&! Empty ($ pwd) {$ _ SESSION ["uid"] = $ uid; header ("location: liucheng. php ") ;}else {echo" incorrect password or login name ";}?>

:

  
      

Home Page

Initiation Process
Review process

:

  
       

 query($sql,0);header("location:liucheng.php");?>

Click "confirm to launch". This data entry will be added to the database.

  
       

Process Review page = (Select orders from liuchengjiedian B where B. code =. code and B. uids = '{$ uid}') "; $ arr = $ db-> query ($ SQL); // var_dump ($ arr); echo"

"; Foreach ($ arr as $ v) {// The last column of the operation // set the default item $ zt =" review failed "; $ SQL = "select orders from liuchengjiedian where code = '{$ v [1]}' and uids = '{$ uid }'"; $ wz = $ db-> strquery ($ SQL); if ($ v [6]> $ wz) {$ zt = "approved";} echo" ";} Echo"
Process Code Initiator Launch content Initiation Time End? Operation
{$ V [1]} {$ V [2]} {$ V [3]} {$ V [4]} {$ V [5]} {$ Zt}
";?>

Step 6: write the tongguo-cl.php page (important)


 Query ($ SQL, 0); // when the process reaches the end of the last review, the process will end // obtain the largest orders $ SQL = "select max (orders) of the process) from liuchengjiedian where code = (select code from liuchengpath where ids = '{$ ids}') "; $ maxorders = $ db-> strquery ($ SQL ); // Obtain the location where the user is located, that is, the value of towhere $ SQL = "select towhere from liuchengpath where ids = '{$ ids }'"; $ towhere = $ db-> strquery ($ SQL); // if ($ towhere> $ maxorders) {$ SQL = "update liuchengpath set isok = 1 w Here ids = '{$ ids}' "; // var_dump ($ SQL); $ db-> query ($ SQL, 0);} header (" location: shenhe. php ");?>

When this step is completed, clicking "review failed" will change to "review passed ";

The above is a detailed description of the process initiation process and review process instance using php + ajax. For more information, see other related articles in the first PHP community!

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.