-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_view.php
99 lines (89 loc) · 2.63 KB
/
student_view.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
<?php
include "includes/header.php";
include "includes/navbar.php";
include "classes/Student.php";
$stu = new Student();
?>
<?php
// error_reporting(0);
$dt = $_GET['dt'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$attend = $_POST['attend'];
$attattend = $stu->updateAttendance($dt, $attend);
}
?>
<div class="container-fluid">
<?php
if (isset($attattend)) {
echo $attattend;
}
?>
<div class='alert alert-danger' style="display: none;"><strong>Error !</strong> Student Roll Missing !</div>
<!-- Page Heading -->
<h1 class="h3 mb-2 text-gray-800">View/Update Attendance</h1>
<p class="mb-4">Here the teacher can see and edit the attendance of students.</p>
<!-- DataTable -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">DataTable</h6>
</div>
<div class="card">
<div class="card-header">
<h2>
<a class="btn btn-info float-right" href="date_view.php">Back</a>
</h2>
</div>
<div class="card-body">
<div class="card bg-light text-center mb-3">
<h4 class="m-0 py-3"><strong>Date</strong>: <?php echo $dt; ?></h4>
</div>
<form action="" method="post">
<table class="table table-striped table-bordered">
<thead class="table-dark">
<tr>
<th width="25%">S/L</th>
<th width="25%">Student Name</th>
<th width="25%">Student Roll</th>
<th width="25%">Attendance</th>
</tr>
</thead>
<?php
$getstudent = $stu->getAllData($dt);
if ($getstudent) {
$i = 0;
while ($value = $getstudent->fetch_assoc()) {
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $value['name']; ?></td>
<td><?php echo $value['roll']; ?></td>
<td>
<input type="radio" name="attend[<?php echo $value['roll']; ?>]" value="present" <?php if($value['attend'] == "present") {echo "checked";} ?>>Present
<input type="radio" name="attend[<?php echo $value['roll']; ?>]" value="absent" <?php if($value['attend'] == "absent") {echo "checked";} ?>>Absent
</td>
</tr>
<?php } } ?>
<tfoot class="text-dark">
<tr>
<th width="25%">S/L</th>
<th width="25%">Student Name</th>
<th width="25%">Student Roll</th>
<th width="25%">Attendance</th>
</tr>
<tr>
<td colspan="4" class="text-center">
<input type="submit" name="submit" class="btn btn-primary px-5" value="Update">
</td>
</tr>
</tfoot>
</table>
</form>
</div>
</div>
</div>
</div>
<?php
include "includes/scripts.php";
include "includes/footer.php";
?>