D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
aviscollection.com
/
admin
/
Filename :
order-list.php
back
Copy
<?php include'config.php'; error_reporting(0); // $view_order = "select * from orders INNER JOIN products"; $view_order = "SELECT * FROM orders"; $run_query = mysqli_query($conn, $view_order); $action = $_GET['action']; if($action == 'delete_order'){ $del_id = $_GET['id']; $del_event = mysqli_query($conn, "DELETE FROM orders WHERE order_id = '$del_id'") or mysqli_error($conn); if ($del_event) { echo '<script>alert("Order Inquiry data deleted.")</script>'; echo '<script> window.location.href = "order-list";</script>'; } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Customer Order List | <?php echo $company; ?></title> <?php include'style.php'; ?> </head> <body> <!-- Begin page --> <div id="layout-wrapper"> <?php include'header.php'; ?> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <div class="page-title-box d-sm-flex align-items-center justify-content-between"> <h4 class="mb-sm-0 font-size-18">Customer Order List</h4> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="javascript: void(0);">Admin</a></li> <li class="breadcrumb-item active">Order Inquiry</li> </ol> </div> </div> </div> </div> <!-- end page title --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table id="datatable" class='table dt-responsive nowrap'> <thead> <tr> <th># No.</th> <th>Product</th> <th>Category</th> <th>Order Date</th> <th>Custumer Name</th> <th>Customer Phone</th> <th>Edit</th> </tr> </thead> <tbody> <?php $sn = 0; if($run_query-> num_rows > 0){ while($row = mysqli_fetch_assoc($run_query)) { $order_id = $row['order_id']; $product_id = $row['product_id']; $phone = $row['cust_phone']; $name = $row['cust_name']; $date = $row['order_date']; $sn++; $qry_data = mysqli_query($conn, "SELECT * FROM products pd INNER JOIN product_category pc on pd.product_category = pc.category_id WHERE product_id = '$product_id'"); while($row = mysqli_fetch_assoc($qry_data)) { $product = $row['product_name']; $category = $row['category_name']; echo "<tr data-id='1'> <td data-field='contact_id' style='width: 80px'> ".$sn.". </td> <td data-field='contact_title' class='contact_title'>".$product." </td> <td data-field='contact_content' class='contact_content'> <p>".$category."</p> </td> <td data-field='contact_content' class='contact_content'> <p>".$phone."</p> </td> <td data-field='contact_content' class='contact_content'> <p>".$name."</p> </td> <td data-field='contact_content' class='contact_content'> <p>".$date."</p> </td> <td style='width: 100px'> <a href='order-list.php?id=$order_id&action=delete_order' class='btn btn-outline-danger btn-sm edit' title='Delete'> <i class='fas fa-trash-alt'></i> </a> </td> </tr>"; } } } else{ echo "<span style='color:#fe0002;font-size:15px;'>Banner list is Empty.</span>"; } ?> </tbody> </table> </div> </div> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- container-fluid --> </div> <?php include'right-sidebar.php'; ?> <?php include'script.php'; ?> </body> </html>