
<?php $__env->startSection('title'); ?>
<title><?php echo e($websiteLang->where('lang_key','package')->first()->custom_text); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin-content'); ?>
    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800"><a href="<?php echo e(route('admin.package.create')); ?>" class="btn btn-primary"><i class="fas fa-plus" aria-hidden="true"></i> <?php echo e($websiteLang->where('lang_key','create')->first()->custom_text); ?> </a></h1>
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary"><?php echo e($websiteLang->where('lang_key','package')->first()->custom_text); ?></h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th width="5%"><?php echo e($websiteLang->where('lang_key','serial')->first()->custom_text); ?></th>
                            <th width="20%"><?php echo e($websiteLang->where('lang_key','package_name')->first()->custom_text); ?></th>
                            <th width="30%"><?php echo e($websiteLang->where('lang_key','package_type')->first()->custom_text); ?></th>
                            <th width="10%"><?php echo e($websiteLang->where('lang_key','price')->first()->custom_text); ?></th>
                            <th width="5%"><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></th>
                            <th width="15%"><?php echo e($websiteLang->where('lang_key','action')->first()->custom_text); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e(++$index); ?></td>
                            <td><?php echo e($package->package_name); ?></td>
                            <td><?php echo e($package->package_type == 1 ? $websiteLang->where('lang_key','premium')->first()->custom_text: $websiteLang->where('lang_key','free')->first()->custom_text); ?></td>
                            <td><?php echo e($currency->currency_icon); ?><?php echo e($package->price); ?></td>
                            <td>
                                <?php if($package->status==1): ?>
                                <a href="" onclick="featureStatus(<?php echo e($package->id); ?>)"><input type="checkbox" checked data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>
                                <?php else: ?>
                                    <a href="" onclick="featureStatus(<?php echo e($package->id); ?>)"><input type="checkbox" data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>

                                <?php endif; ?>
                            </td>
                            <td>
                                <a href="<?php echo e(route('admin.package.edit',$package->id)); ?>" class="btn btn-primary btn-sm"><i class="fas fa-edit  "></i></a>

                                <a href="javascript:;" data-toggle="modal" data-target="#packageId-<?php echo e($package->id); ?>" class="btn btn-success btn-sm"><i class="fas fa-eye" aria-hidden="true"></i></a>

                                <?php if($package->orders->count()==0): ?>
                                <a data-toggle="modal" data-target="#deleteModal" href="javascript:;" onclick="deleteData(<?php echo e($package->id); ?>)" class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></a>
                                <?php endif; ?>



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

                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <!-- Modal -->
    <div class="modal fade" id="packageId-<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
        <div class="modal-dialog modal-md" role="document">
            <div class="modal-content">
                    <div class="modal-header">
                            <h5 class="modal-title"><?php echo e($websiteLang->where('lang_key','package_detail')->first()->custom_text); ?> <small><span class="text-danger">(<?php echo e($websiteLang->where('lang_key','unlimited_qty')->first()->custom_text); ?> = -1 )</span></small></h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                        </div>
                <div class="modal-body">
                    <div class="container-fluid">
                        <table class="table table-bordered">
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','package_type')->first()->custom_text); ?></td>
                                <td><?php echo e($item->package_type==1 ? $websiteLang->where('lang_key','premium')->first()->custom_text : $websiteLang->where('lang_key','free')->first()->custom_text); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','package_name')->first()->custom_text); ?></td>
                                <td><?php echo e($item->package_name); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','price')->first()->custom_text); ?></td>
                                <td><?php echo e($currency->currency_icon); ?><?php echo e($item->price); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_day')->first()->custom_text); ?></td>
                                <td><?php echo e($item->number_of_days); ?></td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_property')->first()->custom_text); ?></td>
                                <td><?php echo e($item->number_of_property); ?></td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_aminities')->first()->custom_text); ?></td>
                                <td><?php echo e($item->number_of_aminities); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_photo')->first()->custom_text); ?></td>
                                <td><?php echo e($item->number_of_photo); ?></td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','allow_feature')->first()->custom_text); ?></td>
                                <td><?php echo e($item->is_featured ==1 ? $websiteLang->where('lang_key','yes')->first()->custom_text : $websiteLang->where('lang_key','no')->first()->custom_text); ?></td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_featured_property')->first()->custom_text); ?></td>
                                <td><?php echo e($item->number_of_feature_property); ?></td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_nearest_place')->first()->custom_text); ?></td>
                                <td>
                                    <?php echo e($item->number_of_nearest_place); ?>

                                </td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','allow_top_property')->first()->custom_text); ?></td>
                                <td><?php echo e($item->is_top ==1 ? $websiteLang->where('lang_key','yes')->first()->custom_text : $websiteLang->where('lang_key','no')->first()->custom_text); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_top_property')->first()->custom_text); ?></td>
                                <td>
                                    <?php echo e($item->number_of_top_property); ?>

                                </td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','allow_urgent_property')->first()->custom_text); ?></td>
                                <td><?php echo e($item->is_urgent ==1 ? $websiteLang->where('lang_key','yes')->first()->custom_text : $websiteLang->where('lang_key','no')->first()->custom_text); ?></td>
                            </tr>
                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','number_of_urgent_property')->first()->custom_text); ?></td>
                                <td>
                                    <?php echo e($item->number_of_urgent_property); ?>

                                </td>
                            </tr>
                             <tr>
                                <td><?php echo e($websiteLang->where('lang_key','package_order')->first()->custom_text); ?></td>
                                <td>
                                    <?php echo e($item->package_order); ?>

                                </td>
                            </tr>

                            <tr>
                                <td><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></td>
                                <td>
                                    <?php if($item->status==1): ?>
                                    <span class="badge badge-success"><?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?></span>
                                    <?php else: ?>
                                    <span class="badge badge-danger"><?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?></span>
                                    <?php endif; ?>
                                </td>

                            </tr>





                        </table>
                    </div>
                    <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal"><?php echo e($websiteLang->where('lang_key','close')->first()->custom_text); ?></button>
                </div>

            </div>
        </div>
    </div>

    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


    <script>
        function deleteData(id){
            $("#deleteForm").attr("action",'<?php echo e(url("admin/package/")); ?>'+"/"+id)
        }

        function featureStatus(id){


// project demo mode check
         var isDemo="<?php echo e(env('PROJECT_MODE')); ?>"
         var demoNotify="<?php echo e(env('NOTIFY_TEXT')); ?>"
         if(isDemo==0){
             toastr.error(demoNotify);
             return;
         }
         // end

            $.ajax({
                type:"get",
                url:"<?php echo e(url('/admin/package-status/')); ?>"+"/"+id,
                success:function(response){
                   toastr.success(response)
                },
                error:function(err){
                    console.log(err);

                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/cloudelite/imobi.eliteteclda.com/resources/views/admin/property-package/index.blade.php ENDPATH**/ ?>