-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable_order.php
More file actions
93 lines (84 loc) · 2 KB
/
table_order.php
File metadata and controls
93 lines (84 loc) · 2 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
include("./sql/config.php");
mysql_select_db('store_management');
?>
<!DOCTYPE html>
<html>
<head>
<title>Table Order</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
.headline{
text-align: center;
}
</style>
</head>
<body>
<div class='container'>
<div class="headline">
<h2><b>Table Orders</b></h2>
</div>
<table class='table table-bordered'>
<thead>
<tr>
<th>ID</th>
<th>Ordar name</th>
<th>Date</th>
<th>Details</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT * FROM orders";
$res = '';
if($rel=mysql_query($sql,$conn)){
while($res=mysql_fetch_array($rel)){
?>
<tr>
<td><?php echo $res['id'] ?></td>
<td><?php echo $res['order_number'] ?></td>
<td><?php echo $res['date'] ?></td>
<td>
<table class='table table-bordered'>
<thead>
<tr>
<th>item_name</th>
<th>price</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT * FROM line_items WHERE order_id=". $res['id'] .";";
if($rel2=mysql_query($sql,$conn)){
while($res2=mysql_fetch_array($rel2)){
?>
<tr>
<td><?php echo $res2['item_name'] ?></td>
<td><?php echo $res2['price'] ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</td>
<td><a class="btn btn-danger" href=<?php echo "/Store_management/edit_order.php?id=".$res['id']?> >Edit</a></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</body>
</html>
<?php
mysql_close($conn);
?>