Last change
on this file was 057badc, checked in by Vlado 222039 <vlado.popovski@…>, 2 months ago |
Adding code
|
-
Property mode
set to
100644
|
File size:
563 bytes
|
Rev | Line | |
---|
[057badc] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | session_start();
|
---|
| 4 |
|
---|
| 5 | require './connect.php';
|
---|
| 6 |
|
---|
| 7 | if(!isset($_POST['order_id'])) {
|
---|
| 8 | header("Location: ./ActiveOrders.php");
|
---|
| 9 | die();
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | $res = mysqli_query($conn, "SELECT * FROM orders WHERE id={$_POST['order_id']};");
|
---|
| 13 |
|
---|
| 14 | if(mysqli_num_rows($res) >= 1) {
|
---|
| 15 | $row = $res->fetch_assoc();
|
---|
| 16 |
|
---|
| 17 | if($row['status'] == 'a') {
|
---|
| 18 | mysqli_query($conn, "UPDATE orders SET status = 'd', arrived_date = CURDATE() WHERE id={$_POST['order_id']};");
|
---|
| 19 | }
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 |
|
---|
| 23 | header("Location: ./ActiveOrders.php");
|
---|
| 24 | die();
|
---|
| 25 | ?> |
---|
Note:
See
TracBrowser
for help on using the repository browser.