D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
Filename :
audios.php
back
Copy
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Audio Bayanat</title> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="" name="keywords"> <meta content="" name="description"> <!-- Favicon --> <link href="img/favicon.ico" rel="icon"> <!-- Google Web Fonts --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Noto+Nastaliq+Urdu:wght@600&display=swap" rel="stylesheet"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@600;700&family=Ubuntu:wght@400;500&display=swap" rel="stylesheet"> <!-- Icon Font Stylesheet --> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet"> <!-- Libraries Stylesheet --> <link href="lib/animate/animate.min.css" rel="stylesheet"> <link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet"> <link href="lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" /> <!-- Customized Bootstrap Stylesheet --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Template Stylesheet --> <link href="css/style.css" rel="stylesheet"> <link href="css/css.css" rel="stylesheet"> <link href="audio/css.css" rel="stylesheet"> <style> table thead th { background-color: green; color: black; } table tr:hover { background-color: initial; /* Disable hover effect */ } table tr { background-color: initial; /* Disable hover effect */ font-family: 'Amiri Quran', serif; font-family: 'Noto Nastaliq Urdu', serif; text-align: center; font-size: 13px; } </style> </head> <body> <!-- Spinner Start --> <div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center"> <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status"> <span class="sr-only">Loading...</span> </div> </div> <!-- Spinner End --> <!-- Topbar Start --> <?php include 'include/topbar.php'; ?> <!-- Topbar End --> <!-- Navbar Start --> <?php include 'include/menu.php'; ?> <!-- Navbar End --> <!-- Service Start --> <div class="container-xxl service py-5"> <div class="container"> <div class="col-lg-12"> <?php // Database connection parameters include 'config.php'; // Pagination settings $per_page = 15; // Number of records per page $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; $start = ($page - 1) * $per_page; // Query to select records and order them by upload date in descending order $query = "SELECT * FROM audio_files ORDER BY id DESC LIMIT $start, $per_page"; $result = $conn->query($query); if (!$result) { echo "Error: " . $conn->error; } // Display the data in an HTML table if ($result->num_rows > 0) { echo "<table class='table'>"; echo "<thead><tr><th>Bayan Name</th><th>Urdu Title</th><th>Speaker</th><th>Date</th><th>Size (MB)</th><th>Download</th></tr></thead><tbody>"; while ($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td><a href='details.php?id=" . $row["id"] . "'>" . $row["english_title"] . "</a></td>"; echo "<td><center>" . $row["urdu_title"] . "</center></td>"; echo "<td>" . $row["speaker"] . "</td>"; echo "<td>" . $row["a_date"] . "</td>"; // Calculate and display the file size $audio_filename = $row["audio_filename"]; $file_path = "admin/uploads/audio/" . $audio_filename; $file_size_bytes = filesize($file_path); $file_size_mb = round($file_size_bytes / 1024 / 1024, 2); // Convert bytes to MB echo "<td>" . $file_size_mb . " MB</td>"; // Add a download button echo "<td><center><a href='download.php?audio_filename=" . $audio_filename . "'><i class='fa fa-download'></i></a></center></td>"; echo "</tr>"; } echo "</tbody></table>"; // Pagination links $total_records_query = "SELECT COUNT(*) AS total_records FROM audio_files"; $total_records_result = $conn->query($total_records_query); $total_records = $total_records_result->fetch_assoc()['total_records']; $total_pages = ceil($total_records / $per_page); // Set up pagination logic to show only 10 pages at a time $max_pages_to_show = 7; $start_page = max(1, $page - intval($max_pages_to_show / 2)); $end_page = min($total_pages, $start_page + $max_pages_to_show - 1); // Adjust start_page if at the last segment of pages if ($end_page - $start_page < $max_pages_to_show - 1) { $start_page = max(1, $end_page - $max_pages_to_show + 1); } echo "<div class='d-flex justify-content-center'>"; echo "<nav aria-label='Page navigation'>"; echo "<ul class='pagination'>"; if ($page > 1) { echo '<li class="page-item"><a class="page-link" href="?page=' . ($page - 1) . '">Previous</a></li>'; } echo '<li class="page-item"><a class="page-link" href="index.php">Home</a></li>'; for ($i = $start_page; $i <= $end_page; $i++) { if ($i === $page) { echo '<li class="page-item active"><span class="page-link">' . $i . '</span></li>'; } else { echo '<li class="page-item"><a class="page-link" href="?page=' . $i . '">' . $i . '</a></li>'; } } if ($page < $total_pages) { echo '<li class="page-item"><a class="page-link" href="?page=' . ($page + 1) . '">Next</a></li>'; } echo "</ul>"; echo "</nav>"; echo "</div>"; } else { echo "No records found."; } // Close the database connection $conn->close(); ?> </div> </div> </div> <!-- Service End --> <!-- Back to Top --> <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a> <!-- JavaScript Libraries --> <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script> <script src="lib/wow/wow.min.js"></script> <script src="lib/easing/easing.min.js"></script> <script src="lib/waypoints/waypoints.min.js"></script> <script src="lib/counterup/counterup.min.js"></script> <script src="lib/owlcarousel/owl.carousel.min.js"></script> <script src="lib/tempusdominus/js/moment.min.js"></script> <script src="lib/tempusdominus/js/moment-timezone.min.js"></script> <script src="lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script> <!-- Template Javascript --> <script src="js/main.js"></script> </body> </html>