<?php
error_reporting(0);
ob_start();
session_start();
include_once("include/dbconnect.php");
?><!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="author" content="pixelstrap">
    <link rel="icon" href="assets/images/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="assets/images/favicon.png" type="image/x-icon">
    <?php include_once("include/title.php"); ?>
    <!-- Google font-->
    <link href="../../css2?family=Public+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
    <!-- Fontawesome css -->
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/font-awesome.css">
    <!-- Linear Icon css -->
    <link rel="stylesheet" href="assets/css/linearicon.css">
    <!-- Themify icon css -->
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/themify.css">
    <!-- Feather icon css -->
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/feather-icon.css">
    <!-- remixicon css -->
    <link rel="stylesheet" type="text/css" href="assets/css/remixicon.css">
    <!-- Plugins css -->
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/scrollbar.css">
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/animate.css">
    <!-- Bootstrap css -->
    <link rel="stylesheet" type="text/css" href="assets/css/vendors/bootstrap.css">
    <!-- App css -->
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
</head>
<body>
    <!-- tap on top start -->
    <div class="tap-top">
        <i data-feather="chevrons-up"></i>
    </div>
    <!-- tap on tap end -->

    <!-- page-wrapper Start -->
    <div class="page-wrapper compact-wrapper" id="pageWrapper">
        <!-- Page Header Start-->
        <?php include_once("include/header.php"); ?>
        <!-- Page Header Ends-->

        <!-- Page Body Start-->
        <div class="page-body-wrapper">
            <!-- Page Sidebar Start-->
            <div class="sidebar-wrapper">
                <div id="sidebarEffect"></div>
                <div>
                <?php include_once("include/nav.php"); ?>
                </div>
            </div>
            <!-- Page Sidebar Ends-->

            <!-- tracking section start -->
            <?php
							    $userd="select * from customer_orders where cust_order_id=".$_GET['cartid']."";
							    $quw=mysqli_query($conn, $userd);
								$userdet=mysqli_fetch_array($quw); 
                                ?>
                               <?php  
			                   $result=mysqli_query($conn, "select * from user_info where user_id=".$_GET['userid']);
							   $userres=mysqli_fetch_array($result); 
                               ?>
            <div class="page-body">
                <!-- tracking table start -->
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="card">
                                <div class="card-body">
                                    <div class="title-header title-header-block package-card">
                                        <div>
                                            <h5>Order #Bumi00<?php echo $userdet['cust_order_id']; ?>, Order Type : <?php echo $userdet['ord_type']; ?></h5>
                                        </div>
                                        <div class="card-order-section">
                                            <ul>
                                                <li><?php echo $userdet['order_date']; ?></li>
                                              <!--  <li>6 items</li>-->
                                                <li>Total$<?php echo number_format($userdet['total_amount'],2)?></li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="bg-inner cart-section order-details-table">
                                        <div class="row g-4">
                                            <div class="col-xl-8">
                                                <div class="table-responsive table-details">
                                                    <table class="table cart-table table-borderless">
                                                        <thead>
                                                            <tr>
                                                                <th colspan="2">Items</th>
                                                                <th class="text-end" colspan="3">
                                                                 
                                                                </th>
                                                            </tr>
                                                        </thead>

                                                        <tbody> 
                                                            <?php  
	$pro="select * from orders where cust_order_id=".$_GET['cartid'];	
	$proddetails=mysqli_query($conn, $pro);	
									 ?>
                                     <?php 
	 while($prodres=mysqli_fetch_array($proddetails)) {
						          ?>


                                                            <tr class="table-order">
                                                                <td>
                                                                    <a href="javascript:void(0)">
                                                                        <img src="../products/thumb/<?php echo $prodres['product_id'];?>.jpg" class="img-fluid blur-up lazyload" alt="">
                                                                    </a>
                                                                </td>
                                                                <td>
                                                                    <p>Product Name</p>
                                                                    <h5><?php   echo $prodres['item_name'];  ?></h5>
                                                                </td>
                                                                <td>
                                                                    <p>Quantity</p>
                                                                    <h5><?php  echo $prodres['qty'];?></h5>
                                                                </td>
                                                                <td>
                                                                    <p>Price</p>
                                                                    <h5>$<?php  echo $prodres['itemprice'];?></h5>
                                                                </td>
                                                                <td>
                                                                    <p>Total Price</p>
                                                                    <h5>$ <?php echo $prodres['itemprice']*$prodres['qty'];?></h5>
                                                                </td>
                                                            </tr>
                                                            <?php } ?> 
                                                            <tr class="table-order">
                                                                <td colspan="5">
                                                                Special Instructions : <?php echo $userdet['special_instructions']; ?>
                                                            </td>
                                                            </tr>
                                                        </tbody>

                                                        <tfoot>
                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Subtotal :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>$ <?php echo $userdet['cart_total']?></h4>
                                                                </td>
                                                            </tr>

                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Tax :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>$ <?php echo number_format($userdet['tax'],2)?></h4>
                                                                </td>
                                                            </tr>
                                                            <?php if($userdet['diskprice']!=""){ ?>
                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Discount :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>-$ <?php echo number_format($userdet['diskprice'],2)?></h4>
                                                                </td>
                                                            </tr>
                                                            <?php } ?>
                                                            <?php if($userdet['additionaldisc']!=""){ ?>
                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Additional Discount :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>-$ <?php echo number_format($userdet['additionaldisc'],2)?></h4>
                                                                </td>
                                                            </tr>
                                                            <?php } ?>
                                                            <?php if($userdet['ord_type']=="Delivery"){ ?>
                                                          <!--  <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Delivery Charges :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>$ <?php echo number_format($userdet['ship_charge'],2)?></h4>
                                                                </td>
                                                            </tr>-->
 <?php } ?>
 <?php if($userdet['ord_type']=="Delivery"){ ?>
                                                         <!--   <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Additional Discount :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>$ <?php echo number_format($userdet['ship_charge'],2)?></h4>
                                                                </td>
                                                            </tr>-->
 <?php } ?><!-- 
                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h5>Tax(GST) :</h5>
                                                                </td>
                                                                <td>
                                                                    <h4>$10.00</h4>
                                                                </td>
                                                            </tr>
     -->
                                                            <tr class="table-order">
                                                                <td colspan="3">
                                                                    <h4 class="theme-color fw-bold">Total Price :</h4>
                                                                </td>
                                                                <td>
                                                                    <h4 class="theme-color fw-bold">$<?php echo number_format($userdet['total_amount'],2)?></h4>
                                                                </td>
                                                            </tr>
                                                        </tfoot>
                                                    </table>
                                                </div>
                                            </div>

                                            <div class="col-xl-4">
                                                <div class="order-success">
                                                    <div class="row g-4">
                                                        <h4>summery</h4>
                                                        <ul class="order-details">
                                                            <li>Order ID: Bumi00<?php echo $userdet['cust_order_id']; ?></li>
                                                            <li>Order Date:  <?php echo $userdet['order_date']; ?></li>
                                                            <li>Order Total: $<?php echo number_format($userdet['total_amount'],2)?></li>
                                                        </ul>

                                                        <h4>Billing address</h4>
                                                        <ul class="order-details">
                                                            <li> <?php echo ucfirst($userdet['first_name']); ?>,</li>
                                                            <li><?php echo $userdet['address']; ?>, <?php echo $userdet['city']; ?>, <?php echo $userdet['state']; ?>,</li>
                                                            <li><?php echo $userdet['zipcode']; ?>,<?php echo $userdet['country']; ?>,</li>
                                                            <li><?php echo $userdet['email']; ?>,<?php echo $userdet['pnumber']; ?>.</li>
                                                        </ul>
                                                        <?php if($userdet['ord_type']=="Delivery"){ ?>
                                                        <h4>shipping address</h4>
                                                        <ul class="order-details">
                                                            <li> <?php echo ucfirst($userdet['ship_fname']); ?>,</li>
                                                            <li><?php echo $userdet['ship_address']; ?>, <?php echo $userdet['ship_city']; ?>, <?php echo $userdet['ship_state']; ?>,</li>
                                                            <li><?php echo $userdet['ship_zipcode']; ?>,<?php echo $userdet['ship_country']; ?>,</li>
                                                            <li><?php echo $userdet['ship_email']; ?>,<?php echo $userdet['ship_pnumber']; ?>.</li>
                                                        </ul>
<?php } ?>
                                                       <!-- <div class="payment-mode">
                                                            <h4>payment method</h4>
                                                            <p>Pay on Delivery (Cash/Card). Cash on delivery (COD)
                                                                available. Card/Net banking acceptance subject to device
                                                                availability.</p>
                                                        </div>-->

                                                       <!-- <div class="delivery-sec">
                                                            <h3>expected date of delivery: <span>october 22, 2018</span>
                                                            </h3>
                                                            <a href="order-tracking.php">track order</a>
                                                        </div>-->
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- section end -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- tracking table end -->
                <div class="container-fluid">
                    <!-- footer start-->
                    <?php include_once("include/footer.php"); ?>
                </div>
            </div>
            <!-- tracking section End -->
        </div>
    </div>
    <!-- page-wrapper End -->
    <!-- Modal start -->
    <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
        <div class="modal-dialog  modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-body">
                    <h5 class="modal-title" id="staticBackdropLabel">Logging Out</h5>
                    <p>Are you sure you want to log out?</p>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>

                    <div class="button-box">
                        <button type="button" class="btn btn--no" data-bs-dismiss="modal">No</button>
                        <button type="button" class="btn  btn--yes btn-primary">Yes</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Modal end -->
    <!-- latest js -->
    <script src="assets/js/jquery-3.6.0.min.js"></script>
    <!-- Bootstrap js -->
    <script src="assets/js/bootstrap/bootstrap.bundle.min.js"></script>
    <!-- feather icon js -->
    <script src="assets/js/icons/feather-icon/feather.min.js"></script>
    <script src="assets/js/icons/feather-icon/feather-icon.js"></script>
    <!-- scrollbar simplebar js -->
    <script src="assets/js/scrollbar/simplebar.js"></script>
    <script src="assets/js/scrollbar/custom.js"></script>
    <!-- Sidebar js -->
    <script src="assets/js/config.js"></script>
    <!-- customizer js -->
    <script src="assets/js/customizer.js"></script>
    <!-- Plugins js -->
    <script src="assets/js/sidebar-menu.js"></script>
    <script src="assets/js/notify/bootstrap-notify.min.js"></script>
    <script src="assets/js/notify/index.js"></script>
    <!-- sidebar effect -->
    <script src="assets/js/sidebareffect.js"></script>
    <!-- Theme js -->
    <script src="assets/js/script.js"></script>
</body>
</html>