質問編集履歴
1
ソースまるだしであったため削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,275 +1,3 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
$staff_rank = @$_POST['staff_rank'];
|
4
|
-
|
5
|
-
$shop_id = 1; //あとでセッション
|
6
|
-
|
7
|
-
$edit_msg = @$_GET['edit_msg'];
|
8
|
-
|
9
|
-
mysql_connect("localhost","root","");
|
10
|
-
|
11
|
-
mysql_select_db("2018_t2");
|
12
|
-
|
13
|
-
mysql_query("SET NAMES UTF8");
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
$sql = "SELECT * FROM 2018t2_food,2018t2_foodcategory WHERE 2018t2_food.category_no=2018t2_foodcategory.category_no AND 2018t2_food.shop_id=$shop_id ORDER BY 2018t2_foodcategory.category_sort";
|
18
|
-
|
19
|
-
$sql = "SELECT * FROM 2018t2_staff_member WHERE staff_rank="%s",";
|
20
|
-
|
21
|
-
$result = mysql_query($sql);
|
22
|
-
|
23
|
-
$kensu = mysql_num_rows($result);
|
24
|
-
|
25
|
-
session_start();
|
26
|
-
|
27
|
-
?>
|
28
|
-
|
29
|
-
<html>
|
30
|
-
|
31
|
-
<head>
|
32
|
-
|
33
|
-
<meta name="viewport" content="width=720,initial-scale=1">
|
34
|
-
|
35
|
-
<script>
|
36
|
-
|
37
|
-
function scroll() {
|
38
|
-
|
39
|
-
var scrollY = window.sessionStorage.getItem(['scrollY']);
|
40
|
-
|
41
|
-
scrollTo(0,scrollY);
|
42
|
-
|
43
|
-
window.sessionStorage.removeItem(['scrollY']);
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
</script>
|
48
|
-
|
49
|
-
</head>
|
50
|
-
|
51
|
-
<body onload="scroll()">
|
52
|
-
|
53
|
-
<script type="text/javascript">
|
54
|
-
|
55
|
-
function deletecheck(){
|
56
|
-
|
57
|
-
if(window.confirm("削除しますか?\n(復元はできません)")){
|
58
|
-
|
59
|
-
return true;
|
60
|
-
|
61
|
-
}else{
|
62
|
-
|
63
|
-
window.alert('キャンセルされました');
|
64
|
-
|
65
|
-
return false;
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
function scrollget(){
|
74
|
-
|
75
|
-
var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
|
76
|
-
|
77
|
-
window.sessionStorage.setItem(['scrollY'],[scrollY]);
|
78
|
-
|
79
|
-
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</script>
|
86
|
-
|
87
|
-
<h1>メニュー一覧</h1>
|
88
|
-
|
89
|
-
<a href="order_list.php">注文受付画面へ</a><br>
|
90
|
-
|
91
|
-
<a href="foodtouroku.php">追加</a>
|
92
|
-
|
93
|
-
<?= $edit_msg ?>
|
94
|
-
|
95
|
-
<table border="1" width="100%">
|
96
|
-
|
97
|
-
<tr>
|
98
|
-
|
99
|
-
<th width="10%">カテゴリー</th>
|
100
|
-
|
101
|
-
<th width="10%">画像</th>
|
102
|
-
|
103
|
-
<th width="10%">商品名</th>
|
104
|
-
|
105
|
-
<th width="10%">単品の値段</th>
|
106
|
-
|
107
|
-
<th width="10%">セット場合の値段</th>
|
108
|
-
|
109
|
-
<th width="5%">テイクアウト可否
|
110
|
-
|
111
|
-
<th width="30%">詳細</th>
|
112
|
-
|
113
|
-
<th >表示・非表示</th>
|
114
|
-
|
115
|
-
<th >表示時間</th>
|
116
|
-
|
117
|
-
<th> </th>
|
118
|
-
|
119
|
-
</tr>
|
120
|
-
|
121
|
-
<?php
|
122
|
-
|
123
|
-
for($i=0; $i<$kensu; $i++){
|
124
|
-
|
125
|
-
$gyo = mysql_fetch_array($result);
|
126
|
-
|
127
|
-
?>
|
128
|
-
|
129
|
-
<tr <?php if($gyo["display_flg"]==0){echo " bgcolor='#cccccc'";} ?>>
|
130
|
-
|
131
|
-
<td><?= $gyo["category_name"] ?></td>
|
132
|
-
|
133
|
-
<td align="center"><img max-width="100" height="50" src="<?= $gyo["image"] ?>"></td>
|
134
|
-
|
135
|
-
<td><?= $gyo["name"] ?></td>
|
136
|
-
|
137
|
-
<td><?= $gyo["single_price"] ?>円</td>
|
138
|
-
|
139
|
-
<td><?php if($gyo["set_price"]==0){echo "セットなし";}else{echo $gyo["set_price"],"円";} ?></td>
|
140
|
-
|
141
|
-
<td align="right" ><?= $gyo["takeout"] ?></td>
|
142
|
-
|
143
|
-
<td><?= $gyo["details"] ?></td>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<td><?php
|
148
|
-
|
149
|
-
if($kensu == "1"){
|
150
|
-
|
151
|
-
?>
|
152
|
-
|
153
|
-
<form method="POST" name="form_display"action="food_displayedit.php">
|
154
|
-
|
155
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>">
|
156
|
-
|
157
|
-
<a href="javascript:form_display.submit()"><?php if($gyo["display_flg"]==1){echo "非表示";}else{echo "表示";} ?></a>
|
158
|
-
|
159
|
-
</form>
|
160
|
-
|
161
|
-
<?php
|
162
|
-
|
163
|
-
}else{
|
164
|
-
|
165
|
-
?>
|
166
|
-
|
167
|
-
<form method="POST" name="form_display"action="food_displayedit.php">
|
168
|
-
|
169
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>">
|
170
|
-
|
171
|
-
<a href="javascript:form_display[<?= $i ?>].submit()" onClick="scrollget()"><?php if($gyo["display_flg"]==1){echo "非表示";}else{echo "表示";} ?></a>
|
172
|
-
|
173
|
-
</form>
|
174
|
-
|
175
|
-
<?php
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
?>
|
180
|
-
|
181
|
-
</td>
|
182
|
-
|
183
|
-
<?php
|
184
|
-
|
185
|
-
$time = new DateTime($gyo["display_start"]);
|
186
|
-
|
187
|
-
$time2 = new DateTime($gyo["display_end"]);
|
188
|
-
|
189
|
-
?>
|
190
|
-
|
191
|
-
<td align="center"><?php echo $time->format('H:i'); ?><br>~<br><?php echo $time2->format('H:i'); ?></td>
|
192
|
-
|
193
|
-
<td>
|
194
|
-
|
195
|
-
<?php
|
196
|
-
|
197
|
-
if($kensu == "1"){
|
198
|
-
|
199
|
-
?>
|
200
|
-
|
201
|
-
<?php
|
202
|
-
|
203
|
-
if(staff_rank=='0'){
|
204
|
-
|
205
|
-
?>
|
206
|
-
|
207
|
-
<form method="POST" name="form1"action="foodedit.php">
|
208
|
-
|
209
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>">
|
210
|
-
|
211
|
-
<a href="javascript:form1.submit()">編集</a>
|
212
|
-
|
213
|
-
</form>
|
214
|
-
|
215
|
-
<form method="POST" name="form2"action="fooddelete.php" onSubmit="return deletecheck()">
|
216
|
-
|
217
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>">
|
218
|
-
|
219
|
-
<a href="javascript:form2.submit()" >削除</a>
|
220
|
-
|
221
|
-
</form>
|
222
|
-
|
223
|
-
<?php
|
224
|
-
|
225
|
-
}else{
|
226
|
-
|
227
|
-
?>
|
228
|
-
|
229
|
-
<form method="POST" name="form1"action="foodedit.php">
|
230
|
-
|
231
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>">
|
232
|
-
|
233
|
-
<a href="javascript:form1[<?= $i ?>].submit()">編集</a>
|
234
|
-
|
235
|
-
</form>
|
236
|
-
|
237
|
-
<form method="POST" name="form2"action="fooddelete.php" onClick="return deletecheck()">
|
238
|
-
|
239
|
-
<input type="hidden" name="food_id" value="<?= $gyo["food_id"] ?>" >
|
240
|
-
|
241
|
-
<a href="javascript:form2[<?= $i ?>].submit()">削除</a>
|
242
|
-
|
243
|
-
</form>
|
244
|
-
|
245
|
-
<?php
|
246
|
-
|
247
|
-
}
|
248
|
-
|
249
|
-
?>
|
250
|
-
|
251
|
-
<?php
|
252
|
-
|
253
|
-
}
|
254
|
-
|
255
|
-
?>
|
256
|
-
|
257
|
-
</td>
|
258
|
-
|
259
|
-
</tr>
|
260
|
-
|
261
|
-
<?php
|
262
|
-
|
263
|
-
}
|
264
|
-
|
265
|
-
?>
|
266
|
-
|
267
|
-
</table>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
1
|
エラー文
|
274
2
|
|
275
3
|
Parse error: syntax error, unexpected '","' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\2018\t2\shop\food_list.php on line 10
|