-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewabsentdates.php
46 lines (35 loc) · 1.08 KB
/
viewabsentdates.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
<!DOCTYPE html>
<?php
session_start();
?>
<div class ="message" style="float:right;margin-top: -10px;background-color: rgb(54, 216, 62); border:1px solid green;">
<?php
echo 'Welcome, ' .$_SESSION['susername'] .'!';
?>
</div>
<br>
<br>
<div class ="message" style="float:right;margin-top: -10px;background-color: rgb(54, 216, 62); border:1px solid green;">
<a href="logout.php"><button>Logout</button></a>
</div>
<?php
$studentrollno=$_SESSION['susername'];
$conn=mysql_connect("localhost","root","") or die("Could not connect!");
mysql_select_db("dbms") or die("Could not find db");
$courseid=$_POST['courseid'];
$cname=$_POST['cname'];
$result = mysql_query("SELECT * FROM absentdates WHERE studentrollno='$studentrollno' AND courseid='$courseid'");
if (mysql_num_rows($result) > 0) {
// output data of each row
echo $cname;
echo "<br><br>";
while($row = mysql_fetch_assoc($result)) {
echo $row['absentdate'];
echo "<br>";
}
} else {
echo "No absent dates";
}
?>
<br><br>
<a href="sattendance.php">Back to Page. </a><br><br>