-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
87 lines (70 loc) · 3.07 KB
/
Copy pathindex.html
File metadata and controls
87 lines (70 loc) · 3.07 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!-- Include Header -->
<?php include 'sources/php/head.php';?>
<body>
<!-- Designed by Dylan Modesitt -->
<section id="hero">
<div class="container">
<div class="row col-xs-12">
<div class="page-header">
<<<<<<< HEAD:index.html
<h1>Course Options <small>Sacred Heart Prep</small></h1>
=======
<h1>Course Options <small>SHP</small></h1>
>>>>>>> origin/master:index.php
</div>
</div>
</div>
</section><!-- /#hero -->
<section id="content">
<div class="container">
<div class="row col-xs-12">
<div class="blurb">
<p>
This is a devoper system in alpha. A student will select the highest or most current course that they have taken so far. More detailed information will follow too: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacinia mi et blandit aliquam. Aliquam porta maximus nunc quis iaculis. Nam lacinia nunc vitae vehicula dignissim. Maecenas ac mi velit. Suspendisse sed fringilla nisi, sit amet venenatis felis. Etiam malesuada tempor mauris, a ornare nulla commodo ut. Quisque iaculis iaculis vulputate. Aliquam varius ligula eget pellentesque pharetra. Praesent vitae fermentum est.
<br><br></p>
</div>
<form action="./courseOptions.php" method="POST" class="form-horizontal col-xs-12">
<?php
include 'sources/php/model.php';
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// get a query of all the deparments
$departmentQuery = "SELECT department_name FROM department ORDER BY department_name";
$departmentResult = $conn->query($departmentQuery);
// add a selector for every course in that department
$i = 0;
while($departmentRow = $departmentResult->fetch_assoc()) {
$departmentName = $departmentRow['department_name'];
echo"<div class='form-group'>";
echo "<label for='department$i' class='control-label'>".$departmentName.": </label>";
echo "<select id='department$i' class='form-control' name='".str_replace(' ', '',$departmentName)."'>";
$coursesQuery = "SELECT course_name, department, sub_department FROM course WHERE department='".$departmentName."' ORDER BY sub_department, course_index ASC";
$coursesResult = $conn->query($coursesQuery);
echo "<option value='none'>None</option>";
while($coureseRow = $coursesResult->fetch_assoc()) {
echo "<option value='".$coureseRow['course_name']."'>".$coureseRow['course_name']."</option>";
}
echo "</select>";
echo"</div>";
$i++;
}
$conn->close();
?>
<div class="form-group">
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</section><!-- /#content -->
<!-- Javascript files -->
<!-- Javascript Libraries -->
<script src="sources/js/modernizr.custom.js"></script>
<!-- Javascript Custom -->
<script src="sources/js/the.js"></script>
</body>
</html>