-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.php
More file actions
64 lines (39 loc) · 1.77 KB
/
events.php
File metadata and controls
64 lines (39 loc) · 1.77 KB
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
<head>
<link rel="stylesheet" href="projectstyle.css" type="text/css">
</head>
<?php
session_start();
include('connection.php');
include('header.php');
include('navigation.php');
if(isset($_POST['update'])){
$Update = "UPDATE events SET sno = '$_POST[sno]', name = '$_POST[name]', ldesp = '$_POST[ldesp], date = '$_POST[date]' WHERE sno = '$_POST[hidden]'";
mysqli_query($conn, $Update);
}
if(isset($_POST['delete'])){
$Delete = "DELETE FROM events WHERE sno='$_POST[hidden]'";
mysqli_query($conn, $Delete);
}
$sql = "select * from events";
$result = mysqli_query($conn, $sql) or die("Bad Query: $sql");
echo"<a href = 'new_event.php' ><img src='new.png' style=' height:40px; width:40px; float:right; padding:5px; margin:5px;'></img></a>";
echo"<table border='1'>";
echo"<tr><td style = 'text-align:center;'>S.No</td><td style = 'text-align:center;'>Name</td><td style = 'text-align:center;'>Date</td><td colspan='3' style = 'text-align:center;'>Edit</td></tr>";
while($row = mysqli_fetch_assoc($result)) {
echo "<form action=events.php method=post>";
echo "<tr>";
echo "<td>" . "<input type=text name=sno value=" . $row['sno'] . " </td>";
echo "<td>" . "<input type=text name=name value=" . $row['name'] . " </td>";
echo "<td>" . "<input type=text name=date value=" . $row['date'] . " </td>";
//echo "<td>" . "<textarea rows=5 cols=10 id = event name=ldesp value=" . $row['ldesp'] . " </td>";
echo "<td>" . "<input type=hidden name=hidden value=" . $row['sno'] . " </td>";
echo '<td><a href="view_event.php?sno=' . $row['sno'] . '"><img src=edit.png style=height:40px;width:40px;></a></td>';
echo "<td>" . "<input type=submit class = button name=delete value=Delete" . " </td>";
echo "</tr>";
echo "</form>";
}
echo"</table>";
?>
<?php
include('footer.php');
?>