<?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 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-xs-12">

                <div id="return_msg"></div>

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


                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.name'); ?></th>
                        <td><?php echo e($user->name); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.user_name'); ?></th>
                        <td><?php echo e($user->user_name); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.email'); ?></th>
                        <td><?php echo e($user->email); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.gender'); ?></th>
                        <td><?php echo e(ucfirst($user->gender)); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.mobile'); ?></th>
                        <td><?php echo e($user->mobile); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.phone'); ?></th>
                        <td><?php echo e($user->phone); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.address'); ?></th>
                        <td><?php echo e($user->address); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.country'); ?></th>
                        <td>
                            <?php if($user->country): ?>
                            <?php echo e($user->country->country_name); ?>

                            <?php endif; ?>
                        </td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.website'); ?></th>
                        <td><?php echo e($user->website); ?></td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.created_at'); ?></th>
                        <td><?php echo e($user->signed_up_datetime()); ?></td>
                    </tr>
                    <?php
                    $user_paper = App\Agent_legality::where('user_id', $user->id)->first();
                    ?>
                    <tr>
                        <th>
                            Membership Number
                        </th>
                        <td>
                            <?php if(isset($user_paper)): ?>
                            <?php echo e($user_paper->membership_num); ?>

                            <?php endif; ?>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Membership Certificate
                        </th>
                        <td>
                            <?php if(isset($user_paper)): ?>
                            <a href="/uploads/agent-certificates/<?php echo e($user_paper->agent_certificate); ?>"
                                target="_blank">Download</a>

                            <?php endif; ?>
                        </td>
                    </tr>
                    <tr>
                        <th><?php echo app('translator')->getFromJson('app.account_status'); ?>
                            <span id="wait-status" style='display:none'>Please Wait...</span>
                        </th>
                        <td>
                            <label>
                                <input type="radio" name="account_status" value="0" data-user-id="<?php echo e($user->id); ?>"
                                    <?php if($user->active_status ==
                                '0'): ?>
                                checked <?php endif; ?> />
                                Pending
                            </label>
                            <label>
                                <input type="radio" name="account_status" value="1" data-user-id="<?php echo e($user->id); ?>"
                                    <?php if($user->active_status ==
                                '1'): ?> checked <?php endif; ?> />
                                <?php echo app('translator')->getFromJson('app.active'); ?>
                            </label>

                            <label>
                                <input type="radio" name="account_status" value="2" data-user-id="<?php echo e($user->id); ?>"
                                    <?php if($user->active_status ==
                                '2'): ?> checked <?php endif; ?> />
                                <?php echo app('translator')->getFromJson('app.block'); ?>
                            </label>
                        </td>
                    </tr>
                    <?php if($user->user_type == 'agent'): ?>
                    <tr>
                        <th>Zeia Badge <span id="wait-badge" style='display:none'>Please Wait...</span> </th>
                        <td>
                            <label>
                                <input type="radio" name="ziea_status" value="0" data-user-id="<?php echo e($user->id); ?>"
                                    <?php if($user->zeia_badge ==
                                '0'): ?> checked <?php endif; ?> />
                                None
                            </label>

                            <label>
                                <input type="radio" name="ziea_status" value="1" data-user-id="<?php echo e($user->id); ?>"
                                    <?php if($user->zeia_badge ==
                                '1'): ?> checked <?php endif; ?> />
                                Available
                            </label>
                        </td>
                    </tr>
                    <?php endif; ?>
                    
                </table>

            </div>
        </div>

        <?php if($ads->total() > 0): ?>
        <div class="row">
            <div class="col-xs-12">
                <h3><?php echo app('translator')->getFromJson('app.posted_ads'); ?></h3>

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

                    <?php $__currentLoopData = $ads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td width="100">
                            <img src="<?php echo e(media_url($ad->feature_img)); ?>" class="img-responsive" alt="">
                        </td>
                        <td>
                            <h5><a href="<?php echo e(route('single_ad', $ad->slug)); ?>" target="_blank"><?php echo e($ad->title); ?></a> </h5>
                            <p class="text-muted">
                                <i class="fa fa-map-marker"></i> <?php echo $ad->full_address(); ?><br /> <i
                                    class="fa fa-clock-o"></i> <?php echo e($ad->posting_datetime()); ?>


                                <?php if($ad->reports->count() > 0): ?>
                                <br />
                                <a href="<?php echo e(route('reports_by_ads', $ad->slug)); ?>">
                                    <i class="fa fa-exclamation-triangle"></i> <?php echo app('translator')->getFromJson('app.reports'); ?> :
                                    <?php echo e($ad->reports->count()); ?>

                                </a>
                                <?php endif; ?>
                            </p>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </table>

                <?php echo $ads->links(); ?>


            </div>
        </div>

        <?php endif; ?>



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




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

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

<script>
    $(function(){
            $(document).on('click','[name="account_status"]', function(){
                var user_id = $(this).data('user-id');
                var status = $(this).val();
                document.getElementById('wait-status').style.display = 'inline-block';
                $.ajax({
                    type : 'POST',
                    url : '<?php echo e(route('change_user_status')); ?>',
                    data: { user_id : user_id, status : status, _token : '<?php echo e(csrf_token()); ?>', status_to_change:0 },
                    success : function(data){
                        $('#return_msg').html(data);
                        document.getElementById('wait-status').style.display = 'none';
                    }
                });
            });
        })

    $(function(){
            $(document).on('click','[name="ziea_status"]', function(){
                var user_id = $(this).data('user-id');
                var status = $(this).val();
                document.getElementById('wait-badge').style.display = 'inline-block';
                $.ajax({
                    type : 'POST',
                    url : '<?php echo e(route('change_user_status')); ?>',
                    data: { user_id : user_id, status : status, _token : '<?php echo e(csrf_token()); ?>', status_to_change:1},
                    success : function(data){
                        $('#return_msg').html(data);
                        document.getElementById('wait-badge').style.display = 'none';
                    }
                });
            });
        })
</script>



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