-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminStatusFunctions.php
53 lines (41 loc) · 1.33 KB
/
AdminStatusFunctions.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
<?php
require_once('mysqli_connect.php');
$dbc = @mysqli_connect(db_host,db_user,db_password,db_database) OR die('Could not Connect to mySQL' . mysqli_connect_error());
session_start();
if($_REQUEST["active"]=="1")
{
$query="update users set status = 0 where student_id ='".$_REQUEST["student_id"]."'";
echo $query;
@mysqli_query($dbc,$query);
mysql_close();
}
elseif($_REQUEST["reactivate"]=="2")
{
$expire=date( strtotime("+30 days"));
$query="update users set Expire_Time='".$expire."'where student_id ='".$_REQUEST["student_id"]."'";
echo $query;
@mysqli_query($dbc,$query);
mysql_close();
}else
{
$expire=date( strtotime("+90 days"));
$query="update users set Expire_Time='".$expire."'where student_id ='".$_REQUEST["student_id"]."'";
echo $query;
@mysqli_query($dbc,$query);
mysql_close();
}
if($_REQUEST["AdminNo"]=="1"){
$query="update users set admin = 1 where student_id ='".$_REQUEST["student_id"]."'";
echo $query;
@mysqli_query($dbc,$query);
mysql_close();
}elseif($_REQUEST["AdminYes"]=="1"){
$query="update users set admin = 0 where student_id ='".$_REQUEST["student_id"]."'";
echo $query;
@mysqli_query($dbc,$query);
mysql_close();
}
?>
<html>
<meta http-equiv="refresh" content="0; url=AdminManagement.php" />
</html>