X7ROOT File Manager
Current Path:
/home/u742491609/domains/apca.org.in/public_html/admin
home
/
u742491609
/
domains
/
apca.org.in
/
public_html
/
admin
/
??
..
??
.htaccess
(98 B)
??
add-blog.php
(4.24 KB)
??
add-blog1.php
(3.14 KB)
??
add-blog2.php
(4.77 KB)
??
add-blog3.php
(3.71 KB)
??
all-blog.php
(5.62 KB)
??
all-blog1.php
(2.07 KB)
??
all-subscriber.php
(1.83 KB)
??
assets
??
connection.php
(675 B)
??
connectivity
??
convocation
??
dashboard.php
(1.57 KB)
??
delete-blog.php
(332 B)
??
edit-add-blog.php
(5.25 KB)
??
edit-add-blog1.php
(9.63 KB)
??
edit-blog.php
(5.12 KB)
??
error_log
(4.92 KB)
??
footer.php
(954 B)
??
header.php
(2.21 KB)
??
inaugration
??
index.php
(3.6 KB)
??
logout.php
(80 B)
??
others
??
passing-out-parade
??
republic-independence
??
short-term
??
sidebar.php
(4.43 KB)
??
track_visitors.php
(1.29 KB)
??
uploads
Editing: all-blog.php
<?php session_start(); $email = $_SESSION["email"]; if (!isset($_SESSION["email"])) { header("location: index.php"); exit; } include("../connection.php"); include 'header.php'; include 'sidebar.php'; ?> <div class="page-wrapper"> <div class="content container-fluid"> <div class="page-header"> <div class="row"> <div class="col"> <h3 class="page-title">Blog Table</h3> <ul class="breadcrumb"> <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li> / <li class="breadcrumb-item active">Blog Table</li> </ul> </div> <div class="col-auto text-end float-end ms-auto"> <a href="add-blog.php" class="btn btn-outline-primary me-2"><i class="fas fa-plus"></i> Add</a> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="datatable table table-stripped"> <thead> <tr> <th>Event Name</th> <th>Images</th> <th>Description</th> <th>Actions</th> </tr> </thead> <tbody> <?php $sql = $conn->prepare("SELECT * FROM `blog` ORDER BY `id` DESC"); $sql->execute(); if ($sql->rowCount() > 0) { $rows = $sql->fetchAll(); $eventGroups = []; // Group images by event names foreach ($rows as $row) { $eventGroups[$row['blog_name']][] = $row; } // Display each event and its images foreach ($eventGroups as $eventName => $eventImages) { $imageCount = 0; foreach ($eventImages as $image) { if ($imageCount % 5 == 0) { if ($imageCount > 0) { echo "</td></tr>"; } echo "<tr>"; echo "<td>{$eventName}</td>"; echo "<td>"; } echo "<img height='60' width='90' class='img-responsive' alt='" . htmlspecialchars($image['blog_name']) . "' src='../uploads/" . htmlspecialchars($image['img']) . "' style='margin-right: 10px;'/>"; $imageCount++; // Close the row and display description and actions if ($imageCount % 5 == 0 || $imageCount == count($eventImages)) { echo "</td><td>"; // Display the description $description = strip_tags($image['description']); if (strlen($description) > 85) { $description = substr($description, 0, 85) . '...'; } echo htmlspecialchars($description); echo "</td><td>"; // Actions echo "<a href='edit-blog.php?id=" . $image['id'] . "' class='btn btn-sm bg-success-light me-2'> <i class='fas fa-pen'></i> </a>"; echo "<a href='delete-blog.php?id=" . $image['id'] . "' onClick='return confirm(\"Do you want to delete this blog " . htmlspecialchars($image['blog_name']) . "?\");' class='btn btn-sm bg-danger-light'> <i class='fas fa-trash'></i> </a>"; echo "</td></tr>"; } } } } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>
Upload File
Create Folder