-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteitaadmt.php
More file actions
61 lines (55 loc) · 1.94 KB
/
Copy pathteitaadmt.php
File metadata and controls
61 lines (55 loc) · 1.94 KB
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
<?php
include("header.php");
include("db.php");
if(isset($_POST['submit']))
{
foreach($_POST['attendance_status'] as $RollNo=>$attendance_status)
{
$RNo = $_POST['rollno'][$RollNo];
$Name = $_POST['names'][$RollNo];
$date = $_POST['date'];
$output = $con->query("INSERT INTO teitaadmt (RollNo, Name, Attendance_Status, Date) VALUES ('$RNo', '$Name', '$attendance_status', '$date')");
}
if($output)
{
header('thankyou.php');
}
else
{
echo $con->error;
}
}
?>
<div class="container">
<div class="panel panel-default">
<div class="panel panel-heading">
<a class="btn btn-success" href="">View All</a>
</div>
<div class="panel panel-heading">
<h3 align="center"><strong>Date: </strong> <?php echo $date?> <strong>Class: </strong> <?php echo $class ?> <strong>Subject: </strong> <?php echo $subject ?></h3>
</div>
<div class="panel panel-body">
<form action="teitaadmt.php" method="POST">
<input type="hidden" value="<?php echo $date?>" name="date">
<table class="table table-striped">
<th>Roll Number</th><th>Name</th><th>Attendance Status</th>
<?php $result = $con->query("SELECT * FROM teitaattendance");
$counter = 0;
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['RollNo'] ?></td>
<input type="hidden" value="<?php echo $row['RollNo'] ?>" name="rollno[]">
<td><?php echo $row['Name'] ?></td>
<input type="hidden" value="<?php echo $row['Name'] ?>" name="names[]">
<td><input type="radio" name="attendance_status[<?php echo $counter?>]" value="Present" required>Present<br>
<input type="radio" name="attendance_status[<?php echo $counter?>]" value="Absent">Absent</td>
</tr>
<?php $counter++; } ?>
</table>
<input type="submit" value="Submit" name="submit" class="btn btn-info">
</form>
</div>
</div>
</div>