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"
Process Code |
Initiator |
Launch content |
Initiation Time |
End? |
Operation |
"; 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"
{$ V [1]} |
{$ V [2]} |
{$ V [3]} |
{$ V [4]} |
{$ V [5]} |
{$ Zt} |
";} Echo"
";?>
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!