-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
49 lines (45 loc) · 1.36 KB
/
Copy pathedit.php
File metadata and controls
49 lines (45 loc) · 1.36 KB
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
<!--
// Unit/Assignment: COS10032 Comp Systems Project Assignment 3
// Author: Nicole Reichert
// Name : edit.php
// Description: This is the edit PHP file that can parse a POST or GET response from manage.php.
// the POST calls out to the database to change the enum of Status, and the GET has an unimplemented display
// of all the users data in the table (according to PrimaryKey eoi_id).
-->
<!DOCTYPE html>
<html lang='en'>
<?php
// NICOLE REICHERT
// ERROR REPORTING FOR DEBUGGING
error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'settings.php';
include 'manage.inc.php';
include 'menu.inc.php';
include 'functionsite.php';
draw_headerhtml("Edit User");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$status = test_input($_POST['status']);
$id = test_input($_POST['id']);
if (empty($id) || empty($status)) {
header('Location: manage.php');
}
$result = $conn->query("UPDATE `eoi` SET `status` = '$status' WHERE eoi_id = '$id'");
//update_user_status($status);
if ($result = True){
echo "Updated Successfully";
}
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$id = $_GET['id'];
$result = $conn->query("SELECT * FROM `eoi` WHERE eoi_id = '$id'");
//TODO: Could make this a place where a form can update a user
print_single_eoi($result);
}
?>
<body>
<main>
</main>
<?php draw_footerhtml(); ?>
</body>
</html>