OwlCyberSecurity - MANAGER
Edit File: 70820e2fd2e89278c065f1e4feeca787.php
<?php $__env->startSection('content'); ?> <style> .error_div { background-color: #ffc8c8; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #f11a1a; border: 1px solid #ff2a2a; } .success_div { background-color: #aedcaf; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #1f6d26; border: 1px solid #248526; } </style> <div class="row p-2"> <div class="col-12"> <h3>Edit Store</h3> </div> </div> <div class="row p-2"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="row"> <?php if(!empty($errors->all())): ?> <div class="col-12 error_div"> <?php echo e($errors->first()); ?> </div> <?php endif; ?> <?php if(session()->has('message')): ?> <div class="col-12 error_div"> <?php echo e(session()->get('message')); ?> </div> <?php endif; ?> <?php if(session()->has('success')): ?> <div class="col-12 success_div"> <?php echo e(session()->get('success')); ?> </div> <?php endif; ?> </div> <form action="<?php echo e(route('post_stores_edit.edit_stores' , ['id' => $store->id])); ?>" method="POST" autocomplete="off" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <label for="title" class="form-label">Title</label> <input type="text" name="title" id="title" class="form-control" autofocus value="<?php echo e(old('title') ?? $store->title); ?>"> </div> </div> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="slug" class="form-label">Slug</label> <input type="text" name="slug" id="slug" class="form-control" autofocus value="<?php echo e(old('slug') ?? $store->slug); ?>"> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="short_name" class="form-label">Short Name</label> <input type="text" name="short_name" id="short_name" class="form-control" autofocus value="<?php echo e(old('short_name') ?? $store->short_name); ?>"> </div> </div> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="url" class="form-label">URL</label> <input type="text" name="url" id="url" class="form-control" autofocus value="<?php echo e(old('url') ?? $store->url); ?>"> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="destination_url" class="form-label">Destination URL</label> <input type="text" name="destination_url" id="destination_url" class="form-control" autofocus value="<?php echo e(old('destination_url') ?? $store->destination_url); ?>"> </div> </div> <div class="row pt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="category" class="form-label">Category</label> <select name="category" id="category" class="form-control"> <option value="0">Select category</option> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($c->id); ?>" <?php echo e(old('category') == $c->id ? "selected" : ($store->category_id == $c->id ? "selected" : "")); ?>><?php echo e(ucfirst($c->name)); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="network" class="form-label">Network</label> <select name="network" id="network" class="form-control"> <option value="0">Select network</option> <?php $__currentLoopData = $networks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $n): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($n->id); ?>" <?php echo e(old('network') == $n->id ? "selected" : ($store->network_id == $n->id ? "selected" : "")); ?>><?php echo e(ucfirst($n->name)); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row pt-2"> <div class="col-12"> <label for="description" class="form-label">Short Description</label> <textarea rows="6" name="description" id="description" class="form-control"><?php if(old('description')): ?><?php echo e(old('description')); ?><?php elseif(!empty($store->description)): ?><?php echo e($store->description); ?><?php endif; ?></textarea> </div> </div> <div class="row pt-2"> <div class="col-12"> <label for="long_description" class="form-label">Long Description</label> <textarea name="long_description" id="long_description"><?php if(old('long_description')): ?><?php echo e(old('long_description')); ?><?php elseif(!empty($store->long_description)): ?><?php echo e($store->long_description); ?><?php endif; ?></textarea> </div> </div> <div class="row pt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="meta_title" class="form-label">Meta Title</label> <input type="text" name="meta_title" id="meta_title" class="form-control" autofocus value="<?php echo e(old('meta_title') ?? $store->meta_title); ?>"> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="keywords" class="form-label">Keywords</label> <select name="keywords[]" id="keywords" class="form-control" multiple> <?php if(is_array(old('keywords'))): ?> <?php $__currentLoopData = old('keywords'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keyword): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($keyword); ?>" selected="selected"><?php echo e($keyword); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php elseif(is_array(explode(',',$store->meta_keywords)) && !empty($store->meta_keywords)): ?> <?php $__currentLoopData = explode(',',$store->meta_keywords); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keyword): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($keyword); ?>" selected="selected"><?php echo e($keyword); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </select> <small><i>comma separated keywords</i></small> </div> </div> <div class="row pt-2"> <div class="col-12"> <label for="meta_description" class="form-label">Meta Description</label> <textarea name="meta_description" class="form-control" id="meta_description"><?php if(old('meta_description')): ?><?php echo e(old('meta_description')); ?><?php elseif(!empty($store->meta_description)): ?><?php echo e($store->meta_description); ?><?php endif; ?></textarea> </div> </div> <div class="row pt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="image" class="form-label">Image</label> <?php if(isset($store->image) && !empty($store->image)): ?> <div class="mb-4" id="image_holder"> <div class="row"> <div class="text-right" style="width: 220px;" id="image_delete_icon_holder"> <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;" title="delete image" onclick="deleteImage('<?php echo e($store->id); ?>')"></i> </div> <div class="col-12"> <img src="<?php echo e(url('storage/store_images/'.$store->image)); ?>" alt="Store image" width="200px"> </div> </div> </div> <?php endif; ?> <div> <input type="file" name="image" id="image"> </div> </div> </div> <div class="row pt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="og_image" class="form-label">Open Graph Image</label> <?php if(isset($store->og_image) && !empty($store->og_image)): ?> <div class="mb-4" id="image_holder"> <div class="row"> <!-- <div class="text-right" style="width: 220px;" id="image_delete_icon_holder"> <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;" title="delete image" onclick="deleteImage('<?php echo e($store->id); ?>')"></i> </div> --> <div class="col-12"> <img src="<?php echo e(url('storage/store_images/'.$store->og_image)); ?>" alt="Store open graph image" width="200px"> </div> </div> </div> <?php endif; ?> <div> <input type="file" name="og_image" id="og_image"> </div> </div> </div> <div class="row mt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="status" class="form-label">Status</label> <br> <label><input type="radio" name="status" <?php echo e((old('status') != null && old('status') == 1 ? 'checked' : ($store->status == 1 ? 'checked' : ''))); ?> value="1" style="vertical-align: middle;"> Active </label> <label><input type="radio" name="status" <?php echo e((old('status') != null && old('status') == 0 ? 'checked' : ($store->status == 0 ? 'checked' : ''))); ?> value="0" style="vertical-align: middle;"> Inactive</label> </div> </div> <div class="row mt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label class="form-label">Authentications</label> <br> <label><input type="checkbox" name="is_featured" <?php echo e((old('is_featured') != null && old('is_featured') == 1 ? 'checked' : ($store->is_featured == 1 ? 'checked' : ''))); ?> value="1" style="vertical-align: middle;"> Featured </label> <br> <label><input type="checkbox" name="is_top_store" <?php echo e((old('is_top_store') != null && old('is_top_store') == 1 ? 'checked' : ($store->is_top_store == 1 ? 'checked' : ''))); ?> value="1" style="vertical-align: middle;"> Top Store </label> </div> </div> <div class="row pt-4"> <div class="col-lg-6 col-md-6 col-sm-12"> <button type="submit" class="custom-blue-btn width-5-rem ">Save</button> <a href="<?php echo e(route('get_stores_index.view_stores')); ?>"><button type="button" class="custom-grey-btn width-5-rem">Cancel</button></a> </div> </div> </form> </div> </div> </div> </div> <script> // for messages function StoreEditMessage(type = '', message = '', timeout = 3000) { var selectedClass = ''; var holder = $('#storeEditMessageDiv'); if (type.toLowerCase() == 'success') { selectedClass = 'success_div'; } else { selectedClass = 'error_div'; } var ht = `<div class="${selectedClass}">${message}</div>`; holder.html(ht); holder.hide().show().fadeIn('fast').delay(timeout).fadeOut('slow', function() { $(this).stop(true); }); } // delete image function deleteImage(id) { $.ajax({ url: "<?php echo e(route('post_stores_delete_image.delete_stores' , ['id' => 'sID' ])); ?>/".replace('sID', id), type: "POST", dataType: "JSON", data: { _token: "<?php echo e(csrf_token()); ?>" }, beforeSend: function() { $('#image_delete_icon_holder').html('<span class="spinner-border" style="width: 15px; height: 15px;"></span>'); $('#form-submit-button').hide(); }, success: function(res) { StoreEditMessage('success', res.message); $('#image_holder').remove(); }, error: function(res) { StoreEditMessage('message', res.responseJSON.message); console.log(res.responseJSON.message); }, complete: function() { $('#form-submit-button').show(); } }) } // document ready start $(document).ready(function() { $('#slug').change(function() { var str = $(this).val(); str = str.replace(/\s+/g, '-').toLowerCase(); $('#slug').val(str); }); $('#long_description').summernote({ placeholder: '<small>Description...</small>', tabsize: 2, height: 100, // toolbar: [ // // [groupName, [list of button]] // ['style', ['bold', 'italic', 'underline']], // ['font', ['strikethrough']], // ['fontsize', ['fontsize']], // ['color', ['color']], // ], disableDragAndDrop: false, callbacks: { onImageUpload: function(data) { data.pop(); } }, }); $('#keywords').select2({ tags: true, multiple: true, tokenSeparators: [','] }); }); // document ready end // error and success div timouts setTimeout(() => { $('.error_div').fadeOut('slow'); $('.success_div').fadeOut('slow'); }, 3000); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('master.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/frugalsvn/public_html/resources/views/Stores/edit.blade.php ENDPATH**/ ?>