<?php $__env->startSection('title'); ?>
    <i class="icon icon-incoming-requests"></i> Incoming <?php echo e(strtoupper($type)); ?> Requests
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <ul class="nav nav-tabs nav-justified" role="tablist">
        <li class="active"><a href="#pending" role="tab" data-toggle="tab">Pending</a></li>
        <li><a href="#history" role="tab" data-toggle="tab">History</a></li>
    </ul>
    <!-- TAB CONTENT -->
    <div class="tab-content">
        <div class="active tab-pane fade in" id="pending">
            <div class="table-responsive">
                <table class="table hr-table table-hover">
                    <thead>
                    <tr>
                        <th> #</th>
                        <th> Request</th>
                        <th> From</th>
                        <th> Received</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php $index = 1; ?>
                    <?php foreach($incoming_requests as $incoming): ?>
                        <?php if($incoming->type == $type && $incoming->status == 'pending'): ?>
                            <tr>
                                <td> <?php echo e($index++); ?></td>
                                <td>
                                    <a href="<?php echo e(URL::action('UserController@getRequestDetails',['id'=>$incoming->id])); ?>"> <?php echo e($incoming->request); ?> </a>
                                </td>
                                <td> <?php echo e($incoming->sender); ?></td>
                                <td> <?php echo e(\Carbon\Carbon::parse($incoming->request_date)->diffForHumans()); ?></td>
                            </tr>
                        <?php endif; ?>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="tab-pane fade" id="history">
            <div class="table-responsive">
                <table class="table hr-table table-hover">
                    <thead>
                    <tr>
                        <th> #</th>
                        <th> Request</th>
                        <th> From</th>
                        <th> Received</th>
                        <th> Status</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php $index = 1; ?>
                    <?php foreach($incoming_requests as $incoming): ?>
                        <?php if($incoming->type == $type && $incoming->status != 'pending'): ?>
                            <tr>
                                <td> <?php echo e($index++); ?></td>
                                <td>
                                    <a href="<?php echo e(URL::action('UserController@getRequestDetails',['id'=>$incoming->id])); ?>"> <?php echo e($incoming->request); ?> </a>
                                </td>
                                <td> <?php echo e($incoming->sender); ?></td>
                                <td> <?php echo e(\Carbon\Carbon::parse($incoming->request_date)->diffForHumans()); ?></td>
                                <td> <?php echo e($incoming->status); ?></td>
                            </tr>
                        <?php endif; ?>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

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