-
Notifications
You must be signed in to change notification settings - Fork 1
/
editseatcatagory.php
98 lines (79 loc) · 3.13 KB
/
editseatcatagory.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
<?php
include_once "connection/conn.php";
$path=realpath(dirname(__FILE__));
?>
<?php include_once "file/header.php"; ?>
<section class="contentsection clear">
<?php include_once "file/sidebar.php"; ?>
<article class="maincontent clear">
<div class="content">
<h2>Update Seat Types Catagory</h2>
<?php
if (isset($_GET["seat_id"]) and $_GET["seat_id"] !=NULL) {
$seat_id=preg_replace("/[^a-zA-Z0-9]/", "", $_GET["seat_id"]);
}else{
header("location:seatcatagorylist.php");
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"]=="POST") {
$types=$_POST["types"];
$price=$_POST["price"];
if ($types=="" || $price=="" ){
echo "<span style='color:red'>no empty</span>";
}else{
$sql="UPDATE seat set types='$types', price='$price' where seat_id='$seat_id'";
$query=mysqli_query($connection,$sql);
if ($query !=false) {
echo "<span style='color:green'>update successfully</span>";
}
}
}
?>
<form action="" method="post">
<table>
<?php
$sql="SELECT * FROM seat where seat_id='$seat_id'";
$query=mysqli_query($connection,$sql);
if ($query !=false) {
while ($value=mysqli_fetch_array($query)) {
?>
<tr>
<td>Seat type</td>
<td><select name="types">
<option value="">Select Seat type</option>
<option value="Gold">Gold</option>
<option value="Regular">Regular</option>
<option value="Silver">Silver</option>
<option value="Platinum">Platinum</option>
<option value="Vip">Vip</option>
</select>
<?php echo $value['types'] ?>
</td>
<td>Seat Price</td>
<td><select name="price">
<option value="">Select Amount</option>
<option value="400">400 TK</option>
<option value="450">450 TK</option>
<option value="500">500 TK</option>
<option value="600">600 TK</option>
</select>
<?php echo $value['price'] ?>
</td>
<br>
</tr>
<br>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Update"/></td>
</tr>
<?php }} ?>
</table>
</form>
</div>
</article>
</section>
<?php include_once "file/footer.php"; ?>
</div>
</body>
</html>