-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstu-notice_table.php
More file actions
102 lines (84 loc) · 3.61 KB
/
Copy pathstu-notice_table.php
File metadata and controls
102 lines (84 loc) · 3.61 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
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
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/util_table.css">
<link rel="stylesheet" type="text/css" href="css/main_table.css">
<!--===============================================================================================-->
</head>
<body>
<?php
require "includes/dbh.inc.php";
require "prevent_login.php";
?>
<div class="table100" style="padding-top: 10px; padding-left: 10px; padding-right: 10px; overflow: scroll; max-height: 600px;">
<table>
<thead>
<tr class="table100-head">
<th class="column1">Date</th>
<th class="column2">Notice</th>
<th class="column3">Remarks (If any)</th>
</tr>
</thead>
<tbody>
<!--<tr>
<td class="column1 flash">2017-09-29 01:22</td>
<td class="column2 flash">All the Students of ETCE UG 1 are requested to complete the registration process in this portal on or before 13/07/2020.All the Students of ETCE UG 1 are requested to complete the registration process in this portal on or before 13/07/2020</td>
<td class="column3 flash">Click Here for details</td>
</tr>-->
<?php
$course_code = $_SESSION['course_code'];
//echo $course_code;
$count = 0;
$query = mysqli_query($conn,"SELECT * FROM stu_notice WHERE (notice_visible='ALL' OR (notice_visible LIKE
'%$course_code%')) AND (notice_status='open')");
foreach($query as $row)
{
$count++;
?>
<?php echo '<tr>'?>
<td class="column1 flash"><?php echo $row["date_time_create"];?></td>
<td class="column2 flash"><?php echo $row["notice"];?></td>
<td class="column3 flash">
<?php
if($row["file_id"]=="")
{
echo "NA";
}
else{
//Add proper file link here by proper query.
$id = $row['file_id'];
$noticeLink = explode("/",$row['notice_id']);
$result = mysqli_query($conn,"SELECT * FROM notice_uploads WHERE file_id = $id");
$row_new = mysqli_fetch_assoc($result);
$format = $row_new['extension'];
$link = "../notice_uploads/notice".".".$noticeLink[0]."_".$noticeLink[1].".".$id.".".$format;
echo '<a href='.$link.'>Click here for details</a>';
}
?>
</td>
<?php
if($count == 3)
{
// three items in a row
echo '</tr>';
$count = 0;
}
} ?>
</tbody>
</table>
</div>
</div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="js/main_table.js"></script>
</body>
</html>