/
var
/
www
/
html
/
cravings
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('extrastyle'); ?> <style> .form-check-input { position: relative; margin-left: 0; } </style> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <?php if(count($places)): ?> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <form action="<?php echo e(route('populate_franchise')); ?>" method="POST"> <?php echo csrf_field(); ?> <div class="form-group"> <label for="franchise-name">Franchise Place</label> <select name="franchise-place" class="form-control source-select"> <option value="">Select Source Place</option> <?php $__currentLoopData = $places; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $place): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($place['slug']); ?>"><?php echo e($place['name']); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="populate-selections" style="display: flex; align-items: center; gap: 15px;"> <div class="form-group"> <input class="form-check-input" type="checkbox" name="props[]" value="type" id="checkType"> <label class="form-check-label" for="checkType"> Type </label> </div> <div class="form-group"> <input class="form-check-input" type="checkbox" name="props[]" value="food" id="checkFood"> <label class="form-check-label" for="checkFood"> Food </label> </div> <div class="form-group"> <input class="form-check-input" type="checkbox" name="props[]" value="phones" id="checkPhone"> <label class="form-check-label" for="checkPhone"> Phone </label> </div> <div class="form-group"> <input class="form-check-input" type="checkbox" name="props[]" value="tags" id="checkTags"> <label class="form-check-label" for="checkTags"> Tags </label> </div> <div class="form-group"> <input class="form-check-input" type="checkbox" name="props[]" value="opening" id="checkopening"> <label class="form-check-label" for="checkopening"> Opening and Closing </label> </div> </div> <button class="btn btn-primary populate-button">Populate</button> <?php $__currentLoopData = $places; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $place): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <table class="table source-details" id="<?php echo e($place['slug']); ?>" style="display: none"> <thead class="text-primary"> <tr> <th>Name</th> <th>Phone 1</th> <th>Opening</th> <th>Closing</th> <th>Type</th> <th>Food Count</th> <th>Created</th> </tr> </thead> <tbody> <tr> <td><?php echo e($place['name']); ?></td> <td><?php echo e($place['phones'][0] ?? ''); ?></td> <td><?php echo e($place['opening'] ?? ''); ?></td> <td><?php echo e($place['closing'] ?? ''); ?></td> <td><?php echo e($place['type'] ?? ''); ?></td> <td> </td> <td><?php echo e($place['created'] ?? ''); ?></td> </tr> <tr> <td colspan="10"> <?php $__currentLoopData = $place['food']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $food): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge badge-warning"><?php echo e($food['name']); ?></span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </td> </tr> <?php if(isset($place['tags'])): ?> <tr> <td colspan="10"> <?php $__currentLoopData = $place['tags']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge-primary" style="padding: 3px;"><?php echo e($tag); ?></span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </td> </tr> <?php endif; ?> </tbody> </table> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php echo csrf_field(); ?> <div class="table-responsive"> <table class="table"> <thead class="text-primary"> <tr> <th>Place Name</th> <th>Populate? <div><small><label for="select-all">Select All</label><input type="checkbox" id="select-all"></small></div></th> </tr> </thead> <tbody> <?php $__currentLoopData = $places; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $place): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($place['name']); ?></td> <td> <input type="checkbox" class="franchise-input" name="franchise[]" value="<?php echo e($place['slug']); ?>::<?php echo e($place['name']); ?>"> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </form> </div> </div> </div> </div> <?php endif; ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('scripts'); ?> <script> document.querySelector('#select-all').addEventListener('change', function() { var checkboxes = document.querySelectorAll('.franchise-input'); for (var i = 0; i < checkboxes.length; i++) { checkboxes[i].checked = this.checked; } }); document.querySelector('.source-select').addEventListener('change', function(e) { let selected = e.target.value; document.querySelectorAll('.source-details').forEach(source => { source.style.display = 'none'; }) let s = `#${selected}`; document.querySelector(s).style.display = 'block'; }) </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/cravings/resources/views/admin/franchise_populate.blade.php ENDPATH**/ ?>