D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
root
/
proc
/
self
/
root
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
Filename :
index.php
back
Copy
<?php include 'config.php'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Bazme-e-Asar >>> Hazrat Maulana Shaheen Iqbal Asar Sahib DB</title> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="islamic audio bayanat,islahi bayanat taleem " name="keywords"> <meta content="Shaheen iqbal asar sahib ,khaleefa mujaz e bayat " name="description"> <!-- Favicon --> <link rel="icon" type="image/x-icon" href="/img/mic.png"> <!-- 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/home.css" rel="stylesheet"> <style> .cat-col { width: 100%; height: auto; background-color: #c9f2fc; } table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } .ashaar-card { border: 1px solid #ddd; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2); transition: 0.3s; text-align: center; background-color: #f7f7f7; margin-top: 50px; padding: 10px; border-radius: 10px; } .ashaar-card:hover { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); } .ashaar-card-body { margin-top: 10px; margin-left: 10px; } .ashaar-card-img { width: 100%; height: 100%; } .ashaar-card-text { font-size: 14px; } .shed { margin-top: -8px; text-align: center; } .space { padding: 20px; text-align: center; } .urdu { font-family: 'Amiri Quran', serif; font-family: 'Noto Nastaliq Urdu', serif; text-align: center; font-size: 13px; } .video-box { padding: 5px; margin-bottom: 15px; border: 1px solid #ccc; } video { max-width: 100%; height: auto; } .download-link { display: inline-block; background-color: #007bff; color: #fff; text-decoration: none; padding: 8px 15px; border-radius: 5px; margin-top: 10px; font-size: 16px; } .download-link:hover { background-color: #0056b3; } @media (max-width: 768px) { .video-box { margin-bottom: 20px; } .download-link { font-size: 14px; padding: 6px 12px; } } </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 --> <!-- Toplogo Start --> <!-- Toplogo End --> <!-- Topbar Start --> <!-- Topbar End --> <!-- Navbar Start --> <?php include 'include/menu.php'; ?> <!-- Navbar End --> <!-- Carousel Start --> <?php include 'include/slider.php'; ?> <!-- Carousel End --> <!----threebox---> <div class="box-container"> <!--box-col---start--> <div class="box-col"> <div class="box-data-heading">Live Audio Stream</div> <div class="box-data-live"> <center> <iframe style="border: 0px none transparent;" src="https://live.bazm.org/embed-ice.php?station=9006&w=280" width="100%" height="100%" frameborder="0" scrolling="no"></iframe> </center> </div> </div> <!--box-col---end--> <!--box-col---start--> <div class="box-col"> <div class="box-data-heading">Next Majlis</div> <div class="box-data"> <iframe src="next.php" width="100%" height="215" style="border:none;"></iframe> </div> </div> <!--box-col---end--> <!--box-col---start--> <div class="box-col"> <div class="box-data-heading">Conatct Info</div> <div class="box-data"> <div class="col-lg-12 col-md-12"> <h4>Address</h4> <p class="mb-2"><i class="fa fa-map-marker-alt me-3"></i>Sector 4-D, Surjani Town, Karachi, Pakistan</p> <p class="mb-2"><i class="fa fa-phone-alt me-3"></i>+92 334 3347176</p> <p class="mb-2"><i class="fa fa-envelope me-3"></i>asarjonpuri@gmail.com</p> <div class="contact-home-top"> <div class="d-flex pt-2"> <a class="btn btn-outline-light btn-social" href=""><i class="fab fa-twitter"></i></a> <a class="btn btn-outline-light btn-social" href=""><i class="fab fa-facebook-f"></i></a> <a class="btn btn-outline-light btn-social" href=""><i class="fab fa-youtube"></i></a> <a class="btn btn-outline-light btn-social" href=""><i class="fab fa-linkedin-in"></i></a> </div> </div> </div> </div> <!--box-col---end--> </div> </div> <!----threebox---> <!-- section Start --> <div class="container-xxl service py-5"> <div class="container"> <div class="text-center wow fadeInUp" data-wow-delay="0.1s"> </div> <!-- Service heading end --> <!---section area---start--> <div class="container"> <div class="row"> <?php // Define the speakers $speakers = [ "Hazrat Maulana Hakeem Mohammad Akhtar Sahib RA" => "Hazrat Maulana Hakeem Mohammad Akhtar Sahib RA", "Hazrat Maulana Shaheen Iqbal Asar Sahib DB" => "Hazrat Maulana Shaheen Iqbal Asar Sahib DB", "Hazrat Maulana Shah Abdul Mateen Sahib DB" => "Hazrat Maulana Shah Abdul Mateen Sahib DB" ]; foreach ($speakers as $speakerTitle => $speakerName) { echo "<div class='col-md-4'>"; echo "<div class='sp-title'>" . $speakerTitle . "</div>"; echo "<ul class='list-group'>"; // Retrieve and display the latest audio files for the category $query = "SELECT english_title, audio_filename FROM audio_files WHERE speaker = '$speakerName' ORDER BY id DESC LIMIT 5"; $result = $conn->query($query); while ($row = $result->fetch_assoc()) { echo "<li class='list-group-item d-flex justify-content-between align-items-center'>"; echo $row['english_title']; echo "<a href='download.php?audio_filename=" . $row['audio_filename'] . "' title='Download' class='btn btn-primary'><i class='fa fa-download'></i></a>"; echo "</li>"; } echo "</ul>"; echo "<a href='speaker.php?speaker=" . urlencode($speakerName) . "' class='btn btn-primary mt-3'>View More</a>"; echo "</div>"; } // Close the database connection $conn->close(); ?> </div> </div> <!---section area---end--> </div> </div> </div> <!-- section End --> <!-- search Start --> <!---- <div class="search-audio"> <?php // Check if a search query is submitted if (isset($_GET['query'])) { $search_query = $_GET['query']; // Query to search for audio records by English title $query = "SELECT * FROM audio_files WHERE english_title LIKE '%$search_query%'"; $result = $conn->query($query); // Store matching audio records in an array if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $audio_records[] = $row; } } } // Close the database connection $conn->close(); ?> <!-- Search form --> <!---- <form method="get" action="searched.php"> <h1 style="font-size: 22px; color: #FFF; ">Search Audio Records by English Title</h1> <div class="position-relative mx-auto" style="max-width: 400px;"> <input class="form-control border-0 w-100 py-3 ps-4 pe-5" type="text" name="query" placeholder="Type Bayan keywords"value="<?php echo $search_query; ?>"> <button type="submit" class="btn btn-primary py-2 position-absolute top-0 end-0 mt-2 me-2">SEARCH</button> </div> </form> <!-- Display search results in a table --> <?php if (!empty($search_query)) { if (count($audio_records) > 0) { echo "<h2>Search Results for \"$search_query\":</h2>"; echo "<table border='1'>"; echo "<tr><th>English Title</th><th>Download</th></tr>"; foreach ($audio_records as $record) { $audio_id = $record["id"]; $audio_filename = $record["audio_filename"]; $english_title = $record["english_title"]; echo "<tr>"; echo "<td><a href='details.php?id=$audio_id'>$english_title</a></td>"; echo "<td><a href='download.php?audio_filename=$audio_filename' title='Download'><i class='fa fa-download'></i></a></td>"; echo "</tr>"; } echo "</table>"; } else { echo "<p>No results found for your search.</p>"; } } ?> </div> </div> </div> </div> </div> <!-- search End --> <!-------------------------------------------------------------------> <!------------------------------------------------------------------> <!-- section Start --> <div class="container-xxl service py-5"> <div class="container"> <div class="text-center wow fadeInUp" data-wow-delay="0.1s"> <h1 style="margin-top: 0;font-size: 45px;color: #066737; margin-bottom: 0.5rem; font-family: " Barlow", sans-serif; font-weight: 700; line-height: 1.2; color: #0B2154;">LATEST BAYANAT</h1> </div> <!-- Service heading end --> <!---section area---start--> <!---section area---end--> </div> </div> </div> <!-- section End --> <div class="container"> <h1>LISTEN, Download</h1> <?php // Database connection parameters include 'config.php'; // Query to select the latest 3 records and order them by upload date in descending order $query = "SELECT * FROM audio_files ORDER BY id DESC LIMIT 6"; $result = $conn->query($query); if (!$result) { echo "Error: " . $conn->error; } // Display data in Bootstrap card layout with 3 records only if ($result->num_rows > 0) { echo "<div class='row'>"; while ($row = $result->fetch_assoc()) { echo "<div class='col-md-4 mb-4'>"; echo "<div class='card h-100'>"; echo "<div class='card-body'>"; echo "<h5 class='card-title'>" . $row["english_title"] . "</h5>"; echo "<h6 class='card-subtitle mb-2 text-muted'>" . $row["urdu_title"] . "</h6>"; echo "<p class='card-text'> " . $row["speaker"] . "</p>"; echo "<p class='card-text'><strong>Date:</strong> " . $row["a_date"] . "</p>"; // Calculate and display the file size $audio_filename = $row["audio_filename"]; $file_path = "admin/uploads/audio/" . $audio_filename; if (file_exists($file_path)) { $file_size_bytes = filesize($file_path); $file_size_mb = number_format($file_size_bytes / (1024 * 1024), 2); echo "<p><strong>Size:</strong> " . $file_size_mb . " MB</p>"; } else { echo "<p><strong>Size:</strong> File not found</p>"; } // Add audio control and download link echo "<audio controls><source src='$file_path' type='audio/mpeg'></audio>"; echo "<center><a href='download.php?audio_filename=" . $audio_filename . "' class='btn btn-primary mt-3'><i class='fa fa-download'></i> Download</a></center>"; echo "</div></div></div>"; } echo "</div>"; } else { echo "<p>No records found.</p>"; } // Close the database connection $conn->close(); ?> <a href='audios.php'>View All</a> </div> <!-- Fact Start --> <?php // Database connection parameters $servername = "localhost"; $username = "markniuj_bazmpbto"; $password = "BC)1at0Y8Wa{"; $dbname = "markniuj_bazmpbto_november-2023"; // Establish a database connection $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $conn->set_charset("utf8mb4"); // Initialize variables $total_speakers = $total_categories = $total_audio_files = 0; // Establish a database connection $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Count total speakers $speakers_query = "SELECT COUNT(DISTINCT speaker) as total_speakers FROM audio_files"; $speakers_result = $conn->query($speakers_query); if ($speakers_result && $speakers_result->num_rows > 0) { $row = $speakers_result->fetch_assoc(); $total_speakers = $row["total_speakers"]; } // Count total categories $categories_query = "SELECT COUNT(DISTINCT category) as total_categories FROM audio_files"; $categories_result = $conn->query($categories_query); if ($categories_result && $categories_result->num_rows > 0) { $row = $categories_result->fetch_assoc(); $total_categories = $row["total_categories"]; } // Count total audio files $audio_files_query = "SELECT COUNT(*) as total_audio_files FROM audio_files"; $audio_files_result = $conn->query($audio_files_query); if ($audio_files_result && $audio_files_result->num_rows > 0) { $row = $audio_files_result->fetch_assoc(); $total_audio_files = $row["total_audio_files"]; } // Count total audio files $pdf_books_query = "SELECT COUNT(*) as total_pdf_books FROM pdf_books"; $pdf_books_result = $conn->query($pdf_books_query); if ($audio_files_result && $audio_files_result->num_rows > 0) { $row = $pdf_books_result->fetch_assoc(); $total_pdf_books = $row["total_pdf_books"]; } // Count total audio files $videos_query = "SELECT COUNT(*) as total_videos FROM mp4"; $videos_result = $conn->query($videos_query); if ($videos_result && $videos_result->num_rows > 0) { $row = $videos_result->fetch_assoc(); $total_videos = $row["total_videos"]; } // Close the database connection $conn->close(); ?> <div class="container-fluid fact bg-dark my-5 py-5"> <div class="container"> <div class="row g-6"> <div class="col-md-6 col-lg-2 text-center wow fadeIn" data-wow-delay="0.1s"> <i class="fa fa-book fa-2x text-white mb-3"></i> <h2 class="text-white mb-2" data-toggle="counter-up"><?php echo $total_pdf_books; ?></h2> <p class="text-white mb-0">Total PDF BOOKS</p> </div> <div class="col-md-6 col-lg-3 text-center wow fadeIn" data-wow-delay="0.1s"> <i class="fa fa-microphone fa-2x text-white mb-3"></i> <h2 class="text-white mb-2" data-toggle="counter-up"><?php echo $total_speakers; ?></h2> <p class="text-white mb-0">Total Speakers</p> </div> <div class="col-md-6 col-lg-3 text-center wow fadeIn" data-wow-delay="0.5s"> <i class="fa fa-microphone fa-2x text-white mb-3"></i> <h2 class="text-white mb-2" data-toggle="counter-up"><?php echo $total_audio_files; ?></h2> <p class="text-white mb-0">Total Audios </p> </div> <div class="col-md-6 col-lg-2 text-center wow fadeIn" data-wow-delay="0.3s"> <i class="fa fa-users-cog fa-2x text-white mb-3"></i> <h2 class="text-white mb-2" data-toggle="counter-up"><?php echo $total_categories; ?></h2> <p class="text-white mb-0">Total Categories</p> </div> <div class="col-md-6 col-lg-2 text-center wow fadeIn" data-wow-delay="0.3s"> <i class="fa fa-play fa-2x text-white mb-3"></i> <h2 class="text-white mb-2" data-toggle="counter-up"><?php echo $total_videos; ?></h2> <p class="text-white mb-0">Total MP4</p> </div> </div> </div> </div> <!-- Fact End --> <!------------------> <!--- "1th Category_Saturday Bayan" => "Saturday Bayan", "2th Category_Friday Bayan" => "Friday Bayan", "3th Category_Taleem After Fajar" => "Taleem After Fajar" "4th Category_Taleem After Asar" => "Taleem After Asar", "5th Category_Asfaar" => "Asfaar", "6th Category_Malfoozat" => "Malfoozat" ---> <div class="container"> <div class="row"> <?php // Include your database connection parameters here include 'config.php'; ?> <?php // Define the categories $categories = [ "Saturday Bayan" => "Saturday Bayan", "Friday Bayan" => "Friday Bayan", "Taleem After Fajar" => "Taleem After Fajar", "Taleem After Asar" => "Taleem After Asar", "Asfaar" => "Asfaar", "Other Places bayan" => "Other Places bayan", ]; foreach ($categories as $categoryTitle => $categoryName) { echo "<div class='col-md-4'>"; echo "<div class='h-title'>" . $categoryTitle . "</div>"; echo "<ul class='list-group'>"; // Retrieve and display the latest audio files for the category $query = "SELECT english_title, audio_filename FROM audio_files WHERE category = '$categoryName' ORDER BY id DESC LIMIT 6"; $result = $conn->query($query); while ($row = $result->fetch_assoc()) { echo "<li class='list-group-item d-flex justify-content-between align-items-center'>"; echo $row['english_title']; echo "<a href='download.php?audio_filename=" . $row['audio_filename'] . "' title='Download'>Download</a>"; echo "</li>"; } echo "</ul>"; echo "<a href='category.php?category=" . urlencode($categoryName) . "' class='btn btn-primary mt-3'>View All</a>"; echo "</div>"; } // Close the database connection $conn->close(); ?> </div> </div> </div> <!------------------> <!--- 6 categories start----> <?php // Include your database connection parameters here include 'config.php'; // Query to retrieve all speakers and their record counts $categories_query = "SELECT category, COUNT(*) AS record_count FROM audio_files GROUP BY category LIMIT 0"; $categories_result = $conn->query($categories_query); ?> <div class="container"> <div class="row"> <?php if ($categories_result->num_rows > 0) { while ($category_row = $categories_result->fetch_assoc()) { $category = $category_row['category']; $record_count = $category_row['record_count']; ?> <div class="col-md-4"> <div class="categories-card"> <h4><?php echo $category; ?></h4> </h6> <p><?php echo $record_count; ?> Bayanat</p> <ol> <?php // Query to retrieve three English titles and download links for MP3 files under the category $records_query = "SELECT english_title, upload_date, audio_filename FROM audio_files WHERE category = '$category' ORDER BY id DESC LIMIT 6"; $records_result = $conn->query($records_query); while ($record_row = $records_result->fetch_assoc()) { $english_title = $record_row['english_title']; $upload_date = $record_row['upload_date']; $audio_filename = $record_row['audio_filename']; ?> <li class='list-group-item d-flex justify-content-between align-items-center'> <?php echo $english_title; ?>-(<?php echo $upload_date; ?>)<a href="download.php?audio_filename=<?php echo $audio_filename; ?>">Download</a> </li> <?php } ?> </ol> <a href="category.php?category=<?php echo $category; ?>">View All</a> </div> </div> <?php } } else { echo "<p></p>"; } ?> </div> </div> <!---end 9 categories ----> <!-----ashaar---اشعار-----> <div class="text-center wow fadeInUp" data-wow-delay="0.1s"> <h6 class="text-primary text-uppercase"></h6> </div> <div class="container mt-4"> <h1 class="text-center mb-4"></h1> <h1 class="mb-5"> <center>Ashaar (اشعار) </center> </h1> <div class="row row-cols-1 row-cols-md-6 row-cols-lg-4"> <?php // Query to retrieve the latest 4 pictures ordered by date_of_picture in descending order $sql = "SELECT picture_path, date_of_picture, category FROM pictures ORDER BY id DESC LIMIT 4"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo "<div class='ashaar-card'>"; echo "<div class='ashaar-img'>"; echo ' <a href="ashaar.php"><img src="admin/' . $row['picture_path'] . '" class="card-img" alt="Image"></a>'; echo "</div>"; echo "</div>"; } } else { echo "<tr><td colspan='6'>No PDFs found in the database.</td></tr>"; } ?> </div> </div> <!-----ashaar---اشعار-----> <!---mp4----> <!----mp4---> <!-- Team End --> <!----7th,8th,9th categories--> <!--- "7th Category_Other Places bayan" => "Other Places bayan", "8th Category_Zikar Majlis" => "Zikar Majlis", "9th Category_Important Malfoozat" => "Important Malfoozat" ---> <div class="container"> <div class="row"> <?php // Define the categories $categories = [ "Other" => "Other", "Zikar Majlis" => "Zikar Majlis", "Important Malfoozat" => "Important Malfoozat" ]; foreach ($categories as $categoryTitle => $categoryName) { echo "<div class='col-md-4'>"; echo '<div class="card-body">'; echo "<div class='h-title'>" . $categoryTitle . "</div>"; echo "<ul class='list-group'>"; // Retrieve and display the latest audio files for the category $query = "SELECT english_title, audio_filename FROM audio_files WHERE category = '$categoryName' ORDER BY id DESC LIMIT 3"; $result = $conn->query($query); while ($row = $result->fetch_assoc()) { echo "<li class='list-group-item d-flex justify-content-between align-items-center'>"; echo $row['english_title']; echo "<a href='download.php?audio_filename=" . $row['audio_filename'] . "' title='Download' class='btn btn-primary'><i class='fa fa-download'></i></a>"; echo "</li>"; } echo "</ul>"; echo "</div>"; echo "<a href='category.php?category=" . urlencode($categoryName) . "' class='btn btn-primary mt-3'>View More</a>"; echo "</div>"; } // Close the database connection $conn->close(); ?> </div> </div> <!-------------------------------------------------------------------> <!------------------------------------------------------------------> </div> </div> <!-------Mp4 download and watch---> <div class="space"> <h1 style="margin-top: 0;font-size: 45px;color: #001350; text-align: center; margin-bottom: 0.5rem; font-family: " barlow",="" sans-serif;="" font-weight:="" 700;="" line-height:="" 1.2;="" color:="" #0b2154;"="">MP4</h1> <h1 style="margin-top: 0;font-size: 45px;color: #066737; text-align: center; margin-bottom: 0.5rem; font-family: " barlow",="" sans-serif;="" font-weight:="" 700;="" line-height:="" 1.2;="" color:="" #0b2154;"="">SHORT CLIPS</h1> </div> <div class="container-fluid"> <div class="row"> <?php include 'config.php'; // Fetching MP4 data from the database without pagination $sql = "SELECT * FROM mp4 ORDER BY mp4_id DESC LIMIT 6"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $videoPath = 'admin/uploads/mp4/' . $row['mp4_name']; $placeholderImage = 'admin/uploads/mp4/thumbnails/' . $row['thumbnail']; // Assuming a field named 'thumbnail' for the image in your database ?> <div class="col-lg-4"> <div class="video-box"> <video controls preload="none" poster="<?php echo $placeholderImage; ?>" class="lazy-load"> <source src="<?php echo $videoPath; ?>" type="video/mp4"> Your browser does not support the video tag. </video> <div class="shed"><img src="img/shed.png" width="100%" height="24px" alt="Image"> <div class="urdu"> <?php echo $row['urdu']; ?></div> <p><?php echo $row['mp4_title']; ?> <b>Date: <?php echo $row['mp4_date']; ?> </b></p> </div> <!-- Download button --> <a href="<?php echo $videoPath; ?>" download="<?php echo $row['mp4_name']; ?>" class="download-link">Download</a> </div> </div> <?php } } else { echo "<div class='col-md-12'><p>No MP4 videos found.</p></div>"; } ?> </div> </div> <!-- Bootstrap JS and your custom JavaScript --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script> <script> document.addEventListener("DOMContentLoaded", function() { var videos = document.querySelectorAll(".lazy-load"); videos.forEach(function(video) { video.addEventListener("click", function() { if (this.paused) { this.play(); } else { this.pause(); } }); }); }); </script> <!-------Mp4 download and watch---> <div class="space"> <a href="mp4.php">....View All Mp4</a> </div> <!-- Books Section --> <div class="container mt-5"> <h2 class="text-center mb-4">Books Collection</h2> <div class="row"> <?php // Fetch the latest 6 book records from the database $sql = "SELECT title, author, pdf_link, thumbnail, description FROM books ORDER BY id DESC LIMIT 6"; $result = $conn->query($sql); if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $thumbnail = htmlspecialchars($row['thumbnail']); $title = htmlspecialchars($row['title']); $author = htmlspecialchars($row['author']); $description = htmlspecialchars($row['description']); $pdfLink = htmlspecialchars($row['pdf_link']); ?> <div class="col-md-3 mb-3"> <div class="card h-100"> <img src="<?php echo $thumbnail; ?>" class="card-img-top" alt="<?php echo $title; ?>" style="height: auto; object-fit: cover;"> <div class="card-body"> <h5 class="card-title"><?php echo $title; ?></h5> <p class="card-text"><strong>Author:</strong> <?php echo $author; ?></p> <p class="card-text"><?php echo $description; ?></p> </div> <div class="card-footer text-center"> <a href="<?php echo $pdfLink; ?>" class="btn btn-primary" download>Download</a> </div> </div> </div> <?php } } else { echo "<p class='text-center'>No books available.</p>"; } $conn->close(); ?> <div class="space"> <a href="view_books.php">....View All books</a> </div> </div> </div> <!-- Footer Start --> <?php include 'include/footer.php'; ?> <!-- Footer 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>