-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
56 lines (51 loc) · 1.32 KB
/
admin.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
<?php
/**
* Created by PhpStorm.
* User: jinbangzhu
* Date: 11/15/13
* Time: 11:08 AM
*/
require_once('./mysqlConn.php');
getCon();
if($_GET['id']){
$sql = "delete from menu where id =".$_GET['id'];
if (!mysql_query($sql)) {
die('Error: ' . mysql_error());
}
echo "<alert>删除成功</alert>";
}
?>
<html>
<head>
<title>绿野订餐管理系统</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<form action="./upload_file.php" method="post" enctype="multipart/form-data">
<label for="file">上传新菜单:</label>
<input type="file" name="file" id="file"/>
<br/>
<input type="submit" name="submit" value="开始上传"/>
</form>
<hr/>
<a href="order.php">查看订单</a>
<hr/>
<table>
<?php
$result = mysql_query("SELECT * FROM menu");
while ($row = mysql_fetch_array($result)) {
echo "<tr><td>
<a class='fancybox-effects-b' href='menus/'" . $row['name'] . "'>" .
"<img width='200' height='200' src='menus/".$row['name']."' class='raw_image'>
</a>
</td>
<td>
<a onclick=\"return confirm('确定要删除吗?')\" href='./admin.php?id=".$row['id']."'>删除</a>
</td>
</tr>";
}
?>
</table>
<hr/>
</body>
</html>