fetch_assoc(); $existing_data = $existing_data_res->fetch_assoc(); $pending_orders = 0; $active_orders = 0; $delivered_orders = 0; foreach($orders_res as $order) { $order_item = mysqli_query($conn, "SELECT * FROM order_item WHERE order_id = {$order['id']};"); $total_sum = 0; foreach($order_item as $item) { $total_sum = $total_sum + ($item['quantity']*$item['price']); } switch($order['status']) { case 'p': ++$pending_orders; break; case 'a': ++$active_orders; break; case 'd': ++$delivered_orders; break; default: break; } } ?> Profile

Your Profile

Edit
Email
Address
City
Postal Code
Име
Презиме
Тел. Број

Pending Orders

= 1) { foreach($orders_res as $order) { if($order['status'] == 'p') { ?>

Order Number:

Order Date:

Total Sum:

$

Active Orders

= 1) { foreach($orders_res as $order) { if($order['status'] == 'a') { ?>

Order Number:

Order Date:

Total Sum:

Shipped Date:

Delivered Orders

= 1) { foreach($orders_res as $order) { if($order['status'] == 'd') { ?>

Order Number:

Order Date:

Total Sum:

$

Shipped Date:

$

Arrived Date: