D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
displayevents.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html> <head> <title>Event Countdown</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- For IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Module css --> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; } .container { max-width: 800px; margin: 0 auto; padding: 20px; background-color: #fff; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); text-align: center; } .countdown { font-size: 24px; color: #e74c3c; margin-top: 20px; } .share-buttons { margin-top: 20px; } .share-button { display: inline-flex; margin-right: 10px; } .share-button a { text-decoration: none; color: #fff; background-color: #007bff; padding: 12px 18px; margin: 10px; border-radius: 5px; transition: background-color 0.3s; } .share-button a:hover { background-color: #0056b3; } .submit { width: 97%; margin: 5px; padding: 10px; background-color: green; } { width: 97%; margin: 5px; padding: 10px; background-color: red;} </style> </head> <body> <div class="container"> <h1>Event Countdown</h1> <?php // Fetch event data $sql = "SELECT * FROM events ORDER BY STR_TO_DATE(CONCAT(event_date, ' ', event_time), '%Y-%m-%d %H:%i') DESC LIMIT 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $event_name = $row['event_name']; $event_nameurdu = $row['event_nameurdu']; $event_date = $row['event_date']; $event_time = $row['event_time']; $location = $row['location']; $countdown = $row['countdown']; // Calculate the end time of the event $end_time = strtotime("$event_date $event_time"); $current_time = time(); $remaining_time = $end_time - $current_time; echo "<h2>$event_name</h2>"; echo "<p>$event_nameurdu</p>"; echo "<p>Event Date: $event_date</p>"; echo "<p>Event Time: $event_time</p>"; if ($remaining_time > 0) { echo "<p class='countdown' id='countdown'></p>"; echo "<iframe src='$location' width='auto' height='auto' style='border:0;' allowfullscreen='' loading='lazy' referrerpolicy='no-referrer-when-downgrade'></iframe>"; // JavaScript countdown timer echo "<script> var countdown = $remaining_time; var countdownDisplay = document.getElementById('countdown'); function updateCountdown() { var days = Math.floor(countdown / (24 * 60 * 60)); var hours = Math.floor((countdown % (24 * 60 * 60)) / (60 * 60)); var minutes = Math.floor((countdown % (60 * 60)) / 60); var seconds = countdown % 60; countdownDisplay.innerHTML = days + 'd ' + hours + 'h ' + minutes + 'm ' + seconds + 's'; countdown--; if (countdown < 0) { countdownDisplay.innerHTML = 'Event has ended.'; } } updateCountdown(); // Display initial countdown setInterval(updateCountdown, 1000); // Update countdown every second </script>"; } else { echo "<p>Event has ended.</p>"; } } else { echo "No events found."; } // Close the database connection $conn->close(); ?> <button id="copyButton">Copy URL</button> <div class="share-buttons"> <div class="share-button"> <a href="https://www.facebook.com/sharer.php?https://quranplatform.com/bazmeasar/event/displayevents.php" target="_blank">Share on Facebook</a> </div> <div class="share-button"> <a href="https://twitter.com/share?https://quranplatform.com/bazmeasar/event/displayevents.php" target="_blank">Share on Twitter</a> </div> <div class="share-button"> <a href="https://wa.me/?https://quranplatform.com/bazmeasar/event/displayevents.php" target="_blank">Share on WhatsApp</a> </div> </div> </div> </body> </html>