-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaveEnrollment.php
30 lines (25 loc) · 1018 Bytes
/
saveEnrollment.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
<?php
require('db.php');
if(isset($_POST['ID']) && isset($_POST['Facility']) && isset($_POST['startDate']))
{
$id = $_REQUEST['ID'];
$startDate =$_REQUEST['startDate'];
$level=$_REQUEST['level'];
$facility = $_REQUEST['Facility'];
if (isset($_POST['current'])){
$insertStudent = "INSERT INTO gdc353_1.Student (PersonID, startDate, Level, Facility)
VALUES (".$id.", '".$startDate."','".$level."','".$facility."')";
}
else {
$endDate = $_REQUEST['endDate'];
$insertStudent = "INSERT INTO gdc353_1.Student (PersonID, startDate, Level, Facility, endDate)
VALUES (".$id.", '".$startDate."','".$level."','".$facility."','".$endDate."')";
}
$result = mysqli_query($conn, $insertStudent) or die ( mysqli_error($conn));
header("Location: editStudent.php?id=".$id);
exit("Success");
}
else {
exit("Missing information");
}
?>