-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintranet2.php
247 lines (195 loc) · 9.52 KB
/
intranet2.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<img src="images/123.png"class="img-rounded" width="300" height="130"/>
<style>.img-rounded</style>
<!-- CSS -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
<!--<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">-->
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/form-elements.css">
<link rel="stylesheet" href="assets/css/style.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
<title>Management</title>
</head>
<body>
<?php
$servername = "127.0.0.1";
$username = "root";
$password = "";
$dbname = "academycity";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
<div class ="top-content">
<div class ="inner-bg" style = "padding: 12px 100px 100px 100px;">
<div class ="row">
<div class ="description">
<p>
<h1 style = "font : normal 25px/25px Georgia, sans-serif; color : white ;">Web Defacement Monitoring Tool</h1>
</p>
</div>
</div>
<div class ="container">
<div class="row">
<div class="col-sm-5">
<div class="form-box">
<div class="form-top">
<div class = "form-top-left">
<h3>Admin Management</h3>
</div>
<div class="form-top-right">
<i class="fa fa-info-circle"></i>
<a href="/WDMS/Update.php"><i class="fa fa-refresh"></i></a>
</div>
<div class="">
<form class = "form-control">
</form >
<form name="view" action="intranet2.php" method="POST">
<div class = "styled-select blue semi-square" style = "">
<select name="email" class = "textarea form-control">
<option value="default">Default</option>
<?php
$conn2 = new mysqli($servername, $username, $password, $dbname);
$query2 ="SELECT user_email FROM USERS";
$result = mysqli_query($conn2,$query2);
while (@$row = mysqli_fetch_row($result)){
echo "<option value =". $row[0] .">" . $row[0] . "</option>";
}
?>
</select><br>
<br>
</div>
<!--<button type="submit" name="btnView" value="View" class = "btn">-->
<button type="submit" name="btnView" class="btn" "padding: 5px 500px 2px 500px;">View</button><br/>
</form>
</div>
</div>
<div class="form-bottom">
<form name="login" action="/WDMS/API/Logout" class="login-form" method="POST">
<table style = "border: inset 1px black; width: 100%" class="table">
<thead>
<tr style = "color: #00bfff ; width: 100%; font-weight: 200%" class = "">
<th>Authorised Personnel</th>
<th>File Name</th>
<th>Domain Name</th>
<th>File Status</th>
<th>Action</th>
</tr>
<script>
// put your code here
/********************************************************
* Utility functions for datatable column display *
********************************************************/
function getColour(val)
{
// Do not draw the rectangle if indicator does not have a tlp marking/tag
if(val != "red" && val != "green" && val != "white" && val != "amber") return "";
var svg1 = "<svg width=\"20\" height=\"20\"><circle cx=\"10\" cy=\"10\" r=\"9\" width=\"35\" height=\"26\" style=\'fill:";
var svg2 = ";\stroke:black;stroke-width:1.2;opacity:0.6\'></circle></svg>"
if(val.toLowerCase() == "amber") return svg1 + "yellow" + svg2;
else
return svg1 + val + svg2;
}
var table = $(".table");
var $tr = $("tr").append(
$("<td>").html(getColour("green"))
);
$tr.appendTo(".table > tbody");
</script>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
//something posted
if (isset($_POST['btnView'])) {
// btnView
$conn2 = new mysqli($servername, $username, $password, $dbname);
$query2 ="SELECT * FROM USERFILE WHERE user_email = '". $_POST['email']."'";
$result = mysqli_query($conn2,$query2);
while (@$row = mysqli_fetch_row($result)){
//var_dump($row[2])."\r\n";
//taking data from database to views the form table
$FileID=$row[0];
//$colour=$row[11];
echo "<tr class ='' style = 'color : #f5f4c4 ;font-size: 14px;' >";
echo"<th>";
echo $row[3];
echo"</th><th>";
echo $row[1];
echo"</th><th>";
echo $row[11];
echo"</th><th>";
echo $row[4];
echo"</th><th>";
echo"<a href=moreinfo.php?UserFileID=$FileID>More Info</a>";
echo "</th></tr>";
}
}
}
?>
</thead>
</tbody>
</table>
</form>
<form action="">
<div class = "styled-select blue semi-square" style = "">
<select name="ip_address" class = "textarea form-control">
<option value="default">Default</option>
<?php
$conn2 = new mysqli($servername, $username, $password, $dbname);
$query2 ="SELECT ip_address FROM USERFILE WHERE user_email = '". $_POST['email']."'";
$result = mysqli_query($conn2,$query2);
while (@$row = mysqli_fetch_row($result)){
echo "<option value =". $row[0] .">" . $row[0] . "</option>";
}
?>
</select><br>
<br>
</div>
<button type="submit" name="btnView" class="btn" "padding: 5px 500px 2px 500px;">Delete</button><br/>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<form action="146.64.213.31/WDMS/Bokang/API/Logout" method="POST">
<button type="submit" class="btn" style = "padding: 5px 100px 2px 100px;">Log Out</button>
</form>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="footer-border"></div>
<p>By CSIR VACWORK STUDENTS at <a href="http://defsec.csir.co.za/" target="_blank"><strong>CCIW UNIT</strong></a>
<i class="fa fa-smile-o"></i></p>
</div>
</div>
</div>
</footer>
<!-- Javascript -->
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.backstretch.min.js"></script>
<script src="assets/js/scripts.js"></script>
</body>
</html>