D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
display_audio_files.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Audio Files</title> <link rel="stylesheet" href="css.css"> </head> <body> <header> <div class="logo"><img src="logo.png"></div> </header> <div class="mainbody"> <div class="bodyarea"> <h1>Audio Files</h1> <?php // Get current page $page = isset($_GET['page']) ? $_GET['page'] : 1; $offset = ($page - 1) * $records_per_page; // Pagination settings $limit = 999; // Number of records per page $page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? $_GET['page'] : 1; $offset = ($page - 1) * $limit; // Query to select records with pagination $query = "SELECT * FROM audio_files LIMIT $offset, $limit"; $result = $conn->query($query); if (!$result) { echo "Error: " . $conn->error; } // Display the data in an HTML table with clickable audio filenames if ($result->num_rows > 0) { echo "<table>"; echo "<tr><th>Audio Bayan Name</th><th>Urdu Title</th><th>Details</th><th>Category</th><th>Speaker</th><th>Upload Date</th></tr>"; while ($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td><a href='details.php?id=" . $row["id"] . "'>" . $row["english_title"] . "</a></td>"; echo "<td>" . $row["urdu_title"] . "</td>"; echo "<td>" . $row["details"] . "</td>"; echo "<td>" . $row["category"] . "</td>"; echo "<td>" . $row["speaker"] . "</td>"; echo "<td>" . $row["upload_date"] . "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "No records found."; } // Close the database connection $conn->close(); ?> <!-- Pagination links --> <div class="pagination"> <?php $total_records = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM audio_files")); $total_pages = ceil($total_records / $limit); for ($i = 1; $i <= $total_pages; $i++) { echo "<a href='index.php?page=" . $i . "'>" . $i . "</a>"; } ?> </div> </div> </div> <footer> <a href="https://webograph.pk/">Site BY Webograph.pk</a> </footer> </body> </html>