-
Notifications
You must be signed in to change notification settings - Fork 0
/
post_notice.php
103 lines (94 loc) · 2.09 KB
/
post_notice.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
94
95
96
97
98
99
100
101
102
103
<?php
session_start();
if(time()-$_SESSION["tim"]>60){
echo "<script>alert('Session timed out');";
echo "window.location.href='logout.php';</script>";
}
else{
$_SESSION["tim"]=time();
}
if(isset($_POST["notice"])){
$conn= mysqli_connect ("localhost","root","","testdb");
if(!$conn){
die("failed");
}
echo $_POST["notice"].date('yy-m-d h:i:s');
$query="Insert into notice(Notice,Date) values('".$_POST["notice"]."','".date('yy-m-d h:i:s')."');";
echo $query;
$t=mysqli_query($conn,$query);
if($t){
header("Location:admin_notice.php");
}
}
?>
<html>
<head>
<style>
body{
margin:0;
background-color: #c0c0c0;
}
.navigation{
width:15%;
height:100%;
position:fixed;
background-color:lightblue;
margin: 0;
}
.navigation button{
width:100%;
border:none;
display:inline-block;
padding:15px;
background-color:lightblue;
font-size: 20px;
font-weight: bolder;
}
.navigation button:hover{
background-color:black;
color:white;
}
.top{
margin-left:15%;
}
.round{
width:200px;
height:200px;
border-radius: 50%;
background-color: red;
background-image: url('admin.png');
}
.take-entry{
margin-left:18%;
}
.in{
resize:both;
width:500px;
height:400px;
margin:50px;
}
h1{
margin-left:18%;
}
</style>
</head>
<body>
<div class="navigation">
<div class="round">
</div>
<a href="dash.php"><button>Overview</button></a>
<a href="admin_doctor.php"><button>Doctor</button></a>
<a href="admin_patient.php"><button>Patient</button></a>
<a href="admin_notice.php"><button style="background-color:black;color:white;">Notice</button></a>
<a href="logout.php"><button>Sign Out</button></a>
</div>
<div class="top"><center><h2>NoticeBoard</h2></center><hr></div>
<h1> Type the notice below</h1>
<div class="take-entry">
<form action="post_notice.php" method="post">
<textarea placeholder="Notice here" name="notice" class="in">
</textarea>
<br>
<input type="submit" value="Post Notice" >
</form>
</div>