D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
Filename :
full_details.php
back
Copy
<?php // Database connection parameters include 'config.php'; // Retrieve the audio file's ID from the query string if (isset($_GET['id']) && is_numeric($_GET['id'])) { $audio_id = $_GET['id']; // Query to select the specific audio file $query = "SELECT * FROM audio_files WHERE id = $audio_id"; $result = $conn->query($query); if ($result && $result->num_rows > 0) { // Fetch audio file data $row = $result->fetch_assoc(); echo "<h1>Full Details</h1>"; echo "<table>"; echo "<tr><td>Audio Filename:</td><td>" . $row["audio_filename"] . "</td></tr>"; echo "<tr><td>Image Filename:</td><td>" . $row["image_filename"] . "</td></tr>"; echo "<tr><td>Urdu Title:</td><td>" . $row["urdu_title"] . "</td></tr>"; echo "<tr><td>English Title:</td><td>" . $row["english_title"] . "</td></tr>"; echo "<tr><td>Details:</td><td>" . $row["details"] . "</td></tr>"; echo "<tr><td>Category:</td><td>" . $row["category"] . "</td></tr>"; echo "<tr><td>Speaker:</td><td>" . $row["speaker"] . "</td></tr>"; // Calculate and display the file size $file_path = "uploads/audio/" . $row["audio_filename"]; $file_size_bytes = filesize($file_path); $file_size_mb = round($file_size_bytes / 1024 / 1024, 2); // Convert bytes to MB echo "<tr><td>File Size:</td><td>" . $file_size_mb . " MB</td></tr>"; // Add a download link echo "<tr><td>Download:</td><td><a href='download.php?audio_filename=" . $row["audio_filename"] . "'>Download</a></td></tr>"; // Add a play live audio option echo "<tr><td>Play Audio:</td><td><audio controls>"; echo "<source src='admin/uploads/audio/" . $row["audio_filename"] . "' type='audio/mpeg'>"; echo "Your browser does not support the audio element."; echo "</audio></td></tr>"; // Update the hit counter (number of downloads) $update_hit_counter_query = "UPDATE audio_files SET hits = hits + 1 WHERE id = $audio_id"; $conn->query($update_hit_counter_query); // Display the hit counter echo "<tr><td>Download Count:</td><td>" . $row["hits"] . " times</td></tr>"; // Close the table echo "</table>"; } else { echo "Audio file not found."; } } else { echo "Invalid audio file ID."; } // Close the database connection $conn->close(); ?>