/
viewAttendance.php
125 lines (113 loc) · 5.14 KB
/
viewAttendance.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
<?php
include_once 'includes/DBconnection.php';
include_once 'includes/Instructor.php';
session_start();
if ($_SESSION['validCredentials']) {
?>
<html>
<head>
<title>View Attendance</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="/Ichnaea/css/main.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/formValidation.css"/>
</head>
<body style="margin-top: 60px">
<div class="container">
<nav class="navbar navbar-default col-xs-12 navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Ichnaea</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><a href="">Home</a></li>
<li class="active">
<a href="#">View Attendance </a>
</li>
<li ><a href="ManageClass.php">Add New Class</a></li>
<li ><a href="editCLass.php">Edit Class</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" class="dropdown-toggle" text-align="right" data-toggle="dropdown" role="button" aria-expanded="false"><?php echo $_SESSION['name'] ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="includes/destroySession.php" >Logout</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="panel panel-default col-md-12 col-sm-10 margin-div" id="activity-panel">
<div class="panel-body">
<div class="col-md-2 col-sm-2 span7 text-center" >
<?php
$myDBconnection = new DBconnection();
$myDBconnection->ConnectToDB();
$instructor = new Instructor("", "", "", $_SESSION['Email']);
$response = $instructor->getAllClasses($myDBconnection->db, $_SESSION['Email']);
foreach ($response as $ID){
// echo '<button type="button" class="btn btn-primary button-css" onclick="getAttendance('.$ID[0].')">'.$ID[0].'</button>';
printf('<button type="button" class="btn btn-primary button-css" onClick="getAttendance(\'%s\');">%s</button> ', $ID[0], $ID[0]);
}
?>
<!-- </div> -->
</div>
<div id="attendance-panel" style="display: none">
<div id="inputDate" >
<form role="form" method="post" id="attendance-date-form" action="ClassList.php" enctype="multipart/form-data">
<div class="form-group col-md-5">
<label>Please select Date for class:</label>
<select id="date-list">
</select>
</div>
</form>
</div>
</div>
<div class="row" style="margin-top:15px; display: none" id="attendance-table">
<div class="col-md-12">
<div class="well">
<h2 class="text-center">Class Attendance</h2>
<hr width="70%">
<table class="table table-striped" data-toggle="table">
<thead>
<tr>
<th >Student ID</th>
<th >First Name</th>
<th >Last Name</th>
<th >Status</th>
<!-- <th data-sortable="true">Class Date</th> -->
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/formValidation.min.js"></script>
<script type="text/javascript" src="js/bootstrap-1.js"></script>
<script type="text/javascript" src="js/bootstrap-table.js"></script>
</body>
</html>
<?php
}else{
header('Location: LoginPage.php');
}
?>