forked from chinmayd3110/Student-Portal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtake_attendance.php
63 lines (52 loc) · 1.32 KB
/
take_attendance.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
<?php
require('connect.php');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Take attendance</title>
</head>
<body>
</body>
<?php echo " Attendance";
echo "<br>";
echo $_SESSION['course_code'];
$course_code=$_SESSION['course_code'];
echo "<br>";
echo $_SESSION['table_name'];
$table_name = $_SESSION['table_name'];
echo "<br>";
$t_id = $_SESSION['teacher_id'];
echo "$t_id";
?>
<form action="take_attendance.php" method="POST">
<?php
$i=1;
for($i=1;$i<12;$i++)
{
?>
<input type="radio" name="<?php echo $i; ?>" value="P"><?php echo $i; ?>P</input>
<input type="radio" name="<?php echo $i; ?>" value="A"> <?php echo $i; ?>A</input>
<br>
<?php } ?>
<input type="submit" name="submit" value="submit">
</form>
<?php
$i=1;
if(isset($_POST['submit']))
{
$atten = "";
for($i=1;$i<12;$i++)
{
echo $_POST[$i];
$atten=$atten.",'".$_POST[$i]."'";
}
echo "<br>";
echo "$atten";
}
$query = "insert into $table_name values('$course_code',CURRENT_TIMESTAMP,'$t_id'".$atten.")";
echo "$qry";
$result=mysqli_query($connection,$query);
?>
</html>