-
Notifications
You must be signed in to change notification settings - Fork 0
/
courselist.php
executable file
·248 lines (220 loc) · 6.25 KB
/
courselist.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html>
<head>
<title>IIT Student Assist || Home</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" type="text/css" href="styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="demo.css" media="all" />
<!-- jQuery lib from google server ===================== -->
<script src="js/jquery-1.7.2.min.js"></script>
<?php
include("auth.php"); //include auth.php file on all secure pages ?>
<?php
$db_host = 'localhost'; // Server Name
$db_user = 'root'; // Username
$db_pass = ''; // Password
$db_name = 'se'; // Database Name
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if (!$conn) {
die ('Failed to connect to MySQL: ' . mysqli_connect_error());
}
$sql = 'SELECT *
FROM courselist';
$query = mysqli_query($conn, $sql);
if (!$query) {
die ('SQL Error: ' . mysqli_error($conn));
}
?>
<!-- javaScript -->
<script>
<!-- // building select nav for mobile width only -->
$(function(){
// building select menu
$('<select />').appendTo('nav');
// building an option for select menu
$('<option />', {
'selected': 'selected',
'value' : '',
'text': 'Choise Page...'
}).appendTo('nav select');
$('nav ul li a').each(function(){
var target = $(this);
$('<option />', {
'value' : target.attr('href'),
'text': target.text()
}).appendTo('nav select');
});
// on clicking on link
$('nav select').on('change',function(){
window.location = $(this).find('option:selected').val();
});
});
// show and hide sub menu
$(function(){
$('nav ul li').hover(
function () {
//show its submenu
$('ul', this).slideDown(150);
},
function () {
//hide its submenu
$('ul', this).slideUp(150);
}
);
});
//end
</script>
<!-- end -->
<style type="text/css">
body {
font-size: 15px;
color: #343d44;
font-family: "segoe-ui", "open-sans", tahoma, arial;
padding: 0;
margin: 0;
}
table {
margin: auto;
font-family: "Lucida Sans Unicode", "Lucida Grande", "Segoe Ui";
font-size: 12px;
}
h1 {
margin: 25px auto 0;
text-align: center;
text-transform: uppercase;
font-size: 17px;
}
table td {
transition: all .5s;
}
/* Table */
.data-table {
border-collapse: collapse;
font-size: 14px;
min-width: 537px;
}
.data-table th,
.data-table td {
border: 1px solid #e1edff;
padding: 7px 17px;
}
.data-table caption {
margin: 7px;
}
/* Table Header */
.data-table thead th {
background-color: #508abb;
color: #FFFFFF;
border-color: #6ea1cc !important;
text-transform: uppercase;
}
/* Table Body */
.data-table tbody td {
color: #353535;
}
.data-table tbody td:first-child,
.data-table tbody td:nth-child(4),
.data-table tbody td:last-child {
text-align: right;
}
.data-table tbody tr:nth-child(odd) td {
background-color: #f4fbff;
}
.data-table tbody tr:hover td {
background-color: #ffffa2;
border-color: #ffff0f;
}
/* Table Footer */
.data-table tfoot th {
background-color: #e5f5ff;
text-align: right;
}
.data-table tfoot th:first-child {
text-align: left;
}
.data-table tbody td:empty
{
background-color: #ffcccc;
}
</style>
</head>
<body>
<div class="container">
<header>
<div id="fdw">
<!--nav-->
<nav>
<ul>
<li class="current"><a href="index.php">ACADEMICS<span class="arrow"></span></a>
<ul style="display: none;" class="sub_menu">
<li class="arrow_top"></li>
<li><a class="subCurrent" href="coursegpa.php">Current Grades</a></li>
<li><a href="calc.php">GPA Calculator</a></li>
<li><a href="coursescheduler.php">Class Schedule</a></li>
<li><a href="courselist.php">Courses List</a></li>
<li><a href="https://web.iit.edu/registrar/academic-calendar">Academic Calender</a></li>
</ul>
</li>
<li class="current"><a href="index.php">SOCIAL<span class="arrow"></span></a>
<ul style="display: none;" class="sub_menu">
<li class="arrow_top"></li>
<li><a class="subCurrent" href="https://web.iit.edu/campus-life/events">Events</a></li>
<li><a href="http://www.illinoistechathletics.com/landing/index">Atheletics</a></li>
<li><a href="https://hawklink.iit.edu/Organizations">Social Groups</a></li>
<li><a href="https://iit.edu/news/iittoday/?cat=3">University News</a></li>
</ul>
</li>
<li class="current"><a href="index.php">Food $ Dining<span class="arrow"></span></a>
<ul style="display: none;" class="sub_menu">
<li class="arrow_top"></li>
<li><a class="subCurrent" href="https://iit.sodexomyway.com">On Campus Dining</a></li>
<li><a href="https://web.iit.edu/housing/nearby-restaurants">Nearby Restaurants</a></li>
</ul>
</li>
<li class="current"><a href="index.php">Miscellaneous<span class="arrow"></span></a>
<ul style="display: none;" class="sub_menu">
<li class="arrow_top"></li>
<li><a class="subCurrent" href="https://web.iit.edu/sites/web/files/departments/about-iit/pdfs/campus-map.pdf">University map</a></li>
<li><a href="https://web.iit.edu/contact-us">Important contact Info</a></li>
<li><a href="https://weather.com/weather/today/l/USIL0225:1:US">Weather Updates</a></li>
<li><a href="https://web.iit.edu/sites/web/files/departments/acaps/pdfs/Illinois-Tech-Shuttle-Bus-Schedule.pdf">Shuttle Bus</a></li>
</ul>
</li>
<li><a href="logout.php">Logout</a></li>
</ul>
</nav>
</div><!-- end fdw -->
</header><!-- end header -->
<table class="data-table">
<caption class="title">Course Credits</caption>
<thead>
<tr>
<th>COURSE NO</th>
<th>COURSE NAME</th>
<th>CREDITS</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
$total = 0;
while ($row = mysqli_fetch_array($query))
{
echo '<tr>
<td>'.$row['CourseNo'].'</td>
<td>'.$row['CourseName'].'</td>
<td>'.$row['Credits'].'</td>
</tr>';
$no++;
}?>
</tbody>
<tfoot>
<tr>
</tr>
</tfoot>
</table>
</div>
</body>
</html>