<?php $__env->startSection('actions'); ?>
    <div class="btn-group">
        <a href="<?php echo e(URL::action('LocationController@getAddLocation')); ?>" type="button" class="btn btn-dark">
            Add a Location
        </a>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('title'); ?>
    <i class="icon icon-location"></i> Locations
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="table-responsive">
        <table class="table hr-table table-hover">
            <thead>
            <tr>
                <th> Name</th>
                <th> Working Days</th>
                <th>Actions</th>
            </tr>
            </thead>
            <tbody>

            <?php foreach($locations as $item): ?>
                <tr>
                    <td> <?php echo e($item->name); ?></td>
                    <td> <?php echo e($item->working_days); ?></td>
                    <td>
                        <div class="hr-actions-cell">
                            <a href="<?php echo e(URL::action('LocationController@getEditLocation',['id'=>$item->id])); ?>"
                               class="btn btn-dark">
                                Edit
                            </a>
                            <a href="#delete_location_<?php echo e($item->id); ?>" data-toggle="modal"
                               class="btn btn-red">
                                Delete
                            </a>
                        </div>
                        <div class="modal fade" id="delete_location_<?php echo e($item->id); ?>">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-body">
                                        <form class="form" method="post"
                                              action="<?php echo e(URL::action('LocationController@postDeleteLocation')); ?>">
                                            <?php echo csrf_field(); ?>

                                            <label class="control-label">Are you sure you want to delete the
                                                Location "<?php echo e($item->name); ?>"</label>
                                            <input type="hidden" name="location_id" value="<?php echo e($item->id); ?>">
                                            <button type="submit" class="btn btn-red">Delete</button>
                                            <button type="button" data-dismiss="modal" class="btn btn-dark">
                                                Back to safety
                                            </button>
                                        </form>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>