-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
83 lines (60 loc) · 2.35 KB
/
update.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
<?php
include "connect.php";
$id = $_GET['updateid'];
//echo $id;
$sql = "select * from event where EventID='$id'";
$result = mysqli_query($con,$sql);
//echo $result['EventName'];
$row = mysqli_fetch_assoc($result);
//echo $row['EventName'];
$eventname = $row['EventName'];
$eventlocation = $row['Location'];
$eventdate = $row['EventDate'];
$eventprice = $row['TicketPrice'];
$eventtime = $row['Time'];
if(isset($_POST['submit'])){
$eventID = $id;
$eventName = $_POST['eventName'];
$eventLocation = $_POST['eventLocation'];
$date = $_POST['date'];
$price = $_POST['price'];
$time = $_POST['eventTime'];
echo($time);
/* echo( $eventName);echo($eventLocation);
echo($date);echo($price);echo($time); */
$sql = "UPDATE event set EventID='$eventID', EventName='$eventName', Location= '$eventLocation', EventDate='$date', TicketPrice='$price',
Time='$time' where EventID='$eventID' ";
$result = mysqli_query($con,$sql);
if($result){
echo "Data inserted successfully";
header('location:EventAdminPage.php');
}else{
echo "error occured";
die(mysqli_error($con));
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Page</title>
<link href="./assets/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="d-flex justify-content-center my-5" style="">
<h1>Update Events</h1>
</div>
<div class="container my-5">
<form action="" method="post">
event Name: <input type="text" class="form-control" name="eventName" id="" value="<?php echo $eventname ?>"> <br>
event Location: <input type="text" class="form-control" name="eventLocation" id="" value="<?php echo $eventlocation ?>" > <br>
event date: <input type="date" class="form-control" name="date" id="" value="<?php echo $eventdate ?>"> <br>
ticket price: <input type="text" class="form-control" name="price" id="" value="<?php echo $eventprice ?>"> <br>
time: <input type="time" name="eventTime" class="form-control" id="" value="<?php echo $eventtime ?>"> <br><br>
<input type="submit" value="submit" class="form-control btn btn-primary" name="submit">
</form>
</div>
</body>
</html>