:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/demo/jdc/new/admin/**
:: Editing File: images_products_add.php
<?php require_once 'db.php'; require_once 'session.php'; include "header.php"; // Fetch Collection Groups for the dropdown $collections = []; $sql_collections = "SELECT id, name FROM products ORDER BY id desc"; $result_collections = mysqli_query($conn, $sql_collections); if ($result_collections) { $collections = mysqli_fetch_all($result_collections, MYSQLI_ASSOC); } // NOTE: mysqli_close($conn); is typically called in footer.php or at the very end // of the main page content, so the connection is still open for the query above. ?> <div class="page-content-wrapper"> <div class="page-content"> <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3"> <div class="breadcrumb-title pe-3">Products</div> <div class="ps-3"> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0 p-0 align-items-center"> <li class="breadcrumb-item"><a href="dashboard.php"><ion-icon name="home-outline"></ion-icon></a> </li> <li class="breadcrumb-item active" aria-current="page">Add Images Product</li> </ol> </nav> </div> </div> <?php // Display session messages (success/error) if (isset($_SESSION['error'])): ?> <div class="alert alert-danger"><?php echo $_SESSION['error']; unset($_SESSION['error']); ?></div> <?php endif; ?> <div class="card"> <div class="card-header"> <h6 class="mb-0">Add Images Product</h6> </div> <div class="card-body"> <form action="images_products_save.php" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="mb-3 col-sm-6"> <label class="form-label">Select Products <span class="text-danger">*</span></label> <select class="form-control" name="gropus_id" required> <option value="">-- Select Products --</option> <?php foreach ($collections as $collection): ?> <option value="<?php echo htmlspecialchars($collection['id']); ?>"> <?php echo htmlspecialchars($collection['name']); ?> </option> <?php endforeach; ?> </select> </div> <div class="mb-3 col-sm-6"> <label class="form-label">Image Upload </label> <input type="file" class="form-control" name="image" accept="image/*"> </div> <div class="col-12 mt-4"> <button type="submit" class="btn btn-primary">Save Product Image</button> <a href="images_products.php" class="btn btn-warning">Back to List</a> </div> </div> </form> </div> </div> </div> </div> <?php mysqli_close($conn); // Close connection after all queries are done include "footer.php"; ?>