forked from nisiya/MaristIDCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_student_program_home.php
78 lines (78 loc) · 2.81 KB
/
add_student_program_home.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
<!--User is redirected to this page after adding a student. Allows them to add courses for that student, or exit back to home page -->
<?php
$title = 'IDCP - Add Program for Student';
$page = 'student';
$page_name = 'add_stu_prg';
require('includes/header.php');
require( 'includes/connect_db_c9.php' ) ;
require( 'includes/student_helpers.php' ) ;
?>
<script>
sessionStorage.clear();
</script>
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="dropdown">
<div class="page-header">
<?php
$stu_id = $_SESSION['STU_ID'];
$name = get_stu_name($dbc, $stu_id);
if($_SESSION['addedProgram'] == true){
echo '<h1>Add More Programs for ' . "$name" . '</h1>';
}
else{
echo '<h1>Add Program for ' . "$name" . '</h1>';
}
?>
</div>
<div class = "butspan" style = "width: 300px;">
<button type="button" class="btn btn-primary btn-block" style = "margin-right: 50px;" onclick="location.href='add_student_program.php';">
<?php
$stu_id = $_SESSION['STU_ID'];
$name = get_stu_name($dbc, $stu_id);
if($_SESSION['addedProgram'] == true){
echo 'Add Another Program for ' . "$name";
}
else{
echo 'Add a Program for ' . "$name";
}
?></button>
<hr>
<!--Dynamic button-->
<?php
$stu_id = $_SESSION['STU_ID'];
$name = get_stu_name($dbc, $stu_id);
if($_SESSION['addedProgram'] == true){
//This line below might not work
echo '<button type="button" class="btn btn-primary btn-block" style = "margin-right: 50px;" onclick="location.href=\'add_student_course.php\';">';
echo 'Add Courses for ' . "$name";
echo "</button>";
}
else{
echo '<p>Please add a program for this student before proceeding</p>';
}
?>
</div>
<hr>
<?php
$stu_id = $_SESSION['STU_ID'];
get_student_programs($dbc, $stu_id);
?>
</div>
</div>
<!-- /#container -->
</div>
<!-- /#page-content-wrapper -->
<!--Footer-->
<?php require('includes/footer.php'); ?>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!--Student JavaScript -->
<script src="js/student.js"></script>
</body>
</html>