D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
markniuj
/
bazmeasar.com
/
Filename :
show_records_bootstrap.php
back
Copy
<?php include 'config.php'; ?> <!DOCTYPE html> <html> <head> <title>Show in Boostrap</title> <!-- Add Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> </head> <body> <div class="container"> <h1>LESTEN, Download, Video</h1> <?php // Fetch videos from the database $sql = "SELECT id, english_title, urdu_title, category, details, DATE(upload_date) AS upload_date, audio_filename FROM audio_files ORDER BY upload_date DESC LIMIT 3"; $result = $conn->query($sql); if ($result->num_rows > 0) { $counter = 0; // Initialize a counter while ($row = $result->fetch_assoc()) { if ($counter % 3 == 0) { echo '<div class="row">'; } echo '<div class="col-md-4">'; echo '<div class="card mb-4">'; echo '<div class="card-body">'; echo '<h3 class="card-title">' . $row['category'] . '</h3></br>'; echo '<h6 class="card-title">' . $row['english_title'] . '</h6>'; echo '<h7 class="card-title">' . $row['urdu_title'] . '</h7></br>'; echo '<h7 class="card-title">' . $row['upload_date'] . '</h7></br>'; echo '<h7 class="card-title">' . $row['details'] . '</h7>'; echo '<p class="card-text">' . $row['description'] . '</p>'; // Calculate the file size $audio_path = "admin/uploads/audio/" . $row['audio_filename']; $file_size = filesize($audio_path); $file_size_mb = number_format($file_size / (1024 * 1024), 2); echo "<p>File Size: $file_size_mb MB</p>"; echo "<audio controls><source src='$audio_path' type='audio/mpeg'></audio>"; echo "<center><a href='download.php?audio_filename=" . $row['audio_filename'] . "'>Download <i class='fa fa-download'></i></a></center>"; echo '</div>'; echo '</div>'; echo '</div>'; if ($counter % 3 == 2) { echo '</div>'; } $counter++; } if ($counter % 3 != 0) { echo '</div>'; // Close the row if it's not already closed } } else { echo "No videos found."; } // Close the database connection $conn->close(); ?> </div> <!-- Add Bootstrap JS and jQuery --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </body> </html>