-
Notifications
You must be signed in to change notification settings - Fork 0
/
deleteProject.php
41 lines (37 loc) · 1.01 KB
/
deleteProject.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
<?php
// The hashed password from the form
require $_SERVER['DOCUMENT_ROOT'].'/scripts/dbConnector.php';
include $_SERVER['DOCUMENT_ROOT'].'/scripts/functions.php';
sec_session_start();
$admin = 0;
if(login_check($db) == true) {
$admin = 1;
if ($_SESSION['admin'] == 1) {
$clientView = 0;
} else {
$clientView = 1;
}
}
if (isset($_GET['id']) && $_POST['type'] == 'booper') {
$sql = 'UPDATE projects SET enabled = ? WHERE id = ?';
$stmt = $db->prepare($sql);
$enableTime = 0;
$updateId = $_GET['id'];
$stmt->bind_param('ii', $enableTime, $updateId);
$stmt->execute();
$status = 'Success';
$message = 'yay';
} else {
$status = 'failed';
$message = 'Failure';
}
$data = array(
'status' => $status,
'message' => $message,
'finished' => $finished,
'admin' => $admin,
'clientView' => $clientView
);
echo json_encode($data);
exit;
?>