-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_order.php
74 lines (61 loc) · 2.1 KB
/
admin_order.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
72
73
74
<?php
session_start();
require_once "./functions/admin.php";
$title = "List book";
require_once "./template/header1.php";
require_once "./functions/database_functions.php";
$conn = db_connect();
$result = getAll($conn);
?>
<p class="lead"><a href="admin_add.php">-->Add new Product</a></p>
<p class="lead"><a href="admin_order.php">-->Order product</a></p>
<p class="lead"><a href="admin_query.php">-->Customer Query</a></p>
<a href="admin_book.php" style="color: black;
padding: 6px;
border: 2px solid black;
border-radius: :2px;
text-decoration: none;">->Back to Admin</a>
<a href="admin_signout.php" class="btn btn-primary">Sign out!</a>
<table class="table" style="margin-top: 20px">
<tr>
<th>Ship_name</th>
<!-- <th>Product details</th> -->
<th>Amount</th>
<th>Date</th>
<th>ship_address</th>
<th>Ship_city</th>
<th>Ship_zip_code</th>
<th> </th>
<th> </th>
</tr>
<?php
$sql="SELECT * FROM orders";
//$sql="SELECT a.*,b.book_title FROM `orders` a,`books` b WHERE a.orderid=b.publisherid";
//$sql="SELECT a.*,b.b_id,b.rank FROM `entry` a,`block` b WHERE a.p_code=b.p_code";
//echo $sql;
//$result=$conn->query($sql);
$result = mysqli_query($conn,$sql);
//var_dump($result);
$rows = mysqli_num_rows($result);
// get number of rows returned
//var_dump($rows);
if ($rows) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?= $row['ship_name']; ?></td>
<!-- <td><?= $row['book_title']; ?></td> -->
<td><?= $row['amount']; ?></td>
<td><?= $row['date']; ?></td>
<td><?= $row['ship_address']; ?></td>
<td><?= $row['ship_city']; ?></td>
<td><?= $row['ship_zip_code']; ?></td>
</tr>
<?php }
}
?>
</table>
<?php
if(isset($conn)) {mysqli_close($conn);}
require_once "./template/footer.php";
?>