
PK 
<?php
include "conn.php";
$_SESSION['url']=$_SERVER['REQUEST_URI'];
check_login();
$query = "SELECT * from orders as o where o.order_id= '$_GET[order_id]'";
$query = mysqli_query($conn, $query) or die(mysqli_error($conn));
if ($order = mysqli_fetch_array($query)) {
}
include "header.php";
?>
<div class="breadcrumb-section">
<div class="container">
<h2>Order Details</h2>
<nav class="theme-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Home</a>
</li>
<li class="breadcrumb-item active">Order Details</li>
</ol>
</nav>
</div>
</div>
<section class="tracking-page section-b-space">
<div class="container">
<div class="title-header mb-3">
<h5>Order Number: #<?php echo $order['order_id'];?></h5>
<div class="ms-auto"><b>Date: <?php echo date("d-m-Y", strtotime($order['dt']));?></b></div>
</div>
<div class="table-responsive">
<table class="table tacking-table">
<thead>
<tr>
<th>Image</th>
<th>Full Name</th>
<th class="text-end">Price</th>
<th class="text-end">Quantity</th>
<th class="text-end">Sub Total</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT od.*, p.pname, p.pic1 from order_details as od
INNER JOIN prd as p ON p.pid = od.pid
where od.order_id= '$_GET[order_id]'
";
$query = mysqli_query($conn, $query) or die (mysqli_error($conn));
$cnt=1;
while($row = mysqli_fetch_array($query)){
$s_totl=$row['qty']*$row['price'];
?>
<tr>
<td class="product-image">
<img src="products/<?php echo $row['pic1'];?>" class="img-fluid" alt="">
</td>
<td>
<h6><?php echo $row['pname'];?></h6>
</td>
<td class="text-end">
<h6>₹<?php echo $row['price'];?></h6>
</td>
<td class="text-end">
<h6><?php echo $row['qty'];?></h6>
</td>
<td class="text-end">
<h6>₹<?php echo $s_totl;?></h6>
</td>
</tr>
<?php
$totl+=$s_totl;
$cnt++;
}
?>
</tbody>
</table>
</div>
<div class="summary-details my-3">
<div class="row g-4">
<div class="col-xxl-8 col-lg-12 col-md-7">
<div class="details-box">
<h3 class="order-title">Consumer Details</h3>
<div class="customer-detail tracking-wrapper">
<ul class="row g-3">
<li class="col-sm-5">
<label>Shipping Address:</label>
<h4>
<?php echo $order['fname'];?> <?php echo $order['lname'];?> <br>
<?php echo $order['address'];?> <?php echo $order['address1'];?> <br>
<?php echo $order['city'];?> <?php echo $order['state'];?> <?php echo $order['postcode'];?><br>
Phone: <?php echo $order['mobile'];?><br>
Email: <?php echo $order['email'];?>
</h4>
</li>
<li class="col-sm-4">
<label>Payment Mode:</label>
<div class="d-flex align-items-center gap-2">
<h4>
<?php echo strtoupper($order['payment_method']);?>
<?php
if($order['payment_method']=='razorpay'){
$ar=json_decode($order['payment_response']);
// echo "<pre>";print_r($ar);echo "</pre>";
echo "<br /><br />TXNID: ".$ar->id;
// echo "<br />ORDERID: ".$ar->ORDERID;
echo "<br />TXNAMOUNT: ₹".$ar->amount/100;
echo "<br />TXNDATE: ".date('d-m-Y', $ar->created_at);
// echo "<br />RESPMSG: ".$ar->RESPMSG;
// echo "<br><b style='color: red;'>".strtoupper(($ar->status?$ar->status:""))."</b>";
}
?>
</h4>
</div>
</li>
<li class="col-sm-3">
<label>Order Status:</label>
<div class="d-flex align-items-center gap-2">
<h4>
<div class="badge bg-pending custom-badge rounded-0">
<span><?php echo $order['status'];?><?php //echo strtoupper(($ar->status?$ar->status:""))?></span>
</div>
</h4>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="col-xxl-4 col-lg-12 col-md-5">
<div class="details-box">
<h3 class="fw-semibold mb-3 order-title"> Summary </h3>
<ul class="tracking-total tracking-wrapper">
<li>Subotal <span>₹<?php echo number_format($totl,2);?></span></li>
<li>Coupon Discount <span>-₹<?php echo number_format($order['coupon_discount'],2);?></span></li>
<li>Shipping Charges <span>₹<?php echo number_format($order['shipping'],2);?></span></li>
<li>Total <span>₹<?php echo number_format($totl-$order['coupon_discount']+$order['shipping'],2);?></span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include "footer.php"; ?>


PK 99