forked from jmsandiegoo/capstone-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
362 lines (330 loc) · 21.8 KB
/
index.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<?php
include_once __DIR__.'/helpers/mysql.php';
include_once __DIR__.'/helpers/helper.php';
$helper = new Helper();
// Retrieving the course details
$db = new Mysql_Driver();
$db->connect();
$sql = "SELECT * FROM Course WHERE course_name NOT LIKE '%Common%'"; // this is the sql query for this loop
$result = $db->query($sql);// connect to the database to get the info
$resultArray = []; // instantiate empty array
while ($row = $db->fetch_array($result)) { // while loop based on connection
$resultArray[] = $row; // append results into the array
}
$sql4 = "SELECT * FROM Course WHERE course_name LIKE '%Common%'";
$result9 = $db->query($sql4);
$resultArray2 = [];
while ($row = $db->fetch_array($result9)) {
$resultArray2[] = $row;
}
$sql6 = "SELECT * FROM Course";
$result1 = $db->query($sql6);
$resultArray3 = [];
while ($row = $db->fetch_array($result1)) {
$resultArray3[] = $row;
}
$db->close();
$img = "https://images.unsplash.com/photo-1461749280684-dccba630e2f6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80";
?>
<!DOCTYPE html>
<html lang="en">
<?php include $helper->subviewPath('header.php') ?>
<a href="" id="floatingBtn"><div id="floatingBtnTxt"></div></a>
<script>var courseName = [];</script>
<script>var cid = [];</script>
<script>
courseName.unshift("")
</script>
<main>
<?php include $helper->subviewPath('fullpageNav.php') ?>
<div id="fullpage">
<div class="section" id="section-header">
<div class="container">
<div class="card flex-row flex-wrap intro">
<div class="card-header intro" style="float:left;">
<img class="img-fluid" src="assets/img/General/BG_Logo.png" alt="Logo Image" data-holder-rendered="true">
</div>
<div class="card-block px-2 justify-content-center" style="float:right; padding-top:50px;">
<h1 >OPEN HOUSE</h1>
<h2><span class="welcome-text">WELCOME TO ICT,</span><span class="short-text"> Taking IT Higher </span></h2>
<h2 class="hidden-text"> Taking IT Higher </h2>
</div>
</div>
<br>
</div>
</div>
<div class="section" id="section-overview">
<div class="container cour">
<?php foreach ($resultArray3 as $key => $row): ?>
<div class="card courses" style="">
<a href="#<?php echo $row["course_abbreviations"]?>">
<div class="row no-gutters">
<?php
$db = new Mysql_Driver();
$db->connect();
$sql3 = "SELECT * FROM Item WHERE course_id = " . $row['id'] . " AND item_path LIKE '%BG_1.jpg'";
$result3 = $db->query($sql3);
$db -> close();
while ($row3 = $db->fetch_array($result3)):
?>
<div class="col-auto">
<img style="height:6vw" src="<?php echo $row3["item_path"] ?>" class="img-fluid" alt="">
</div>
<?php endwhile; ?>
<div class="col info">
<script>courseName.push("<?=$row['course_name']?>")</script>
<script>cid.push("<?=$row['id']?>")</script>
<div class="card-block px-2">
<h5 class="card-title"><?php echo $row['course_name'] ?></h5>
<h6 class="card-subtitle"><?php echo $row['course_short_description'] ?></h6>
</div>
</div>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
<!-- For Courses except Common ICT -->
<?php foreach ($resultArray as $key => $row): ?>
<div class="section" id="<?php echo 'section-' . $row['id']?>">
<!-- Slide 1 -->
<div class="slide" id="<?php echo 'slide1-' . $row['id']?>" data-anchor="0">
<div class="container courseTitle" >
<div class="row">
<div class="col-md-7">
<h1>Diploma in </br> <?php echo $row['course_name'] ?></h1>
<h2><?php echo $row['course_id'] ?></h2>
<!-- <p><?php echo $row['course_short_description'] ?></p> -->
</div>
</div>
</div>
</div>
<!-- Slide 2 -->
<div class="slide" id="<?php echo 'slide2-' . $row['id']?>" data-anchor="1">
<div class="container-fluid">
<div class="course-information">
<div class="container">
<h1><i class="question-icon"></i> Course Information</h1>
<p><?php echo $row['course_description'] ?></p>
</div>
</div>
<div class="course-career">
<div class="container container-fluid py-2">
<h1><i class="binoculars-icon"></i> Career Prospects</h1>
<div class="d-flex flex-row flex-wrap">
<?php
$db = new Mysql_Driver();
$db->connect();
$sql3 = "SELECT * FROM CategoryJob A INNER JOIN Category B ON A.category_id = B.category_id WHERE B.id =" . $row['id']. " GROUP BY A.category_id";
$result3 = $db->query($sql3);
$db -> close();
$resultArray4 = [];
while ($row20 = $db->fetch_array($result3)){
$resultArray4[] = $row20;
}
?>
<?php foreach ($resultArray4 as $key => $row2): ?>
<div class="card card-body1 category">
<div class="align-self-center">
<?php
$db = new Mysql_Driver();
$db->connect();
$sql3 = "SELECT * FROM Item WHERE category_id = " . $row2['category_id'];
$result4 = $db->query($sql3);
$db -> close();
while ($row3 = $db->fetch_array($result4)):
?>
<img class="rounded-circle" src="<?php echo $row3["item_path"] ?>" alt="Category Image" data-holder-rendered="true">
<?php endwhile?>
</div>
<h6 class="card-title text-center text-dark" id="categoryjob"><?php echo $row2['category_name'] ?></h5>
<?php
$db = new Mysql_Driver();
$db->connect();
$sql13 = "SELECT * FROM CategoryJob A INNER JOIN job B ON A.job_id = B.job_id WHERE A.category_id = $row2[category_id]";
$result13 = $db->query($sql13);
$resultArray3 = [];
while ($row19 = $db->fetch_array($result13)){
$resultArray3[] = $row19;
}
$db->close();
?>
<div id="categoryjobname">
<?php foreach ($resultArray3 as $key => $row1):
?>
<?php if($row1["job_name"] != ""): ?>
<li class="text-dark"><?php echo $row1['job_name']?></br></li>
<?php endif;?>
<?php endforeach;?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
<!-- Slide 3-->
<div class="slide" id="<?php echo 'slide3-' . $row['id']?>" data-anchor="2">
<div class="overlay slide3">
<div class="container slide3">
<div class="course-entry">
<h1><i class="question-icon"></i> Entry Requirements</h1>
<h3> <u>For Students with 'O' Levels:</u> </h3>
<h6>Range of Net ELR2B2 for 2020 JAE: <strong><?php echo $row['course_requirements'] ?></strong></h5>
<h6>Planned Intake (2020): <strong><?php echo $row['course_intake'] ?></strong></h5>
<br>
<h3><u> Aggregate Type ELR2B2-C </u></h3>
<p>To be eligible for consideration, candidates must have the following GCE 'O' Level Examination results </p>
<h6 style="width:50%; float:left;"> Subjects </h6>
<h6 style="width:50%; float:right;">'O' Level Grade </h6>
<?php
$db = new Mysql_Driver();
$db->connect();
$sql2 = "SELECT * FROM Requirement r INNER JOIN CourseReq cr ON r.req_id = cr.req_id WHERE cr.course_id = $row[id]";
$result2 = $db->query($sql2);
$db -> close();
while ($row2 = $db->fetch_array($result2)):
?>
<div class="subject-wrapper">
<p style="width:60%; float:left;"><?php echo "+ " . $row2['req_subject']?></p>
<p style="width:40%; float:right; text-align: center;"><?php echo $row2['req_grade']?></p>
</div>
<?php endwhile; ?>
<!-- </br>
<p style="width:80%;">You must also have sat for a Science or Design & Technology or Food & Nutrition or relevant OSIE/Applied Subject and fulfil the aggregate computation requirements. </p>
<p>Candidates with severe vision deficiency should not apply for the course.</p>
</br> -->
<p style="width:80%; float:left;">
<em>* You must also have sat for a Science or Design & Technology or Food & Nutrition or relevant OSIE/Applied Subject and fulfil the aggregate computation requirements.<br/>
* Candidates with severe vision deficiency should not apply for the course.</em>
</p><br/>
<a id="learn-more-btn" class="btn btn-light" href="<?php echo $helper->pageUrl("modules.php") . "?id=$row[id]" ?>">
Learn More
</a>
</div>
</div>
<div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<!-- Common ICT section -->
<?php foreach ($resultArray2 as $key => $row): ?>
<div class="section" id="<?php echo 'section-' . $row['id']?>">
<!-- Slide 1 -->
<div class="slide" id="<?php echo 'slide1-' . $row['id']?>" data-anchor="0">
<div class="container courseTitle">
<div class="row">
<div class="col-md-7">
<h1>Diploma in </br> <?php echo $row['course_name'] ?></h1>
<h2><?php echo $row['course_id'] ?></h2>
<!-- <p><?php echo $row['course_short_description'] ?></p> -->
</div>
</div>
</div>
</div>
<!-- Slide 2 -->
<div class="slide" id="<?php echo 'slide2-' . $row['id']?>" data-anchor="1">
<div class="container-fluid">
<div class="course-information">
<div class="container courseInfo">
<h1><i class="question-icon"></i> Course Information</h1>
<p><?php echo $row['course_description'] ?></p>
</div>
</div>
<div class="course-career">
<div class="container">
<h1><i class="binoculars-icon"></i> Course Pathway</h1>
<div class="course-wrapper desc">
<p>In Year 1, Students are given an opportunity to learn modules from other courses in ICT.</br>
Upon completion of Year 1 modules, Students are to continue their education by selecting the following courses:</br>
</p>
<div class="referModule">
<?php foreach($resultArray as $key => $row1): ?>
<a id="course-btn" class="btn btn-light" href="<?php echo "index.php#".$row1["id"]."/1"?>"><?php echo $row1["course_name"]?></a>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Slide 3-->
<div class="slide" id="<?php echo 'slide3-' . $row['id']?>" data-anchor="2">
<div class="overlay slide3">
<div class="container slide3">
<div class="course-entry">
<h1><i class="question-icon"></i> Entry Requirements</h1>
<h3> <u>For Students with 'O' Levels:</u> </h3>
<h6>Range of Net ELR2B2 for 2020 JAE: <strong><?php echo $row['course_requirements'] ?></strong></h5>
<h6>Planned Intake (2020): <strong><?php echo $row['course_intake'] ?></strong></h5>
<br>
<h3><u> Aggregate Type ELR2B2-C </u></h3>
<p>To be eligible for consideration, candidates must have the following GCE 'O' Level Examination results </p>
<h6 style="width:50%; float:left;"> Subjects </h6>
<h6 style="width:50%; float:right;">'O' Level Grade </h6>
<?php
$db = new Mysql_Driver();
$db->connect();
$sql2 = "SELECT * FROM Requirement r INNER JOIN CourseReq cr ON r.req_id = cr.req_id WHERE cr.course_id =" . $row['id'];
$result2 = $db->query($sql2);
$db -> close();
while ($row2 = $db->fetch_array($result2)):
?>
<div class="subject-wrapper">
<p style="width:60%; float:left;"><?php echo "+ " . $row2['req_subject']?></p>
<p style="width:40%; float:right; text-align: center;"><?php echo $row2['req_grade']?></p>
</div>
<?php endwhile; ?>
<!-- </br>
<p style="width:80%;">You must also have sat for a Science or Design & Technology or Food & Nutrition or relevant OSIE/Applied Subject and fulfil the aggregate computation requirements. </p>
<p>Candidates with severe vision deficiency should not apply for the course.</p>
</br> -->
<p style="width:80%; float:left;">
<em>* You must also have sat for a Science or Design & Technology or Food & Nutrition or relevant OSIE/Applied Subject and fulfil the aggregate computation requirements.<br/>
* Candidates with severe vision deficiency should not apply for the course.</em>
</p>
<?php
$db = new Mysql_Driver();
$db->connect();
$sql = "SELECT * FROM Course WHERE course_name LIKE '%Common%'";
$result = $db->query($sql);
$db -> close();
while ($row = $db->fetch_array($result)):
?><br/>
<div stlye="padding-top:10px">
<a id="learn-more-btn" class="btn btn-light" href="<?php echo $helper->pageUrl("modules.php") . "?id=$row[id]" ?>">
Learn More
</a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</div>
</div>
<?php endforeach;?>
<div class="section" id="sectionfooter">
<div class="container">
<footer>
<div class="align-content-center foot" style="text-align:center">
<h3>Still need help? </h3>
<h4>Check out our other features on Telegram Chatbot by scanning the QR Code or clicking on the Telegram button below!</h4>
<br/><br/>
<a href="https://t.me/npictoh_bot">
<img alt="Telegram Link" src="assets/img/General/qrcode.png" style="margin-left:10px;margin-right:10px;width:10vw; height:10vw;">
</a>
<a href="https://t.me/npictoh_bot">
<img alt="Telegram Link" src="assets/img/General/tglogo.png" style="margin-left:10px;margin-right:10px;width:10vw; height:10vw;">
</a>
</div>
</footer>
</div>
</div>
</div>
</main>
<?php include $helper->subviewPath('fullpageFooter.php') ?>
</html>