/
userorderintro.php
287 lines (254 loc) · 9.08 KB
/
userorderintro.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<?php
/**
* userorderintro.php 订单详情页
*/
require_once("usercheck2.php");
$id=sqlReplace(trim($_GET['id']));
$key=empty($_GET['key'])?'new':sqlReplace(trim($_GET['key']));
$POSITION_HEADER="用户中心";
$sql="select * from qiyu_shop,qiyu_order where (order_shop=shop_id2 or order_shopid=shop_id) and order_id=".$id;
$rs=mysql_query($sql);
$rows=mysql_fetch_assoc($rs);
if ($rows){
$shopName=$rows['shop_name'];
$orderAddtime=$rows['order_addtime'];
$orderStatus=$rows['order_status'];
$order=$rows['order_id2'];
$orderPriceAll=$rows['order_totalprice'];
$orderTotal=$rows['order_price'];
$deliverFee=$rows['order_deliverprice'];
$orderInfor=$rows['order_infor'];
$orderText=$rows['order_text'];
$spot=$rows['order_spot'];
$circle=$rows['order_circle'];
$orderType=$rows['order_type'];
$orderTime1=$rows['order_time1'];
$orderTime2=substr($rows['order_time2'],0,5);
}else{
alertInfo('非法操作','index.php',0);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css"/>
<link rel="icon" href="<?php echo $imgstr2;?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $imgstr2;?>" type="image/x-icon" />
<script src="js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="js/addbg.js" type="text/javascript"></script>
<script src="js/tab.js" type="text/javascript"></script>
<script src="js/userorder.js" type="text/javascript"></script>
<script src="js/userreg.js" type="text/javascript"></script>
<script src="js/chage1.js" type="text/javascript"></script>
<script src="js/TINYBox.js" type="text/javascript" language="javascript"></script>
<link rel="stylesheet" href="js/TINYBox.css" type="text/css"/>
<title> 订单详情 - <?php echo $SHOP_NAME?> - <?php echo $powered?> </title>
</head>
<script type="text/javascript" >
//getstatus();
var int=self.setInterval("getstatus()",15000);
function getstatus(){
var orderid=$("#orderid").val();
var orderkey=$("#orderkey").val();
$.ajax({
type: "GET",
url: "getstatus.php?key="+orderkey+"&id="+orderid+"&url=intro",
data: "",
success: function(msg){
var content=msg.split("||||||");
$("#order").html(content[0]);
$("#orderChangList").html(content[1]);
$("#intro_r_content").html(content[2]);
}
});
}
</script>
<body>
<div id="container">
<?php
require_once('header_index.php');
?>
<div id="main">
<div class="main_content">
<div class="main_top order_top"></div>
<div class="main_center order_center">
<div id="order_left">
<div id="tab4">
<ul>
<li id="t2" class='selected'></li>
<li id="t5"></li>
<li id="t6"></li>
</ul>
<div class="clear"></div>
</div>
</div>
<div id="order_right">
<div>
<input type="hidden" id="orderid" name="orderid" value="<?php echo $id?>" />
<input type="hidden" id="orderkey" name="orderkey" value="<?php echo $key?>" />
<h1 class="order_h1"><a href='usercenter.php?tab=2'>所有订单</a></h1>
<div class="centerBorder"><img src="images/intro_bg.jpg" alt="" /></div>
<div class="orderStateList">
<div id="orderChangList">
<?php
$i=1;
$sql="select * from qiyu_orderchange where orderchange_order='".$order."'";
$rs=mysql_query($sql);
$reCount=mysql_num_rows($rs);
while ($rows=mysql_fetch_assoc($rs)){
$addTime=substr($rows['orderchange_addtime'],11);
$intro=HTMLDecode($rows['orderchange_name']);
?>
<table border='0'>
<tr>
<td class='s_left' valign='top' width='63'><?php echo $addTime?></td>
<td class='s_right' valign='top'><?php echo $intro?></td>
</tr>
</table>
<table border='0'>
<tr>
<td style='padding:0'><img src="images/line_719.jpg" alt="" /></td>
</tr>
</table>
<?php
if ($i==1 || $reCount==1){
$addTime1='';
$intro1="<span class=\"greenbg\"><span><span>小提示</span></span></span>您的订单进度会自动更新,请稍后.....
";
?>
<table border='0'>
<tr>
<td class='s_left' valign='top' width='63'><?php echo $addTime1?></td>
<td class='s_right' valign='top'><?php echo $intro1?></td>
</tr>
</table>
<table border='0'>
<tr>
<td style='padding:0'><img src="images/line_719.jpg" alt="" /></td>
</tr>
</table>
<?php
}
$i++;
}
?>
</div>
</div>
<div class="intro_l" id="intro_l">
<div class="intro">
<div class="top"><img src="images/order_intro.jpg" alt=""/></div>
<p style="margin-top:0">订单号:<?php echo $order?> <span class="time">订单时间:<?php echo $orderAddtime?></span>
<?php if ($orderType=='1') echo "<span class='time'>预约时间:".$orderTime1." ".$orderTime2."</span>"?>
</p>
<div class="table table_yellow">
<table>
<tr>
<td class="meter" style="padding-left: 10px;" width="202"> 菜品名</td>
<td class="meter" width="154">单价</td>
<td class="meter" width="115">份数</td>
<td class="meter" width="200">备注</td>
</tr>
<?php
$total=0;
$sql="select * from qiyu_cart inner join qiyu_food on food_id=cart_food and cart_order='".$order."' and cart_status='1'";
$rs=mysql_query($sql);
while ($rows=mysql_fetch_assoc($rs)){
?>
<tr>
<td style="padding-left: 10px;"><?php echo $rows['food_name']?></td>
<td><?php echo $rows['cart_price']?></td>
<td><?php echo $rows['cart_count']?></td>
<td><?php echo $rows['cart_desc']?></td>
</tr>
<?php
}
//消费的积分
$sql="select * from qiyu_rscore where rscore_order='".$order."' and rscore_type='0'";
$rs=mysql_query($sql);
$rows=mysql_fetch_assoc($rs);
if ($rows){
$score=$rows['rscore_spendvalue'];
}
else
$score=0;
?>
<tr>
<td style="border:0" colspan="4">餐饮要求:<span class="red"><?php echo $orderText;?></span></td>
</tr>
<tr>
<td style="border:0" colspan="4">订单备注:<span class="red"><?php echo $orderInfor;?></span></td>
</tr>
<tr>
<td style="border:0" colspan="4">餐点总额:<span class="red"> <?php echo $orderTotal?>元 </span></td>
</tr>
<tr>
<td style="border:0">送餐费:<span class="red"> <?php echo $deliverFee?>元 </span></td>
<td colspan="3" style="border: 0px ;">
<span class="red" style='font-size:24px;'>总计:<?php echo $orderPriceAll?>元</span>
</td>
</tr>
</table>
<?php if ($orderStatus=="1"){?><div id="intro_r_content"><p class='finishButton'><img src="images/button/finish.jpg" onClick="orderFinish(<?php echo $id?>)" alt="" class='finishButton' style='cursor:pointer;'/></p></div><?php }?>
</div>
</div><!--intro wan-->
</div>
</div><!--tab2wan-->
<div style='display:none;'>
<?php require_once('usercentertab5.inc.php');?>
</div><!--tab5完-->
<div style='display:none;'>
<?php require_once('usercentertab6.inc.php');?>
</div><!--tab6完-->
</div>
<div class="clear"></div>
</div>
<div class="main_bottom order_bottom"></div>
</div><!--main_content完-->
</div>
<?php
require_once('footer.php');
?>
</div>
<script type="text/javascript">
function alertadd(act){//添加地址
var phone=$("#phone").val();
var name=$("#name").val();
var address=$("#address").val();
$(".input").trigger('blur');
var numError = $('.onError').length;
if(numError){
return false;
}
$.ajax({
type: "POST",
url: "usercenter_do.php?act="+act,
data: "phone="+phone+"&name="+name+"&address="+address,
success: function(msg){
TINY.box.show(msg,0,160,60,0,10);
//setTimeout("location.reload()",1000);
location.href='usercenter.php?tab=5';
}
});
}
</script>
<script type="text/javascript">
function updateusername(){//修改姓名
var user_name=$("#user_name").val();
if(user_name==''){
$('.errormt2').html('姓名不能为空');
return false;
}
$.ajax({
type: "POST",
url: "usercenter_do.php?act=updateusername",
data: "user_name="+user_name,
success: function(msg){
TINY.box.show(msg,0,160,60,0,10);
//setTimeout("location.reload()",1000);
location.href='usercenter.php?tab=5';
}
});
}
</script>
</body>
</html>