-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe2_psc_page.php
More file actions
190 lines (150 loc) · 5.34 KB
/
e2_psc_page.php
File metadata and controls
190 lines (150 loc) · 5.34 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
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
<?php
session_start();
if (isset($_SESSION['user'])) {
if ((time() - $_SESSION['last_time']) > 1200) {
header("location:logout.php");
}else{
$_SESSION['last_time'] = time();
}
}else{
header("Location:Index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
tr:nth-child(even){
background-color: #f2f2f2;
}
tr:hover{
background-color: #333;
color: #fff;
border: 1px solid #fff;
}
table a, table a:visited{
width: 100%;
height: 100%;
background: #fff;
color: #000;
}
table a:hover{
color: #fff;
}
</style>
<title>EDP&RD File Monitoring System</title>
<style type="text/css">
</style>
</head>
<body style="text-align: center;">
<img src="images/arms.jpg">
<p id="republic">THE REPUBLIC OF UGANDA</p>
<h1>EDP&RD FILE MONITORING SYSTEM</h1>
<h2>MINISTRY OF FINANCE, PLANNING AND ECONOMIC DEVELOPMENT</h2>
<h2>ECONOMIC DEVELOPMENT POLICY AND RESEARCH DEPARTMENT (EDP&RD)</h2>
<?php
include ("hor_nav_e2_psc.php");
if ($_SESSION['user'] == true) {
echo "<i>You are logged in as "."<label style='text-decoration: underline;'><b>".$_SESSION['user']."</b></label></i>";
}else{
header("Location:Index.php");
}
?>
<br><br>
<?php
$search_item = "";
function test_input($keepData) {
$keepData = trim($keepData);
$keepData = stripslashes($keepData);
$keepData = htmlspecialchars($keepData);
//$keepData = basename($keepData);
return $keepData;
}
if (isset($_POST['btnsearch'])) {
$valueToSearch = $_POST['valueToSearch'];
$search_term =mysqli_real_escape_string($dbConnect, $_POST['valueToSearch']);
$query = "SELECT * FROM `e2_psc_edpr` WHERE CONCAT(`serialno`, `refno`, `file_origin`, `subject`, `sender`, `receiver`, `action`, `due_days`, `forward`, `date_sent`, `status`, `delete_file`) LIKE '%".$search_term."%'";
$search_result = filterTable($query);
$search_item = test_input($_POST['valueToSearch']);
}
else{
$query = "SELECT * FROM e2_psc_edpr";
$search_result = filterTable($query);
}
$query = mysqli_query($dbConnect, $query) or die(mysqli_error($dbConnect));
function filterTable($query){
$dbConnect = mysqli_connect('localhost', 'root', 'ak_94*jmv', 'edpr');
$filter_result = mysqli_query($dbConnect, $query);
return $filter_result;
}
?>
<form name="search_box" action="" method="POST">
<input type="text" value="<?php echo $search_item ?>" placeholder="Search for the file.." name="valueToSearch" id="searchedValue" style="width: 220px; height: 25px;"/>
<input type="submit" style="width: 100px; height: 30px;" name="btnsearch" value="Search" />
<input type="submit" style="width: 100px; height: 30px;" name="btnreset" value="Refresh" />
</form>
<!--<div id='d1'></div>
<script type="text/javascript">
function searchValue(){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","search_assign.php?nm="+document.getElementById("searchedValue").value,false);
xmlhttp.send(null);
document.getElementById('d1').innerHTML=xmlhttp.responseText;
}
</script>-->
<section style="">
<table cellpadding="10" border="1" style="border: 3px solid #ddd; border-collapse: collapse; overflow: hidden; overflow-y: scroll; text-align: left; width: 1500px; font-family: 'Trebuchet MS', 'Arial', 'Helvetica', sans-serif;" align="center">
<!--<a href="Main_Page.php" style="color: blue;">Go To Home</a>-->
<tr style="background: #4CAF50; color: #fff; height: 50px; font-size: 20px; text-align: center;">
<th>Serial No.</th>
<th>Ref No</th>
<th>File Origin</th>
<th>Subject</th>
<th>From</th>
<th>To</th>
<th>Action</th>
<th>Due Days</th>
<th>Forward</th>
<th>Date sent</th>
<th>Status</th>
<th>Delete File</th>
</tr>
<?php
while($row1=mysqli_fetch_array($query)):;?>
<tr>
<td style="height: 40px;"><?php echo $row1[0];?></td>
<td><?php echo $row1[1];?></td>
<td><?php echo $row1[2];?></td>
<td><?php echo $row1[3];?></td>
<td style="text-align: center;"><?php echo $row1[4];?></td>
<td><?php echo $row1[5];?></td>
<td style="text-align: center;"><?php echo $row1[6];?></td>
<?php
if ($row1[7] == 'none') {?>
<td style="text-align: center;"><?php echo $row1[7];?>
<?php }
else{
?>
<td style="text-align: center;"><?php echo $row1[7];?> | <a href="view_countdown_e2_psc.php?countdownId=<?php echo $row1[0];?>" style="color: blue; text-decoration: none;"><i>View</i></a>
<?php }?>
</td>
<td><a href="activity_e2_psc.php?searchId=<?php echo $row1[0];?>" style="color: blue; text-decoration: none;"><?php echo $row1[8];?></a></td>
<td><?php echo $row1[9];?></td>
<?php
if ($row1[10] == 'Done') {?>
<td><?php echo $row1[10];?> | <a href="update_assign_e2_psc.php?updateId=<?php echo $row1[0];?>" style="color: blue; text-decoration: none;"><i>Update </i></td>
<?php }?>
<?php
if($row1[10] == 'Pending'){?>
<td><b><label style="color: red"><?php echo $row1[10];?></label></b> | <a href="update_assign_e2_psc.php?updateId=<?php echo $row1[0];?>" style="color: blue; text-decoration: none;"><i>Update</i></a></td>
<?php }?>
<td><a href="e2_psc_delete.php?searchId=<?php echo $row1[0];?>" style="color: blue; text-decoration: none;"><?php echo $row1[11];?></a></td>
</tr>
<?php endwhile;?>
<?php mysqli_close($dbConnect);?>
</table>
<?php
?>
</section>
</body>
</html>