-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewFile.php
More file actions
165 lines (148 loc) · 4.52 KB
/
Copy pathviewFile.php
File metadata and controls
165 lines (148 loc) · 4.52 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
<?php
include "connection.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>list of files</title>
<!--<link rel="stylesheet" type="text/css" href="formUpload.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" >
<style type="text/css">
.srch
{
padding-left: 1000px;
}
.nav-header
{
background-color:#000;
}
.nav-header::after
{
content: " ";
clear: both;
display: block;
visibility: none;
}
.nav
{
max-width: 1200px;
margin: 0 auto;
padding: 0;
}
.nav-nav
{
float: right;
}
.my-logo
{
float: left;
}
.nav-nav ul li
{
display: inline-block;
}
.nav-nav ul li a
{
padding: 5px 20px;
text-decoration: none;
color: #fff;
line-height: 60px;
}
.nav-nav ul li a:hover
{
color: #3e99ff;
}
</style>
</head>
<body class="tic-tac">
<header class="nav-header">
<div class="nav">
<img src="image/VNDC logo.png" alt="company_logo" width="200em" class="my-logo" />
<nav class="nav-nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="login.html">Login</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</nav>
</div>
</header>
<!-- Search Bar -->
<div class="srch">
<form name="form1" method="POST" class="navbar-form">
<input type="text" class="form-control" name="search" placeholder="Search files..." required="" />
<button style="background-color: #6db5b984" type="submit" name="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"> </span>
</button>
<span style="padding-left: 150px;"><button type="button" class="btn btn-default"><a href="formUpload.php" style="text-decoration: none;">Back</a></button></span>
</form>
</div>
<h2>Saved files</h2>
<?php
if (isset($_POST['submit'])) {
$que=mysqli_query($database, "SELECT * FROM cache where householdNo like '%$_POST[search]%'");
if (mysqli_num_rows($que)==0) {
echo "Sorry file not found, Try again.";
}
else
{
echo "<table class='table table-bordered table-hover'>";
echo "<tr style='background-color:#91a70e';>";
//TABLE
echo "<th>"; echo "Household Number"; echo "</th>";
echo "<th>"; echo "Household Name"; echo "</th>";
echo "<th>"; echo "Community Volunteer"; echo "</th>";
echo "<th>"; echo "Community"; echo "</th>";
echo "<th>"; echo "Location Id"; echo "</th>";
echo "<th>"; echo "File Status"; echo "</th>";
echo "<th>"; echo "Edit"; echo "</th>";
echo "<th>"; echo "Delete"; echo "</th>";
echo "</tr>";
while($row=mysqli_fetch_assoc($que)){
echo "<tr>";
echo "<td>";echo $row['householdNo']; echo "</td>";
echo "<td>";echo $row['householdName'] ;echo "</td>";
echo "<td>";echo $row['communityVolunteer']; echo "</td>";
echo "<td>";echo $row['community']; echo "</td>";
echo "<td>";echo $row['locationId']; echo "</td>";
echo "<td>";echo $row['radiobuttons']; echo "</td>";
echo "<td>";echo "<a href='edit.php?edit=$row[householdNo]'>Edit</a>"; echo "</td>";
echo "<td>";echo "<span id='a'><a href='delete.php?del=$row[householdNo]'>Delete</a></span>"; echo "</td>";
echo "</tr>";
}
echo "</table>";
}
}
/* if button is not pressed*/
else
{
$res = mysqli_query($database, "SELECT * FROM `cache` ORDER BY `cache`.`householdNo` ASC");
echo "<table class='table table-bordered table-hover'>";
echo "<tr style='background-color:#91a70e';>";
//TABLE
echo "<th>"; echo "Household Number"; echo "</th>";
echo "<th>"; echo "Household Name"; echo "</th>";
echo "<th>"; echo "Community Volunteer"; echo "</th>";
echo "<th>"; echo "Community"; echo "</th>";
echo "<th>"; echo "Location Id"; echo "</th>";
echo "<th>"; echo "File Status"; echo "</th>";
echo "<th>"; echo "Edit"; echo "</th>";
echo "<th>"; echo "Delete"; echo "</th>";
echo "</tr>";
while($row=mysqli_fetch_assoc($res)){
echo "<tr>";
echo "<td>";echo $row['householdNo']; echo "</td>";
echo "<td>";echo $row['householdName'] ;echo "</td>";
echo "<td>";echo $row['communityVolunteer']; echo "</td>";
echo "<td>";echo $row['community']; echo "</td>";
echo "<td>";echo $row['locationId']; echo "</td>";
echo "<td>";echo $row['radiobuttons']; echo "</td>";
echo "<td>";echo "<a href='edit.php?edit=$row[householdNo]'> Edit</a>"; echo "</td>";
echo "<td>";echo "<span id='a'><a href='delete.php?del=$row[householdNo]'> Delete</a></span>"; echo "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
</body>
</html>