-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsection.php
More file actions
71 lines (62 loc) · 2.82 KB
/
section.php
File metadata and controls
71 lines (62 loc) · 2.82 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
67
68
69
70
71
<?php
include 'connect.php'; // Assuming you have already included the database connection file
if (isset($_POST['submit'])) {
$sectionName = $_POST['SectionName'];
$sectionDescription = $_POST['SectionDescription'];
$semester = $_POST['Semester'];
$courseID = $_POST['CourseID'];
$studentID = $_POST['StudentID'];
$professorID = $_POST['ProfessorID'];
$sql = "INSERT INTO section(SectionName, SectionDescription, Semester, CourseID, StudentID, ProfessorID) VALUES('$sectionName','$sectionDescription','$semester','$courseID','$studentID','$professorID')";
$result = mysqli_query($con, $sql);
if ($result) {
header('location:view_section.php');
} else {
die(mysqli_error($con));
}
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css">
<title>Section</title>
</head>
<body>
<div class="container my-5 ">
<form method="post">
<div class="form-group" autocomplete="off">
<label>Section Name</label>
<input type="text" class="form-control" placeholder="Enter Section Name" name="SectionName">
</div>
<div class="form-group" autocomplete="off">
<label>Section Description</label>
<input type="text" class="form-control" placeholder="Enter Section Description" name="SectionDescription">
</div>
<div class="form-group" autocomplete="off">
<label>Semester</label>
<input type="text" class="form-control" placeholder="Enter Semester" name="Semester">
</div>
<div class="form-group" autocomplete="off">
<label>Course ID</label>
<input type="text" class="form-control" placeholder="Enter Course ID" name="CourseID">
</div>
<div class="form-group" autocomplete="off">
<label>Student ID</label>
<input type="text" class="form-control" placeholder="Enter Student ID" name="StudentID">
</div>
<div class="form-group" autocomplete="off">
<label>Professor ID</label>
<input type="text" class="form-control" placeholder="Enter Professor ID" name="ProfessorID">
</div>
<button type="submit" class="btn btn-primary" name="submit">Submit</button>
</form>
<br>
<a href="view_section.php"><button type="submit" class="btn btn-primary" name="submit">View Existing Data</button></a>
</div>
</body>
</html>