관리-도구
편집 파일: eebe096250535acbdd903ad8be536e0b.php
<?php $__env->startSection('content'); ?> <div class="main-panel"> <div class="content-wrapper"> <div class="row"> <div class="col-lg-12 grid-margin stretch-card"> <div class="card"> <div class="card-body"> <div class="d-flex justify-content-between"> <h3><b>Products</b></h3> <button class="btn btn-success" data-toggle="modal" data-target="#addProject">Add Product +</button> </div> <hr> <div class="table-responsive"> <table class="table table-hover"> <thead> <tr> <th>#</th> <th>Category</th> <th>Images</th> <th class="text-center">Action</th> </tr> </thead> <tbody> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($loop->iteration); ?></td> <td><?php echo e(optional($project->category)->productcategory); ?></td> <td> <?php if($project->images): ?> <?php $__currentLoopData = json_decode($project->images); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $img): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <img src="<?php echo e(asset('storage/'.$img)); ?>" style="width:60px;height:60px;object-fit:cover;"> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </td> <td class="text-center"> <button class="btn btn-primary" data-toggle="modal" data-target="#updateProject<?php echo e($project->id); ?>"> Edit </button> <form method="post" action="<?php echo e(route('admin-products.destroy', $project->id)); ?>" style="display:inline-block"> <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?> <button class="btn btn-danger">Delete</button> </form> </td> </tr> <!-- Update Modal --> <div class="modal fade" id="updateProject<?php echo e($project->id); ?>"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5>Update Product</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body"> <form method="post" action="<?php echo e(route('admin-products.update', $project->id)); ?>" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?> <div class="form-group"> <label>Product Category</label> <select class="form-control" name="productcategory_id" required> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($cat->id); ?>" <?php echo e($project->productcategory_id == $cat->id ? 'selected' : ''); ?>> <?php echo e($cat->productcategory); ?> </option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="form-group"> <label>Upload Images (Multiple)</label> <input type="file" name="images[]" class="form-control" accept="image/*" multiple> </div> <button type="submit" class="btn btn-primary w-100">Update</button> </form> </div> </div> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> <!-- Add Modal --> <div class="modal fade" id="addProject"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5>Add Product</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body"> <form method="post" action="<?php echo e(route('admin-products.store')); ?>" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <div class="form-group"> <label>Product Category</label> <select class="form-control" name="productcategory_id" required> <option value="">Select Category</option> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($cat->id); ?>"><?php echo e($cat->productcategory); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="form-group"> <label>Images (Multiple)</label> <input type="file" name="images[]" class="form-control" accept="image/*" multiple> </div> <button type="submit" class="btn btn-primary w-100">Submit</button> </form> </div> </div> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u539723576/domains/ictglobaltech.com/public_html/roomgeardesigns/resources/views/admin/products.blade.php ENDPATH**/ ?>