-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_notice.php
More file actions
115 lines (99 loc) · 4.2 KB
/
edit_notice.php
File metadata and controls
115 lines (99 loc) · 4.2 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
include("connect.php");
$notice_id = $_REQUEST['notice_id'];
$query = "SELECT * from notice where notice_id='" . $notice_id . "'";
$result = mysqli_query($con, $query) or die(mysqli_error($con));
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>edit_admin</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<style>
body {
background-color: #000;
color: #ffffff;
}
.myform {
color: #ffffff;
margin: 100px 320px;
background-color: #000;
border-radius: 15px;
border: 1px solid white;
}
.myform h1 {
padding-bottom: 10px;
padding-top: 10px;
}
.myform label {
font-size: 20px;
font-weight: 600;
letter-spacing: 1px;
padding-left: 40px;
}
.tabledata {
padding-top: 10px;
padding-bottom: 20px;
padding-right: 70px;
}
#inputbox {
width: 110%;
}
.other-link a {
margin: 5px 30px;
text-decoration: none;
text-transform: uppercase;
padding: 13px 25px;
background-color: #198754;
color: white;
border-radius: 8px;
font-size: 19px;
transition: background-color 0.3s;
}
.other-link a:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="myform">
<?php
$status = "";
if (isset($_POST['new']) && $_POST['new'] == 1) {
$notice_id = $_REQUEST['notice_id'];
$date = $_REQUEST['date'];
$notice = $_REQUEST['notice'];
$update = "update notice set date='" . $date . "', notice='" . $notice . "' where notice_id='" . $notice_id . "'";
mysqli_query($con, $update) or die(mysqli_error($con));
$status = "notice Updated Successfully. </br></br>
<a href='noticeadmin_view.php'>View Updated notice</a>";
echo '<p style="color:#FF0000;">' . $status . '</p>';
} else {
?>
<div>
<form name="form" method="post" action="">
<input type="hidden" name="new" value="1" />
<h1 style="font-family: Algerian;" align="center">Update admin</h1>
<input name="notice_id" type="hidden" value="<?php echo $row["notice_id"]; ?>" />
<table>
<tr>
<td class="tabledata"><label for="date"> Date :</label></td>
<td class="tabledata"> <input type="text" name="date" placeholder="Enter date" required value="<?php echo $row['date']; ?>" /></td>
</tr>
<tr>
<td class="tabledata"><label for="notice"> Notice :</label></td>
<td class="tabledata"> <input type="text" name="notice" placeholder="Enter notice" required value="<?php echo $row['notice']; ?>" /></td>
</tr>
</table>
<p><input style=" margin:0px 30px; padding:10px 50px;" class="btn btn-lg btn-success" name="submit" type="submit" value="Update" />
<span class="other-link"> <a href="add_notice.php">click to add notice</a></span>
</p>
</form>
<?php } ?>
</div>
</div>
</body>
</html>