-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblockOfficerProcess.php
More file actions
27 lines (22 loc) · 884 Bytes
/
blockOfficerProcess.php
File metadata and controls
27 lines (22 loc) · 884 Bytes
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
<?php
require "connection.php";
if(isset($_GET["email"])){
$email = $_GET["email"];
$officerResultset = Database::search("SELECT * FROM `teacher` WHERE `email`='".$email."'");
$officerRownumber = $officerResultset->num_rows;
if($officerRownumber == 1){
$officerData = $officerResultset->fetch_assoc();
if( intval($officerData["block_status"]) == 1){
Database::insertUpdateDelete("UPDATE `teacher` SET `block_status`='2' WHERE `email`='".$email."'");
echo("officer blocked");
}else if(intval($officerData["block_status"]) == 2){
Database::insertUpdateDelete("UPDATE `teacher` SET `block_status`='1' WHERE `email`='".$email."'");
echo("officer unblocked");
}
}else{
echo("Something Went Wrong");
}
}else{
echo("Something Went Wrong");
}
?>