<script>
    function updateTimeCounter(level) {
        $.get("<?php echo e(url('api/levels')); ?>/" + level + "/timeCounter", {}, function(data) {
            $('#park-times').html(data);
            $('#park-cost').val('').parents('.row').addClass('d-none');
            $('#error').parents('.row').addClass('d-none').find('#message').html('');
        });
    }

    function setVehicleType(type) {
        $('input[name="vehicle_type_id"]').val(type);
    }

    function showError(message) {
        $('#error #message').html(message).parents('.row').removeClass('d-none');
        $('.btn.btn-outline-primary').parents('.row').addClass('d-none');
    }

    function showPayButton() {
        $('.btn.btn-outline-primary').parents('.row').removeClass('d-none');
    }
</script>
<?php if($levels->count()): ?>

    <?php
    $level = $levels->first();
    $area = $level->area;
    ?>

    <h5>Area</h5>
    <?php if($area->descrizione): ?>
    <p><?php echo e($area->descrizione); ?></p>
    <?php endif; ?>

    <?php if($levels->count() == 1): ?>
        <?php if($isHoliday && !$level->valido_festivo): ?>
        <h5 class="align-center">Oggi non &egrave; previsto il pagamento per la sosta.</h5>
        <?php else: ?>
        <h5>Dettaglio costi</h5>
        <?php echo $__env->make('levels.partials.details_single', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <?php endif; ?>
    <?php else: ?>
        <?php
        $area = $levels->first()->area
        ?>
        <h5 style="display: block;">Dettaglio costi</h5>
        <?php echo $__env->make('levels.partials.details_multi', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php endif; ?>

<?php else: ?>

<!-- No levels found -->

<?php endif; ?>
