/
newmsg.php
122 lines (106 loc) · 2.03 KB
/
newmsg.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<style>
ul{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li{
float: left;
}
li a{
display: block;
color: white;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #ddd;
}
li a:hover:not(.active) {
background-color: #ddd;
}
.active {
background-color: #CD5C5C;
}
.container {
position: relative;
text-align: center;
color: white;
}
.centered {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
button a{
display: block;
color: white;
padding: 7px 7px;
text-decoration: none;
}
.button {
background-color: #333;
color: white;
border: 2px solid #555555;
}
.button:hover {
background-color: #ddd;
color: white;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #333;
color: white;
text-align: center;
}
form {
text-align: center;
margin:auto;
width:40%;
background-color:gray;
}
</style>
<?php
session_start();
if(isset($_SESSION["valid"]) && $_SESSION["valid"]=="yes"){
?>
<center><h2>Welcome Dear <?php echo $_SESSION["utype"]; ?> Office Admin!</h2></center>
<hr></br>
<ul>
<li><a href="logout.php">Logout</a></li>
</ul></br>
<form class="fsize" action="msgsend.php" method="post"><pre>
<h2> Write A New Message!</h2>
<input type="hidden" name="msgid" value="" />
<b>Enter The Recipient Username:</b>
<input type="text" name="receiver" value="" />
<b>Your Message:</b>
<textarea name="msgbody" rows="4" cols="50" value="">
</textarea>
<input type="submit" name="msgsub" value="Send" />
</pre>
</form></centered>
<script>
function goBack() {
window.history.back();
}
</script>
</br>
<button class="button" style="position:centered" onclick="goBack()">Go Back</button></br>
<div class="footer">
Website originally developed!
</div>
<br><br>
<?php
}
else{
header("Location:logout.php");
//echo "<script>alert('Suspicious Login Attempt!');</script>";
}
?>