-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_normal.php
149 lines (115 loc) · 3.73 KB
/
search_normal.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
<?php
include("auth.php"); //include auth.php file on all secure pages ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="w3.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome Home</title>
</head>
<body >
<div class="w3-sidebar w3-bar-block w3-card w3-animate-left" style="display:none" id="mySidebar">
<button onclick="w3_close()" class="w3-bar-item w3-button w3-large">Close ×</button>
<a class="w3-bar-item w3-button" href="index.php">HOME</a>
<a class="w3-bar-item w3-button" href="dashboard.php">DASHBOARD</a>
<a class="w3-bar-item w3-button" href="logout.php">LOGOUT</a>
</div>
<div class="w3-container w3-animate-right" id="main">
<?php include 'header.php';?>
<br/>
<div class="w3-container" >
<div class="w3-card w3-padding-32 w3-padding-left-16 w3-padding-right-16 ">
<form method="POST" action="">
<input type="text" class="w3-input w3-border" placeholder="search with any details" name="key">
<br/>
<center><button class="w3-btn w3-blue" name="submit" >SEARCH</button></center>
</form>
</div>
<?php
include 'db.php';
$query='';
$count=1;
//$con = mysqli_connect("localhost", "root", "", "lib");
$output = '';
if(isset($_POST["submit"]))
{
$search = mysqli_real_escape_string($con, $_POST["key"]);
$query = "
SELECT * FROM lablog_table
WHERE student_name LIKE '%".$search."%'
OR student_pin LIKE '%".$search."%'
OR system_name LIKE '%".$search."%'
OR ip LIKE '%".$search."%'
OR reason LIKE '%".$search."%'
OR period_count LIKE '%".$search."%'
OR log_date LIKE '%".$search."%'
OR log_time LIKE '%".$search."%'
OR end_date LIKE '%".$search."%'
OR end_time LIKE '%".$search."%'
";
$result = mysqli_query( $con, $query);
if(mysqli_num_rows($result) > 0)
{
echo '<br/><table class="w3-table-all w3-responsive">
<tr class="w3-hover-grey w3-red">
<th>SI.NO</th>
<th>ID</th>
<th>STUDENT NAME</th>
<th >STUDENT PIN</th>
<th >SYSTEM NAME</th>
<th >IP</th>
<th >LAB</th>
<th >NO OF PERIODS</th>
<th >START DATE</th>
<th >START TIME</th>
<th >END DATE</th>
<th >END TIME</th>
</tr>';
while($row = mysqli_fetch_array($result))
{
//echo'?>
<tr class="w3-hover-grey ">
<td align="center"><?php echo $count; ?></td>
<td align="center"><?php echo $row["id"]; ?></td>
<td align="center"><?php echo $row["student_name"]; ?></td>
<td align="center"><?php echo $row["student_pin"]; ?></td>
<td align="center"><?php echo $row["system_name"]; ?></td>
<td align="center"><?php echo $row["ip"]; ?></td>
<td align="center"><?php echo $row["reason"]; ?></td>
<td align="center"><?php echo $row["period_count"]; ?></td>
<td align="center"><?php echo $row["log_date"]; ?></td>
<td align="center"><?php echo $row["log_time"]; ?></td>
<td align="center"><?php echo $row["end_date"]; ?></td>
<td align="center"><?php echo $row["end_time"]; ?></td>
</tr>
<?php
$count++;
//';
}
}
else
{
echo '<h1 class="w3-panel w3-green w3-round">NO DATA FOUND</h1>';
}
}
?>
</table>
<?php include 'footer.php';?>
</div>
<script>
function w3_open() {
document.getElementById("main").style.marginLeft = "25%";
document.getElementById("mySidebar").style.width = "25%";
document.getElementById("mySidebar").style.display = "block";
document.getElementById("openNav").style.display = 'none';
}
function w3_close() {
document.getElementById("main").style.marginLeft = "0%";
document.getElementById("mySidebar").style.display = "none";
document.getElementById("openNav").style.display = "inline-block";
}
</script>
</div>
</body>
</html>