-
Notifications
You must be signed in to change notification settings - Fork 8
/
ajaxsetup.php
158 lines (137 loc) · 2.48 KB
/
ajaxsetup.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
<?php
include("sqlcon.php");
if(isset($_GET['p']))
{
if(isset($_SESSION['type']))
{
if($_SESSION['type'] == "alumni")
{
$user = $_SESSION[uid];
$rs = mysqli_query($con, "Select * from tbluser where upass=".$_GET['p']." and userid=$user");
if(mysqli_num_rows($rs) > 0)
{
echo "success";
}
else
{
echo "error";
}
}
if($_SESSION['type'] == "staff")
{
$user = $_SESSION[uid];
$rs = mysqli_query($con, "Select * from tblstaff where staff_pass=".$_GET['p']." and staffid=$user");
if(mysqli_num_rows($rs) > 0)
{
echo "success";
}
else
{
echo "error";
}
}
if($_SESSION['type'] == "admin")
{
$user = $_SESSION[uid];
$rs = mysqli_query($con, "Select * from tbladmin where apassword=".$_GET['p']." and adminid=$user");
if(mysqli_num_rows($rs) > 0)
{
echo "success";
}
else
{
echo "error";
}
}
}
}
if(isset($_GET[locid]))
{
$user = $_GET[locid];
$rs = mysqli_query($con, "Select * from tbluser where status=Active and location=".$user);
echo "<option value=0>-- Select --</option>";
while($row = mysqli_fetch_array($rs))
{
echo "<option value=$row[0]>".$row[2]."</option>";
}
}
if(isset($_GET[useremail]))
{
$mail = $_GET[useremail];
$rs = mysqli_query($con, "select * from tbluser where emailid=".$mail."");
if(mysqli_num_rows($rs) > 0)
{
echo "error";
}
else
{
echo "success";
}
}
if(isset($_GET[staffemail]))
{
$mail = $_GET[staffemail];
$rs = mysqli_query($con, "select * from tblstaff where emailid=".$mail."");
if(mysqli_num_rows($rs) > 0)
{
echo "error";
}
else
{
echo "success";
}
}
if(isset($_GET[adminemail]))
{
$mail = $_GET[adminemail];
$rs = mysqli_query($con, "select * from tbladmin where emailid=".$mail."");
if(mysqli_num_rows($rs) > 0)
{
echo "error";
}
else
{
echo "success";
}
}
if(isset($_GET[date]))
{
$today = strtotime(date("Y-m-d"));
$expiration_date = strtotime($_GET[date]);
if ($expiration_date < $today) {
echo "error";
}
else
echo "";
}
if(isset($_GET[passdate]))
{
$d1 = new DateTime($_GET[passdate].-06-01);
$d2 = new DateTime($_GET[dob]);
$diff = $d2->diff($d1);
$age = $diff->y;
if($age < 18)
{
echo "error";
}
else
{
echo "";
}
}
if(isset($_GET[doj]))
{
$d1 = new DateTime($_GET[doj]);
$d2 = new DateTime($_GET[sdob]);
$diff = $d2->diff($d1);
$age = $diff->y;
if($age < 24)
{
echo "error";
}
else
{
echo "";
}
}
/* ### */ ?>