<?php $__env->startSection('title'); ?> Parking Dashboard <?php $__env->stopSection(); ?>

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

<div class="col-lg-10 col-lg-offset-1">

    <h1><i class="fa fa-users"></i> Parking Dashboard <a href="/logout" class="btn btn-default pull-right">Logout</a></h1>

    <?php if(Session::has('success')): ?>
    <div class='alert alert-success'><?php echo Session::get('success'); ?></div>
    <?php endif; ?>

    <dl>
        <dt>Name</dt>
        <dd><?php echo $tenant->name; ?></dd>
        <dt>Apartment</dt>
        <dd><?php echo $tenant->apartment; ?></dd>
        <dt>Building</dt>
        <dd><?php echo $tenant->building->address; ?></dd>
        <dt>Nights Used</dt>
        <dd><strong><?php echo $tenant->nights_used; ?>/<?php echo $tenant->building->max_nights; ?></strong></dd>
    </dl>

    <a href="building/<?php echo $tenant->building->id; ?>/tenant/<?php echo $tenant->user->id; ?>/parking/create" class="btn btn-success">Create Parking Request</a>

    <h3>Active Parking Requests</h3>
    <div class="table-responsive">
        <table class="table table-bordered table-striped">

            <thead>
            <tr>
                <th>License Plate</th>
                <th>Make</th>
                <th>Model
                <th>Colour</th>
                <th>Nights</th>
                <th>Expires</th>
            </tr>
            </thead>

            <tbody>
            <?php foreach($parking_requests as $p): ?>
            <tr>
                <td><?php echo $p->car->license_plate; ?></td>
                <td><?php echo $p->car->make; ?></td>
                <td><?php echo $p->car->model; ?></td>
                <td><?php echo $p->car->colour; ?></td>
                <td><?php echo $p->nights; ?></td>
                <td><?php echo $p->active_until; ?></td>
            </tr>
            <?php endforeach; ?>
            </tbody>

        </table>
    </div>

</div>

<?php $__env->stopSection(); ?>