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

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

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

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

    <div class="table-responsive">
        <table class="table table-bordered table-striped">

            <thead>
                <tr>
                    <th>License Plate</th>
                    <th>Building</th>
                    <th>Make</th>
                    <th>Model</th>
                    <th>Colour</th>
                    <th>Days</th>
                    <th>Date/Time Added</th>
                    <th></th>
                </tr>
            </thead>

            <tbody>
                <?php foreach($parking_requests as $p): ?>
                <tr>
                    <td><?php echo $p->license_plate; ?></td>
                    <td><?php echo Building::find($p->building_id)->address; ?></td>
                    <td><?php echo $p->make; ?></td>
                    <td><?php echo $p->model; ?></td>
                    <td><?php echo $p->colour; ?></td>
                    <td><?php echo $p->days; ?></td>
                    <td><?php echo $p->created_at->format('F d, Y h:ia'); ?></td>
                    <td>
                        <a href="parking/<?php echo $p->id; ?>/edit" class="btn btn-info pull-left" style="margin-right: 3px;">Edit</a>
                        <?php echo Form::open(['url' => 'parking/' . $p->id, 'method' => 'DELETE']); ?>

                        <?php echo Form::submit('Delete', ['class' => 'btn btn-danger']); ?>

                        <?php echo Form::close(); ?>

                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>

        </table>
    </div>

    <a href="parking/create" class="btn btn-success">Add Parking Request</a>

</div>

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

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