-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddClass.php
More file actions
63 lines (52 loc) · 2.02 KB
/
addClass.php
File metadata and controls
63 lines (52 loc) · 2.02 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
<!doctype html>
<html>
<head>
<title>Success</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<?php
session_start();
/* $destination = $_SESSION["destination"];
$dateListed = $_SESSION["dateListed"];
$weight = $_SESSION["weight"];
$origin = $_SESSION["origin"];
$rate=$_SESSION["rate"];
$clientID=$_SESSION['clientID'];//for integration with login page
$miles=$_SESSION['miles'];
$ratePerMile=($rate/$miles); */
$CRN=$_SESSION['CRN'];
echo "<a href='advising.php'>Back to Registration</a>";
$sid=$_SESSION['student_ID']; //for integration with login page
//$clientName="Pedros inconspicuous shipping crates"; //placeholder until login integration
require_once("db.php");
$sql = "insert into enrollments (CRN, student_ID) value ('$CRN','$sid')";
/*"insert into listing
( origin, destination, dateListed, weight, rate, state, CDL, dateFufilled, clientID, miles, ratePerMile, clientName)
values ('$origin', '$destination', '$dateListed', '$weight', '$rate','$state', '$CDL', '$dateFufilled', '$clientID', '$miles', '$ratePerMile', '$clientName')";
*/
$result=$mydb->query($sql);
if ($result==1) {
$sql2 = "select * from enrollments where CRN=$CRN";
$result=$mydb->query($sql2);
while($row = mysqli_fetch_array($result)){
echo "<p>The following enrollment has been added:</p></br>";
echo "<table>
<tr>
<th> CRN </th>
<th> Student ID </th>
</tr>
<tr>
<td>".$row['CRN']."</td>
<td>".$row['student_ID']."</td>
</tr>
</table>";
}
}
else
{
echo "an error occured, please try again and ensure that the data is valid.";
}
?>
</body>
</html>