<?php require_once('auth.php'); ?>

<?php
$sql="UPDATE notice_board SET noti='seen' WHERE status=1 AND   coid='$coid' AND noti='unseen' || noti=NULL   ";	
$result=mysqli_query($conn, $sql);

$sql="select * from notice_board WHERE coid='$coid' ORDER BY nid DESC limit 5";
$result=mysqli_query($conn, $sql);

$response='';
while($row=mysqli_fetch_array($result)) {
	$response = $response ."<a href='#'  class='dropdown-item'>".
                     "<i class='fas fa-bell mr-2'>".  "</i>". $row["notice"].
                     "<span class='float-right text-muted text-sm'>". $row["start_date"] ."</span>".
                     "</a>";    
}
if(!empty($response)) {
	print $response;
}


?>