-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmyOrder.php
More file actions
105 lines (94 loc) · 3.22 KB
/
Copy pathmyOrder.php
File metadata and controls
105 lines (94 loc) · 3.22 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
94
95
96
97
98
99
100
101
102
103
104
105
<?php
session_start();
?>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/neptune.css"/>
<head>
<script src="js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button.btn-dlt").click(
function(){
order_id = $(this).attr("id");
if( order_id > 0) {
$.post("func-cancel-order.php",
{
order_id: order_id
},
function (data, status) {
alert(data);
$(".content").load("myOrder.php");
});
}
});
});
</script>
</head>
<style>
.container_m{
width:50%;
margin-left: auto;
margin-right: auto;
}
.row{
margin-top:20px;
text-align: center;
}
.row p{
padding-top:7px;
}
</style>
<div class="container">
<div class="menu_title">
<h1 style="text-align: center;color:#000033">我的订单</h1>
<hr/>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="row">
<table class="table table-striped table-hover table-bordered">
<h3 style="text-align: center;color: black">今日订单</h3><hr/>
<tr>
<td><b>时间</b></td>
<td><b>菜名</b></td>
<td><b>取消</b></td>
</tr>
<?php
include("conn.php");
foreach ($dbh->query("SELECT * FROM order_with_info where user_id = $_SESSION[user_id] order by time desc") as $row) {
echo '
<tr>
<td>'.$row['time'].'</td>
<td>'.$row['dishname'].'</td>
<td><button id='.$row['order_id'].' class="btn btn-danger btn-sm btn-dlt"> <span class="glyphicon glyphicon-remove"></span> 取消</button></td>
</tr>
';
}
?>
</table>
</div>
<div class="row">
<table class="table table-striped table-hover table-bordered">
<h3 style="text-align: center;color: black">历史订单</h3><hr/>
<tr>
<td><b>时间</b></td>
<td><b>菜名</b></td>
</tr>
<?php
include("conn.php");
foreach ($dbh->query("SELECT * FROM histort_order_with_info where user_id = $_SESSION[user_id] order by time desc") as $row) {
echo '
<tr>
<td>'.$row['time'].'</td>
<td>'.$row['dishname'].'</td>
</tr>
';
}
?>
</table>
</div>
</div>
<div class="col-md-2"></div>
</div>
</div>