<?php $__env->startSection('title'); ?> <?php if( ! empty($title)): ?> <?php echo e($title); ?> | <?php endif; ?> ##parent-placeholder-3c6de1b7dd91465d437ef415f94f36afc1fbc8a8## <?php $__env->stopSection(); ?>

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

    <div class="">
        <div id="wrapper">

            <?php echo $__env->make('admin.sidebar_menu', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

            <div id="page-wrapper">
                <?php if( ! empty($title)): ?>
                    <div class="row">
                        <div class="col-lg-12">
                            <h1 class="page-header"> <?php echo e($title); ?>  </h1>
                        </div> <!-- /.col-lg-12 -->
                    </div> <!-- /.row -->
                <?php endif; ?>
                <?php echo $__env->make('admin.flash_msg', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                <div class="row">
                    
                    <div class="col-sm-12">
                        <?php if(isset($properties_added)): ?>
                        <table style="width:100%">
                          <tr>
                            <th>Agent Name</th>
                            <th>Phone Number</th>
                            <th>Property Name</th>
                            <th>Property Status</th>
                            <th>Accept/Reject</th>
                          </tr>
                          <?php $__currentLoopData = $properties_added; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $property_added): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          <?php
                          $ad = App\Ad::find($property_added->property_id);
                          $agent_added = App\User::find($property_added->agent_id);
                          
                          ?>
                          <tr >
                            <td style="padding:20px 5px"><?php echo e($agent_added->name); ?></td>
                            <td style="padding:20px 5px"><?php echo e($agent_added->phone); ?></td>
                            <td style="padding:20px 5px"><?php echo e($ad->title); ?></td>
                            <td style="padding:20px 5px">
                                <?php if($ad->status == 0): ?>
                                PENDING
                                <?php elseif($ad->status == 1): ?>
                                APPROVED
                                <?php elseif($ad->status == 2): ?>
                                BLOCKED
                                <?php endif; ?>
                            </td>
                            <td style="padding:20px 5px">
                                <?php if($property_added->accepted == 0): ?>
                                <a href="<?php echo e(route('ad-accept-invite',['invite_id'=>$property_added->id,'answer'=>1])); ?>" class="btn btn-success"> ACCEPT </a> 
                                <a href="<?php echo e(route('ad-accept-invite',['invite_id'=>$property_added->id,'answer'=>2])); ?>" class="btn btn-danger" style="margin-left:5px;"> REJECT </a>
                                <?php else: ?>
                                    <?php if($property_added->accepted == 1): ?>
                                    ACCEPTED
                                    <?php else: ?>
                                    REJECTED
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                          </tr>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          
                        </table>
                        <?php else: ?>
                        <h3> You have not been added to a property </h3>
                        <?php endif; ?>
                    </div>
                    
                </div>

            </div>   <!-- /#page-wrapper -->

        </div>   <!-- /#wrapper -->


    </div> <!-- /#container -->
<?php $__env->stopSection(); ?>

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


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


<?php echo $__env->make('layout.main', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>