<?php session_start();
include("includes/db_config.php"); ?>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content=" ">
    <meta name="author" content="">
    <title>Orange Groceries</title>
    <?php include("includes/css.php");?> 
</head>

<body>
    <?php include("includes/header.php");?>

  <section class="page-info section-padding border-bottom topthumb">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <a href="https://orangegroceries.com/index.php"> <span class="mdi mdi-home"></span> &nbsp; Home</a> <span class="mdi mdi-chevron-right"></span> <a href="#">My Order</a>
                </div> 
        </div>
        </div>
    </section>
    <section class="checkout-page section-padding">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-3">
                    <div class="card account-left">
                        <div class="list-group">
                            <a href="my-profile.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-account-settings"></i> My Profile</a>
                            <a href="edit-profile.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-table-edit"></i> Edit Profile</a>
                            <a href="my-order.php" class="list-group-item list-group-item-action active"><i aria-hidden="true" class="mdi mdi-format-list-bulleted"></i> My Order</a>
                             <a href="wishlist.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-file-find"></i> My Wish List</a>
                            <a href="manage-address.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-map-marker-circle"></i> Manage Address </a>
                           <!--  <a href="referral-code.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-heart-outline"></i> Referral Code </a>
                            <a href="change-password.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-heart-outline"></i> Change Password </a> -->
                            <a href="logout.php" class="list-group-item list-group-item-action"><i aria-hidden="true" class="mdi mdi-lock"></i> Logout</a>
                        </div>
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="card card-body account-right my-address-page ">
                        <div class="page-heading">
                            <h3>My Orders</h3>
                        </div>
                        <div class="table-responsive">
                            <table class="table cart_summary text-black">
                                <thead> 
                                    <tr>
                                      <!--   <th class="product-remove" style="width:5%;"></th> -->
                                        <th class="product-thumbnail" style="width:15%;">Order-Id</th>
                                        <th class="product-thumbnail" style="width:35%;">Product Date</th>
                                        <!-- <th class="product-thumbnail" style="width:35%;">Product Name</th> -->
                                        <th class="product-price" style="width:15%;">Price</th>
                                        <th class="product-price" style="width:15%;">Status</th>
                                        <th class="product-subtotal" style="width:15%;">Items View</th>
                                    </tr>
                                </thead>
                                <tbody>
                                     <?php $id=$_SESSION['id'];
                                         $sql_ptm="select * from user_payment where user_id='".$id."'";
                                        $result_ptm = mysqli_query($conn, $sql_ptm);
                                        while($res= mysqli_fetch_array($result_ptm)){
                                      ?>
                                    <tr>
                                       <!--  <td class="product-remove">
                                            <a class="btn btn-sm btn-danger" href="#"><i class="mdi mdi-close-circle-outline"></i></a>
                                        </td> -->
                                        <td class="product-thumbnail">
                                            <?php echo $res['order_id']; ?>
                                        </td>
                                         <td class="product-thumbnail">
                                           <?php $date = $res['created_date'];
                                            echo $Date = date("d M Y , H:i A ", strtotime($date)); ?>
                                        </td>
                                       <!--  <td class="product-name">
                                            <a href="#"> <h6><?php echo $res['prod_name']; ?> </h6></a>
                                        </td> -->
                                        <td class="product-price">
                                            <span class="product-price-amount amount"><span class="currency-sign text-black">Rs. <?php echo $res['total_price']; ?></span></span></td>
                                        <td>
                                            <strong><?php if(!empty($res['payment_status'])){ echo $res['payment_status']; }else{ echo "Processing"; } ?></strong>
                                        </td>
                                        <td class="product-subtotal">
                                             <a href="invoice.php?id=<?php echo $res['id']; ?>" ><button type="button" class="btn btn-primary btn-sm"><i class="mdi mdi-eye"></i> View</button></a>
                                        </td>
                                    </tr><?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <?php include("includes/footer.php");?>
    <?php include("includes/js.php");?>
</body>

</html> 