if (!function_exists('circ_format_bytes')) {
function circ_format_bytes($bytes) {
if ($bytes <= 0) return 'PDF';
if ($bytes >= 1048576) return round($bytes / 1048576, 2) . ' MB';
return round($bytes / 1024, 2) . ' KB';
}
}
// Recent circulars for sidebar
$recent_circulars = [];
$recent_q = mysqli_query($con, "SELECT sno, heading, circular_date, file_name FROM `circular` ORDER BY `sno` DESC LIMIT 4");
if ($recent_q) {
while ($r_row = mysqli_fetch_assoc($recent_q)) {
$recent_circulars[] = $r_row;
}
}
?>