
PK 
<?php
$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, MYSQLI_ASSOC)) {
// var_dump($order);
}
if ($_SESSION['msg']) { $msg = $_SESSION['msg']; unset($_SESSION['msg']); }
if ($_SESSION['errmsg']) { $errmsg = $_SESSION['errmsg']; unset($_SESSION['errmsg']); }
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Order Details</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="main.php">Home</a></li>
<li class="breadcrumb-item active">Order Details</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- Main content -->
<div class="invoice p-3 mb-3">
<!-- title row -->
<div class="row">
<div class="col-12">
<h4>
<img src="../images/logo.png" class="brand-image img-circle- elevation-3-" style="height:60px;">
<!-- <i class="fas fa-globe"></i> -->
<!-- Aelogifts.com -->
<small class="float-right">Date: <?php echo date("d-m-Y", strtotime($order['dt']));?></small>
</h4>
</div>
<!-- /.col -->
</div>
<!-- info row -->
<div class="row invoice-info">
<div class="col-sm-4 invoice-col">
From
<address>
<strong>Aelogifts.com</strong><br>
Ludhiana<br>
Phone: +91 79865 96997<br>
Email: info@aelogifts.com
</address>
</div>
<!-- /.col -->
<div class="col-sm-4 invoice-col">
To
<address>
<strong><?php echo $order['fname'];?> <?php echo $order['lname'];?></strong><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'];?>
</address>
</div>
<!-- /.col -->
<div class="col-sm-4 invoice-col">
<!-- <b>Invoice #007612</b><br> -->
<br>
<b>Order ID:</b> <?php echo $order['order_id'];?><br>
<b>Amount:</b> <?php echo $order['total'];?>/-<br>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- Table row -->
<div class="row">
<div class="col-12 table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Qty</th>
<th>Product</th>
<th>Description</th>
<th class="text-right">Price</th>
<th class="text-right">Qty</th>
<th class="text-right">Subtotal</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT od.*, p.pname, p.s_desc 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><?php echo $cnt;?></td>
<td><?php echo $row['pname'];?></td>
<td><?php echo $row['s_desc'];?></td>
<td class="text-right"><?php echo $row['price'];?></td>
<td class="text-right"><?php echo $row['qty'];?></td>
<td class="text-right"><?php echo $s_totl;?></td>
</tr>
<?php
$totl+=$s_totl;
$cnt++;
}
?>
</tbody>
</table>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<!-- accepted payments column -->
<div class="col-6">
<p class="lead">Payment Method: <strong><?php echo strtoupper($order['payment_method']);?></strong></p>
<p class="lead">Order Status: <strong><?php echo strtoupper($order['status']);?></strong></p>
<p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">
</p>
</div>
<!-- /.col -->
<div class="col-6">
<div class="table-responsive">
<table class="table">
<tbody>
<tr>
<th style="width:50%">Subotal:</th>
<th class="text-right">₹<?php echo number_format($totl,2);?></th>
</tr> <tr>
<th style="width:50%">Coupon Discount:</th>
<th class="text-right">-₹<?php echo number_format($order['coupon_discount'],2);?></th>
</tr>
<tr>
<th style="width:50%">Shipping Charges:</th>
<th class="text-right">₹<?php echo number_format($order['shipping'],2);?></th>
</tr>
<tr>
<th style="width:50%">Total:</th>
<th class="text-right">₹<?php echo number_format($totl-$order['coupon_discount']+$order['shipping'],2);?></th>
</tr>
</tbody>
</table>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- this row will not appear when printing -->
<div class="row no-print">
<div class="col-12">
<a href="javascript:window.print();" class="btn btn-default"><i class="fas fa-print"></i> Print</a>
<!-- <button type="button" class="btn btn-success float-right"><i class="far fa-credit-card"></i> Submit
Payment
</button>
<button type="button" class="btn btn-primary float-right" style="margin-right: 5px;">
<i class="fas fa-download"></i> Generate PDF
</button> -->
</div>
</div>
</div>
<!-- /.invoice -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>


PK 99