Viewing file: birthday_reminder.php (1.94 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include 'admin/connect.php';
// ====================== // Get today's date (MM-DD) // ====================== $today = date("m-d");
// Fetch students having birthday today $bquery = "SELECT name, dob FROM admission WHERE DATE_FORMAT(dob, '%m-%d') = '$today'"; $bresult = mysqli_query($link, $bquery);
$birthdayMessages = []; if ($bresult && mysqli_num_rows($bresult) > 0) { while ($brow = mysqli_fetch_assoc($bresult)) { $studentName = htmlspecialchars($brow['name']); $dob = date("d M", strtotime($brow['dob'])); $birthdayMessages[] = "🎉 Happy Birthday $studentName ($dob)! 🎂"; } } else { $birthdayMessages[] = "🎂 No birthdays today 🎂"; } mysqli_close($link); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Birthday Reminder Flash</title> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap 5.3 CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style> body { background-color: #f4f4f4; } .highlight-container { width: 100%; background: linear-gradient(90deg, #FFD700, #FFA500); /* Yellow gradient */ padding: 10px 0; color: #fff; overflow: hidden; position: relative; height: 60px; box-shadow: 0 2px 6px rgba(0,0,0,0.3); } .highlight-text { font-size: 24px; font-weight: bold; color: #000; white-space: nowrap; position: absolute; width: 100%; animation: marquee 20s linear infinite; } @keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } } </style> </head> <body> <div class="highlight-container"> <div class="highlight-text"> <?php echo implode(" ⭐ ", $birthdayMessages); ?> </div> </div> </body> </html>
|