-
Notifications
You must be signed in to change notification settings - Fork 1
/
search-new.php
216 lines (189 loc) · 7.47 KB
/
search-new.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
<?php
error_reporting(0);
include("config.php");
?>
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>IEDC Summit 2017 - Registration</title>
<link rel="stylesheet" href="css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/dataTables.bootstrap4.min.css">
<style>
BODY, TD {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
</style>
</head>
<body>
<div class="container">
<div class="row" id="first-container-normal">
<div class="col">
<br><br><br>
<h3>Check In</h3>
<br><br>
</div>
</div>
<div class="row" id="second-container">
<div class="col">
<a href="index.html" class="btn btn-light btn-block">Home</a>
</div>
<div class="col">
<a href="checkedlist.php" class="btn btn-light btn-block">Checked In List</a>
</div>
<div class="col">
<a href="register.php" class="btn btn-light btn-block">New Registration</a>
</div>
<div class="col">
<a href="activity-hub.php" class="btn btn-light btn-block">Activity Hub</a>
</div>
</div>
<hr>
<!-- Manual search starts here -->
<div class="row">
<!-- <div class="col">
<form id="form1" name="form1" method="post" action="search.php">
<div class="row">
<div class="col-2">
<label for="name" class="col-form-label">Name</label>
</div>
<div class="col-6">
<input type="text" class="form-control" id="name" placeholder="Name" name="name" value="<?php echo $_REQUEST['name']; ?>">
</div>
<div class="col-2">
<input type="submit" name="button" id="button" value="Find" class="btn btn-secondary"/>
</div>
<div class="col-2">
<a href="search.php" class="form-control"> Reset</a>
</div>
</div>
</form>
</div>
-->
<div class="col">
<form id="form1" name="form1" method="post" action="search.php">
<div class="row">
<div class="col-2">
<label for="inputEmail3" class="col-form-label">Select College</label>
</div>
<div class="col-8">
<select class="form-control" name="college">
<?php
$sql = "SELECT DISTINCT college FROM aisyc_delig order By college";
$sql_result = mysqli_query($connection,$sql) or die ('request "Could not execute SQL query" '.$sql);
if (mysqli_num_rows($sql_result)>0) {
while ($row = mysqli_fetch_assoc($sql_result)) {
echo "<option>".$row['college']."</option>";
}
}
?>
</select>
</div>
<div class="col-2">
<input type="submit" name="button" id="button" value="Find" class="btn btn-secondary"/>
</div>
<!-- <div class="col-2">
<a href="search.php" class="form-control"> Reset</a>
</div> -->
</div>
</form>
</div>
</div>
<br><br>
<!-- Manual search ends here -->
<!-- <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>College</th>
<th>Email</th>
<th>Contact</th>
<th>Check In</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>College</th>
<th>Email</th>
<th>Contact</th>
<th>Check In</th>
</tr>
</tfoot>
<tbody>
<?php
if ($_REQUEST["name"]<>'') {
$search_string = " AND name LIKE '%".$_REQUEST['name']."%'";
$sql = "SELECT * FROM " . $SETTINGS['data_table'] . " WHERE slno>0 AND status='confirmed'" . $search_string;
}
elseif ($_REQUEST["college"]<>'') {
$search_string = " AND college LIKE '%".$_REQUEST['college']."%'";
$sql = "SELECT * FROM " . $SETTINGS['data_table'] . " WHERE slno>0 AND status='confirmed'" . $search_string;
}
else
{
$sql = "SELECT * FROM " . $SETTINGS['data_table'] . " WHERE status='confirmed'";
}
$sql_result = mysqli_query($connection,$sql) or die ('request "Could not execute SQL query" '.$sql);
if (mysqli_num_rows($sql_result)>0) {
while ($row = mysqli_fetch_assoc($sql_result)) {
?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['college']; ?></td>
<td><form action='checkin.php'> <?php echo (empty($row['email']))?" <input style='width:150px;background-color: #FFFFE0;' class='form-control form-control-sm' type='text' name='email' value=''>" :$row['email']; ?></td>
<td><?php echo (empty($row['contact']))?" <input style='width:100px;background-color: #FFFFE0;' class='form-control form-control-sm' type='text' name='contact' value=''>" :$row['contact']; ?></td>
<td>
<?php
echo "<input type='hidden' name='id' value='".$row['slno']."'> <input type='checkbox' name='faculty' value='Faculty'>Faculty <input class='btn btn-info' type='submit'value='Check In'></form>";
?>
</td>
</tr>
<?php
}
} else {
?>
<tr><td colspan="5">No results found.</td>
<?php
}
?>
</tbody>
</table> -->
</div>
<!-- Script starts -->
<!-- <script src="js/jquery-3.2.1.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> -->
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- <script type="text/javascript" src="js/jquery.dataTables.min.js"></script> -->
<!-- <script type="text/javascript" src="js/dataTables.bootstrap4.min.js"></script> -->
<!-- <script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable( {
initComplete: function () {
this.api().columns([1]).every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
} );
</script> -->
<!-- Script ends -->
</body>
</html>