관리-도구
편집 파일: b260341a9f194f80a1e0078fc0eb2b6a.php
<?php $__env->startSection('content'); ?> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Bootstrap 4 CSS --> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> <!-- Bootstrap 4 JS + Popper --> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <!-- Summernote --> <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script> <!-- partial --> <div class="main-panel"> <div class="content-wrapper"> <style> .description-cell { max-width: 200px; /* Adjust the value as needed */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } </style> <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 class="text-center"><b>Blog</b></h3> <button class="btn btn-success" data-toggle="modal" data-target="#addslider">Add New Blog +</button> </div> <hr> <div class="table-responsive"> <table class="table table-hover"> <thead> <tr> <th>#</th> <th>Blog</th> <th>Date</th> <th>Details</th> <!-- <th>Image</th> --> <th class="text-center">Action</th> </tr> </thead> <tbody> <?php $__currentLoopData = $sliders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($loop->iteration); ?></td> <td><?php echo e($slider->blog); ?></td> <td class="description-cell"> <?php echo e(\Carbon\Carbon::parse($slider->date)->format('F j, Y')); ?> </td> <td class="description-cell"><?php echo $slider->details; ?></td> <!-- <td><img src="<?php echo e(asset('storage/' . $slider->image)); ?>" alt=""></td> --> <td class="text-center"> <button class="btn btn-primary my-2" data-toggle="modal" data-target="#updateslider<?php echo e($slider->id); ?>"><i class="fa fa-pen"></i></button> <form method="post" action="<?php echo e(route('admin-blog.destroy', $slider->id)); ?>"> <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?> <button class="btn btn-danger my-2"><i class="fa fa-trash"></i></button> </form> </td> </tr> <!--update slider Modal --> <div class="modal fade" id="updateslider<?php echo e($slider->id); ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Update Blog</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="card"> <div class="card-body"> <form method="post" action="<?php echo e(route('admin-blog.update', $slider->id)); ?>" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?> <div class="form-group"> <label for="exampleInputTitle">Blog</label> <input type="text" name="blog" value="<?php echo e($slider->blog); ?>" class="form-control" id="exampleInputTitle" placeholder="Enter Blog"> </div> <!-- <div class="form-group"> <label for="exampleInputImage">Image</label> <input type="file" name="image" class="form-control" id="exampleInputImage" placeholder="Upload slider image"> <?php if($slider->image): ?> <div> <img src="<?php echo e(asset('storage/' . $slider->image)); ?>" alt="Selected Image" style="max-width: 100px; max-height: 100px;"> </div> <?php endif; ?> </div> --> <div class="form-group"> <label for="exampleInputTitle">Date</label> <input type="text" name="date" value="<?php echo e($slider->date); ?>" class="form-control" id="exampleInputTitle" placeholder="Enter Date"> </div> <div class="form-group"> <label for="exampleInputDescription2">Details</label> <textarea class="form-control summernotes" name="details" id="exampleInputDescription2" rows="4" placeholder="Enter details"><?php echo e($slider->details); ?></textarea> </div> <div class="text-center"> <button type="submit" class="btn btn-primary w-50">Submit</button> </div> </form> </div> </div> </div> </div> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- content-wrapper ends --> <!--Add slider Modal --> <div class="modal fade" id="addslider" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Add New Blog</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="card"> <div class="card-body"> <form method="POST" action="<?php echo e(route('admin-blog.store')); ?>" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <div class="form-group"> <label for="exampleInputTitle">Blog</label> <input type="text" name="blog" class="form-control" id="exampleInputTitle" placeholder="Blog" value="<?php echo e(old('blog')); ?>"> <?php $__errorArgs = ['blog']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <div class="alert alert-danger"><?php echo e($message); ?></div> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div> <div class="form-group"> <label for="exampleInputTitle">Date</label> <input type="date" name="date" class="form-control" id="exampleInputTitle" placeholder="Date" value="<?php echo e(old('date')); ?>"> <?php $__errorArgs = ['date']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <div class="alert alert-danger"><?php echo e($message); ?></div> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div> <!-- <div class="form-group"> <label for="exampleInputImage">Image</label> <input type="file" name="image" class="form-control" id="exampleInputImage"> <?php $__errorArgs = ['image']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <div class="alert alert-danger"><?php echo e($message); ?></div> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div>--> <div class="form-group"> <label for="exampleInputdescription">Details</label> <textarea class="form-control summernote" name="details" id="exampleInputdescription" rows="4" placeholder="Enter details"><?php echo e(old('details')); ?></textarea> <?php $__errorArgs = ['description']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <div class="alert alert-danger"><?php echo e($message); ?></div> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div> <div class="text-center"> <button type="submit" class="btn btn-primary w-50">Submit</button> </div> </form> </div> </div> </div> </div> </div> </div> <script> function initSummernote(selector) { $(selector).summernote({ placeholder: 'Description', height: 120, toolbar: [ ['style', ['style']], ['font', ['bold', 'underline', 'clear']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['insert', ['link', 'picture']], ['view', ['fullscreen', 'codeview']] ], callbacks: { onImageUpload: function(files) { uploadSummernoteImage(files[0], this); } } }); } function uploadSummernoteImage(file, editor) { let data = new FormData(); data.append('image', file); data.append('_token', '<?php echo e(csrf_token()); ?>'); $.ajax({ url: '<?php echo e(route("summernote.upload")); ?>', method: 'POST', data: data, processData: false, contentType: false, success: function(response) { $(editor).summernote('insertImage', response.url); }, error: function() { alert('Image upload failed'); } }); } $(document).ready(function() { initSummernote('.summernote'); initSummernote('.summernotes'); }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u539723576/domains/doctorashna.com/public_html/resources/views/admin/blog.blade.php ENDPATH**/ ?>