-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder.php
35 lines (22 loc) · 1.2 KB
/
order.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php require_once 'core/init.php'; ?>
<?php
if (isset($_GET['c_id'])) {
$customer_id = $_GET['c_id'];
$ip_add = $getFromU->getRealUserIp();
$status = "pending";
$invoice_no = mt_rand();
$select_carts = $getFromU->select_products_by_ip($ip_add);
foreach ($select_carts as $select_cart) {
$product_id = $select_cart->p_id;
$product_size = $select_cart->size;
$product_qty = $select_cart->qty;
$product_price = $select_cart->product_price;
$sub_total = $product_price * $product_qty;
$insert_customer_order = $getFromU->create("customer_orders", array("customer_id" => $customer_id, "due_amount" => $sub_total, "invoice_no" => $invoice_no, "qty" => $product_qty, "size" => $product_size, "order_date" => date("Y-m-d H:i:s"), "order_status" => $status));
$insert_pending_order = $getFromU->create("pending_orders", array("customer_id" => $customer_id, "invoice_no" => $invoice_no,"product_id" => $product_id, "qty" => $product_qty, "size" => $product_size, "order_status" => $status));
$delete_cart = $getFromU->delete_cart($ip_add);
$_SESSION['order_sub_msg'] = "Your Order has been Submitted Successfully";
header('Location: customer/my_account.php?my_orders');
}
}
?>