-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapproveTechRequests.php
More file actions
executable file
·37 lines (31 loc) · 1021 Bytes
/
approveTechRequests.php
File metadata and controls
executable file
·37 lines (31 loc) · 1021 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
28
29
30
31
32
33
34
35
36
37
<?php
include('functions.php');
$id = $_GET['id'];
$query = "SELECT * FROM `technician` WHERE `id` = '$id';";
if(count(fetchAll($query)) > 0){
foreach(fetchAll($query) as $row){
$techusername = $row['techusername'];
$phone = $row['phone'];
$email = $row['email'];
$location = $row['location'];
$profession = $row['profession'];
$hashed_password = $row['password'];
$date = $row['date'];
$query = "INSERT INTO `techaccounts` (`id`, `techusername`, `phone`, `email`, `location`, `profession`, `password`, `date`) VALUES (NULL, '$techusername', $phone, '$email', '$location', '$profession', '$hashed_password', '$date');";
}
if(performQuery($query)){
echo "Account Approval Was Successful";
}else{
echo "An error has occured";
}
$query = "DELETE FROM `technician` WHERE `technician`.`id` = '$id';";
if(performQuery($query)){
echo "Account Approval Was Successful";
}else{
echo "An error has occured";
}
}else{
echo "An Error Occured";
}
?>
<a href="pendingTechRequests.php">Back</a>