X7ROOT File Manager
Current Path:
/home/u742491609/domains/apca.org.in/public_html/admin/convocation
home
/
u742491609
/
domains
/
apca.org.in
/
public_html
/
admin
/
convocation
/
??
..
??
admin_panel.php
(5.76 KB)
??
config.php
(611 B)
??
create_database.php
(1.32 KB)
??
delete_image.php
(203 B)
??
delete_section.php
(222 B)
??
edit_image.php
(1.64 KB)
??
edit_section.php
(4.23 KB)
??
gallery.php
(2.34 KB)
??
sidebar.php
(4.46 KB)
??
upload.php
(1.88 KB)
??
upload_additional_images.php
(1.24 KB)
??
uploads
??
uploads1746012611_DSC15.JPG
(7.3 MB)
??
uploads1746012612_DSC11.JPG
(6.15 MB)
??
uploads1746012612_DSC13.JPG
(6.51 MB)
??
uploads1746012612_DSC14.JPG
(7.1 MB)
??
uploads1746012613_DSC12.JPG
(5.92 MB)
??
uploads1746012685_DSC11.JPG
(6.15 MB)
??
uploads1746012685_DSC12.JPG
(5.92 MB)
??
uploads1746012685_DSC13.JPG
(6.51 MB)
??
uploads1746012685_DSC14.JPG
(7.1 MB)
??
uploads1746012928_DSC11.JPG
(6.15 MB)
??
uploads1746012978_DSC12.JPG
(5.92 MB)
??
uploads1746012978_DSC13.JPG
(6.51 MB)
??
uploads1746012978_DSC14.JPG
(7.1 MB)
??
uploads1746013264_DSC4.JPG
(6.11 MB)
??
uploads1746013264_DSC5.JPG
(5.59 MB)
??
uploads1746013910_DSC2.JPG
(6.51 MB)
??
uploads1746013936_DSC2.JPG
(6.51 MB)
??
uploads1746013949_DSC1.JPG
(6.41 MB)
??
uploads1746014085_DSC1.JPG
(6.41 MB)
??
uploads1746014085_DSC2.JPG
(6.51 MB)
Editing: edit_section.php
<?php require '../connection.php'; $id = $_GET['id']; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $title = $_POST['title']; $description = $_POST['description']; // Handle image upload $image_paths = []; if (!empty($_FILES['images']['name'][0])) { foreach ($_FILES['images']['tmp_name'] as $key => $tmp_name) { $file_name = $_FILES['images']['name'][$key]; $file_tmp = $_FILES['images']['tmp_name'][$key]; $upload_path = "../uploads/" . $file_name; move_uploaded_file($file_tmp, $upload_path); $image_paths[] = $upload_path; } } // Convert image paths to a string $images = implode(',', $image_paths); $sql = "UPDATE convocation SET title = ?, description = ?, image_path = ? WHERE id = ?"; $stmt = $pdo->prepare($sql); $stmt->execute([$title, $description, $images, $id]); header("Location: admin_panel.php"); exit; } // Fetch the current record $stmt = $pdo->prepare("SELECT * FROM convocation WHERE id = ?"); $stmt->execute([$id]); $section = $stmt->fetch(PDO::FETCH_ASSOC); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Edit Section</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"> <link rel="shortcut icon" href="../assets/img/favicon.png"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,500;0,600;0,700;1,400&display=swap"> <link rel="stylesheet" href="../assets/plugins/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="../assets/plugins/fontawesome/css/fontawesome.min.css"> <link rel="stylesheet" href="../assets/plugins/fontawesome/css/all.min.css"> <link rel="stylesheet" href="../assets/plugins/datatables/datatables.min.css"> <link rel="stylesheet" href="../assets/css/style.css"> </head> <body> <!-- Navbar --> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Admin Panel</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <?php include 'sidebar.php'; ?> </div> </nav> <!-- Main Content --> <div class="container-fluid"> <div class="row"> <!-- Sidebar --> <div class="col-sm-3"> <?php include 'sidebar.php'; ?> </div> <!-- Edit Section Form --> <div class="col-sm-9 mt-5"> <h1>Edit Section</h1> <form method="POST" enctype="multipart/form-data"> <div class="form-group"> <label for="title">Title:</label> <input type="text" name="title" class="form-control" value="<?php echo htmlspecialchars($section['title']); ?>" required> </div> <div class="form-group"> <label for="description">Description:</label> <textarea name="description" class="form-control" required><?php echo htmlspecialchars($section['description']); ?></textarea> </div> <div class="form-group"> <label for="images">Images:</label> <input type="file" name="images[]" class="form-control" multiple> </div> <button type="submit" class="btn btn-primary">Update</button> </form> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Upload File
Create Folder