<?php $__env->startSection('title', 'View business details'); ?>

<?php $__env->startSection('content'); ?>

    <div class="page-header clearfix">
        <h1 class="pull-left">Business details <small><?php echo e($business->name); ?></small></h1>
        <a href="<?php echo e(URL::route('admin.business.edit', $business->id)); ?>" class="btn btn-default pull-right">Edit details</a>
    </div>

    <h3>Introduction</h3>

    <?php echo e($business->introduction); ?>


    <h3>Details</h3>

    <?php echo e($business->details); ?>


    <h3>Location</h3>

    <div class="business-map" id="map-container" data-lat="<?php echo e($business->latitude); ?>" data-lng="<?php echo e($business->longitude); ?>"></div>

    <h3>Actions</h3>

    <table class="table table-striped">
        <thead>
            <tr>
                <th>Action Name</th>
                <th>Multiplier</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php if(!count($business->actions)): ?>
                <tr>
                    <td colspan="3" class="text-center">No actions assigned. Why not, <a href="<?php echo e(URL::route('admin.assignedActions.create')); ?>">assign one</a>?</td>
                </tr>
            <?php endif; ?>

            <?php foreach($business->actions as $action): ?>
                <tr>
                    <td><?php echo e(($action->pivot->modifier === 1) ? $action->name : $action->plural); ?></td>
                    <td><?php echo e($action->pivot->modifier); ?></td>
                    <td>
                        <a class="btn btn-default" href="<?php echo e(URL::route('admin.assignedActions.edit', ['business', $action->id, $business->id])); ?>">Edit action</a>&nbsp;
                        <form action="<?php echo e(URL::route('admin.assignedActions.destroy', ['business', $action->id, $business->id])); ?>" class="inline delete-form" method="post">
                            <?php echo csrf_field(); ?>

                            <input type="hidden" name="_method" value="DELETE">
                            <button class="btn btn-danger">Delete</button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdJic7fQgvnpKi6WS_leNp426ub4--uy4"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>