-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditMenu.php
40 lines (34 loc) · 1.89 KB
/
EditMenu.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
<?php
session_start();
include './Assets/header.php';
include './Assets/restaurant-nav.php';
require './db.php';
$result = $db->query("SELECT * FROM menu WHERE RestID = '".$_POST['restid']."' AND MenuID = '".$_POST['id']."'");
if($row = mysqli_fetch_assoc($result)){
?>
<div class="container">
<div class="card card-body mt-3 row">
<center>
<form action="App/EditMenu.php" method="post" enctype="multipart/form-data">
<h5>แก้ไขเมนูอาหาร</h5>
<img src="./Image/<?=$row['MenuImg']?>" width="128" alt="">
<input type="text" class="form-select w-50 mt-2" name="name" placeholder="ชื่อเมนู" value="<?=$row['MenuName']?>">
<input type="text" class="form-select w-50 mt-2" name="price" placeholder="ราคา" value="<?=$row['MenuPrice']?>">
<input type="text" class="form-select w-50 mt-2" name="id" placeholder="ราคา" value="<?=$row['MenuID']?>" hidden>
<input type="text" class="form-select" name="restid" value="<?=$_SESSION['RestID']?>" hidden>
<select name="cate" id="" class="form-select mt-2 mb-2 w-50">
<?php
$res = $db->query("SELECT * FROM menu_category WHERE RestID = '".$_POST['restid']."'");
while($row = mysqli_fetch_assoc($res)):
?>
<option class="form-select" value="<?=$row['MenuCateName']?>"><?=$row['MenuCateName']?></option>
<?php endwhile; ?>
</select>
</select>
<input type="file" name="upload" id="" class="form-select w-50 mt-2">
<button type="submit" class="btn btn-warning mt-2 w-50 text-white">แก้ไขข้อมูล</button>
</form>
</center>
</div>
</div>
<?php } ?>