-
Notifications
You must be signed in to change notification settings - Fork 2
/
reg.php
199 lines (181 loc) · 6.94 KB
/
reg.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
<!DOCTYPE html>
<?php
session_start();
$_SESSION['searched_memID']='';
//importing pages
require 'connect.php';require 'function.php';
//access controlling
if(!isset($_SESSION["memID"]) || !isset($_SESSION["password"])){
header ("location:login.php");
}
if($_SESSION['memID']!="reg000"){
header ("location:login.php");
}
if(isset($_POST['search']) && isset($_POST['search_memID'])){
if(!seach_query()){
display_alerts("danger","reg.php","There is no account from this membershipID");
}
}
?>
<html>
<head><title>Hello, Registrar!</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body{
width:100%;
height:100%;
background-size:cover;
padding:15px;
}
#one{
width:100%;
height:100%;
background-size:cover;
}
</style>
</head>
<body>
<!-- navigation bar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Registrar</a>
</div>
<div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-tasks"></span> Options<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="change_password.php"><span class="glyphicon glyphicon-pushpin"></span> Change Password</a></li>
<li><a href="reg_advanced_signup.php"><span class="glyphicon glyphicon-plus"></span> Add Account</a></li>
<li><a href="add_event.php"><span class="glyphicon glyphicon-plus"></span> Add a Pic to Home</a></li>
<li><a href="login.php"><span class="glyphicon glyphicon-off"></span> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<br><br>
<!-- searching area -->
<div class='container'><br>
<div class='row'>
<div class='col-md-9'>
<div class='container'>
<div class="row">
<form action="reg.php" method="post">
<div class='col-md-4'>
<input class='form-control' type='text' name='search_name'>
</div>
<div class="col-md-2">
<input class="form-control" type="submit" name="searchN" value="Search by Name">
</div>
<div class='col-md-2'>
<input class='form-control' type='button' name='seeall' onclick="location.href='reg_all.php'" value='SEE ALL'>
</div>
</form>
</div>
<div class='row'>
<h2></h2>
<form action='reg.php' method='post'>
<div class='col-md-4'>
<input class='form-control' type='text' name='search_memID' value="<?php
if(isset($_SESSION['searched_memID'])){echo $_SESSION['searched_memID'];}?>">
</div>
<div class='col-md-2'>
<input class='form-control' type='submit' name='search' value='Search by ID'>
</div>
<!-- <div class='col-md-2'>
<input class='form-control' type='button' name='advanced_search' onclick="location.href='reg_advanced_search.php'" value='Advanced Search'>
</div> -->
</form>
</div>
<h2></h2>
<div class='row'>
<?php if(isset($_POST['search'])){echo "<h1>".seach_query()[0]."</h1><h1>".seach_query()[1]."</h1><h1>".seach_query()[2]."</h1>" ;}?>
</div>
</div>
</div>
<!-- notification area -->
<div class='col-md-3'>
<br>
<div class='panel-group'><div class='panel panel-info'><div class='panel-heading'>Notifications</div>
<div class='panel-body'><table><tr><td>
<a href="requests.php"><span class="glyphicon glyphicon-envelope"></span>unseen requests</a></td><td>
<span class="badge">
<?php
$requests1_query="SELECT COUNT(*) FROM signup_requests WHERE Accepted=false AND Recommendation1_Accept=true AND Recommendation2_Accept=true";
//$requests1_query="SELECT COUNT(*) FROM signup_requests WHERE Accepted=false";
notification($requests1_query);
?>
</span>
</td></tr><tr><td>
<a href="edit_requests.php"><span class="glyphicon glyphicon-envelope" ></span>unseen editing requests</a></td><td>
<span class="badge">
<?php
$requests2_query="SELECT COUNT(*) FROM edit_requests WHERE Seen=false";
notification($requests2_query);
?>
</span>
</td></tr>
</table>
</div></div></div></div></div></div>
<?php
$itr1=0;
if(isset($_POST['searchN'])){
$_SESSION['searched_memID']='';
echo "<div class='container'><table class='table table-striped'><thead><tr><th>MembershipID</th><th>Firstname</th><th>Lastname</th></tr></thead><tbody>";
$seach_by_name_query="SELECT * FROM `member_details` WHERE Firstname='".$_POST['search_name']."'";
if($is_seach_by_name_query_run=mysqli_query($connect,$seach_by_name_query)){
while($seach_by_name_query_execute=mysqli_fetch_assoc($is_seach_by_name_query_run)){
echo "<tr>";
echo "<td>".$seach_by_name_query_execute['MembershipID']."</td>";
echo "<td>".$seach_by_name_query_execute['Firstname']."</td>";
echo "<td>".$seach_by_name_query_execute['Lastname']."</td>";
if($seach_by_name_query_execute['Pic']!=NULL){
echo "<td><img src = '".$seach_by_name_query_execute['Pic']."' style = 'height:150px;width:150px'></td>";}
else{
echo "<td><img src = 'pics/default.png' style = 'height:150px;width:150px'></td>";}
echo "<td> <a href='advanced_direct.php?direct_searched_memID=".$seach_by_name_query_execute['MembershipID']."' >More</a></td>";
$itr1++;
echo "</tr>";
}
}
$seach_by_lname_query="SELECT * FROM `member_details` WHERE Lastname='".$_POST['search_name']."'";
if($is_seach_by_lname_query_run=mysqli_query($connect,$seach_by_lname_query)){
while($seach_by_lname_query_execute=mysqli_fetch_assoc($is_seach_by_lname_query_run)){
echo "<tr>";
echo "<td>".$seach_by_lname_query_execute['MembershipID']."</td>";
echo "<td>".$seach_by_lname_query_execute['Firstname']."</td>";
echo "<td>".$seach_by_lname_query_execute['Lastname']."</td>";
if($seach_by_lname_query_execute['Pic']!=NULL){
echo "<td><img src = '".$seach_by_lname_query_execute['Pic']."' style = 'height:150px;width:150px'></td>";}
else{
echo "<td><img src = 'pics/default.png' style = 'height:150px;width:150px'></td>";}
echo "<td> <a href='advanced_direct.php?direct_searched_memID=".$seach_by_name_query_execute['MembershipID']."' >More</a></td>";
$itr1++;
echo "</tr>";
}
}
echo "</table></div>";
}
?>
<script type="text/javascript">
$(document).ready(function () {
window.setTimeout(function() {
$(".alert").fadeTo(1500, 0).slideUp(500, function(){
$(this).remove();
});
}, 3000);
});
</script>
</body>
</html>