-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmark1.php
57 lines (51 loc) · 1.4 KB
/
mark1.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
<html>
<body background="C:\Users\Amisha\Desktop\webD\mnnit3.jpg">
<br>
<head><H1><font size="40" align="center"><u><center>ATTENDANCE TABLE</center></u></font></H1></head>
<table border='10' align='center' cellspacing='5' cellpadding='10' height='40'>
<tr>
<td width='15%'>NAME</td>
<td width='15%'>STUDENT-ID</td>
<td width='15%'>MARK STATUS</td>
</tr>
<?php
session_start();
if(isset($_SESSION['facultyID']))
{$p=$_SESSION['facultyID'];
mysql_connect("localhost","root","");
mysql_select_db("AMS");
$query="SELECT * FROM student";
$result=mysql_query($query);}
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row[0]?></td>;
<td><?php echo $row[2]?></td>;
<form method="post" action="mark1.php">
<td>
Present <input type="radio" name="st[row[2]]" value="Present">
Absent <input type="radio" name="st[row[2]]" value="Absent">
<input type="submit" value="SAVE">
</td>
<?php
mysql_connect("localhost","root","");
mysql_select_db("AMS");
$s=$_POST['st[row[2]]'];
if($s=="Present")
{
$q1 = mysql_query("SELECT * FROM `student` WHERE `studentID`= '$row[2]' ");
$attendance = mysql_fetch_array($q1);
$y = 1;
$a = $attendance['attendance'] + $y;
$s="UPDATE `student` set `attendance`='$a' WHERE `studentID`= '$row[2]' ";
}
mysql_query($s);
?>
</form>
</tr>
<?php } ?>
</table>
<a href="welcomefaculty.php">CLICK HERE TO GO BACK</a>;
</body>
</html>