-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinsert_admin_info.php
More file actions
66 lines (52 loc) · 1.87 KB
/
insert_admin_info.php
File metadata and controls
66 lines (52 loc) · 1.87 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include('database.php');
$user = "";
$enrollmentStatus = "";
$gradeAccepted = "";
$yearAccepted = "";
$grantStatus = "";
$health = "";
$disability = "";
$ell = "";
$additionalInfo = "";
if (!empty($_POST["user"])) {
$user = $_POST["user"];
}
if (!empty($_POST["enrollmentStatus"])) {
$enrollmentStatus = "\"" . $_POST["enrollmentStatus"] . "\"";
}
if (!empty($_POST["gradeAccepted"])) {
$gradeAccepted = $_POST["gradeAccepted"];
}
if (!empty($_POST["yearAccepted"])) {
$yearAccepted = $_POST["yearAccepted"];
}
if (!empty($_POST["grantName"])) {
$grantStatus = "\"" . $_POST["grantName"] . "\"";
} else {
$grantStatus = "NULL";
}
if (!empty($_POST["health"])) {
$health = "\"" . $_POST["health"] . "\"";
}
if (!empty($_POST["disability"])) {
$disability = "\"" . $_POST["disability"] . "\"";
}
if (!empty($_POST["ell"])) {
$ell = $_POST["ell"];
}
if (!empty($_POST["additionalInfo"])) {
$additionalInfo = "\"" . $_POST["additionalInfo"] . "\"";
}
$stmt = "INSERT INTO ADMIN_USER_INFO (ID, Year_Accepted, Grade_Accepted, Enrollment_Status, Grant_Status, Disability, Health," .
"ELL, Additional_Info) VALUES ( $user,$yearAccepted ,$gradeAccepted,$enrollmentStatus,$grantStatus,$disability,$health,$ell," .
"$additionalInfo ) ON DUPLICATE KEY UPDATE year_accepted = $yearAccepted, grade_accepted = $gradeAccepted," .
"enrollment_Status = $enrollmentStatus, grant_status = $grantStatus, disability = $disability, health = $health, ell = $ell;";
if ($conn->query($stmt) === TRUE) {
header('Location: index.php');
//echo $stmt;
} else {
echo "Error: " . $stmt . "<br>" . $conn->error;
header('Location: error.php');
}
?>