-
Notifications
You must be signed in to change notification settings - Fork 0
/
orders.php
71 lines (60 loc) · 2.68 KB
/
orders.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
session_start();
include("./includes/db.php");
error_reporting(0);
if(isset($_GET['action']) && $_GET['action']!="" && $_GET['action']=='delete')
{
$order_id=$_GET['order_id'];
/*this is delet query*/
mysqli_query($con,"delete from orders where order_id='$order_id'")or die("delete query is incorrect...");
}
///pagination
$page=$_GET['page'];
if($page=="" || $page=="1")
{
$page1=0;
}
else
{
$page1=($page*10)-10;
}
include "sidenav.php";
include "topheader.php";
?>
<!-- End Navbar -->
<div class="content">
<div class="container-fluid">
<!-- your content here -->
<div class="col-md-14">
<div class="card ">
<div class="card-header card-header-primary">
<h4 class="card-title">Orders / Page <?php echo $page;?> </h4>
</div>
<div class="card-body">
<div class="table-responsive ps">
<table class="table table-hover tablesorter " id="">
<thead class=" text-primary">
<tr><th>Customer Name</th><th>Products</th><th>Contact | Email</th><th>Address</th><th>Details</th><th>Shipping</th><th>Time</th>
</tr></thead>
<tbody>
<?php
$result=mysqli_query($con,"select order_id, product_title, first_name, mobile, email, address1, address2, product_price,address2, qty from orders,products,user_info where orders.product_id=products.product_id and user_info.user_id=orders.user_id Limit $page1,10")or die ("query 1 incorrect.....");
while(list($order_id,$p_names,$cus_name,$contact_no,$email,$address,$country,$details,$zip_code,$time,$quantity)=mysqli_fetch_array($result))
{
echo "<tr><td>$cus_name</td><td>$p_names</td><td>$email<br>$contact_no</td><td>$address<br>ZIP: $zip_code<br>$country</td><td>$details</td><td>$quantity</td><td>$time</td>
<td>
<a class=' btn btn-danger' href='orders.php?order_id=$order_id&action=delete'>Delete</a>
</td></tr>";
}
?>
</tbody>
</table>
<div class="ps__rail-x" style="left: 0px; bottom: 0px;"><div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div></div><div class="ps__rail-y" style="top: 0px; right: 0px;"><div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 0px;"></div></div></div>
</div>
</div>
</div>
</div>
</div>
<?php
include "footer.php";
?>