
<?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.index')); ?>" class="btn btn-primary"><i class="fas fa-list" aria-hidden="true"></i> <?php echo e($websiteLang->where('lang_key','all_package')->first()->custom_text); ?> </a></h1>
    <!-- DataTales Example -->
    <div class="row">
        <div class="col-md-12">
            <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_form')->first()->custom_text); ?> <span class="text-danger">(<?php echo e($websiteLang->where('lang_key','unlimited_qty')->first()->custom_text); ?> = -1 )</span> </h6>
                </div>
                <div class="card-body">

                    <form action="<?php echo e(route('admin.package.update',$package->id)); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('patch'); ?>

                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="package_type"><?php echo e($websiteLang->where('lang_key','package_type')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <select name="package_type" id="package_type" class="form-control">
                                        <option <?php echo e($package->package_type==1 ? 'selected' :''); ?> value="1"><?php echo e($websiteLang->where('lang_key','premium')->first()->custom_text); ?></option>
                                        <option <?php echo e($package->package_type==0 ? 'selected' :''); ?> value="0"><?php echo e($websiteLang->where('lang_key','free')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="package_name"><?php echo e($websiteLang->where('lang_key','package_name')->first()->custom_text); ?><span class="text-danger">*</span></label>
                                    <input type="text" name="package_name" class="form-control" id="package_name" value="<?php echo e($package->package_name); ?>">
                                </div>
                            </div>

                            <?php if($package->package_type !=0): ?>
                                <div class="col-md-4" id="price-row">
                                    <div class="form-group">
                                        <label for="price"><?php echo e($websiteLang->where('lang_key','price')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="text" name="price" class="form-control" id="price" value="<?php echo e($package->price); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>

                            <?php if($package->package_type ==0): ?>
                                <div class="col-md-4 d-none" id="price-row">
                                    <div class="form-group">
                                        <label for="price"><?php echo e($websiteLang->where('lang_key','price')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="text" name="price" class="form-control" id="price" value="<?php echo e($package->price); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>




                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="number_of_days"><?php echo e($websiteLang->where('lang_key','number_of_day')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_days" class="form-control" id="number_of_days" value="<?php echo e($package->number_of_days); ?>">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="number_of_property"><?php echo e($websiteLang->where('lang_key','number_of_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_property" class="form-control" id="number_of_property" value="<?php echo e($package->number_of_property); ?>">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="number_of_aminities"><?php echo e($websiteLang->where('lang_key','number_of_aminities')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_aminities" class="form-control" id="number_of_aminities" value="<?php echo e($package->number_of_aminities); ?>">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="number_of_nearest_place"><?php echo e($websiteLang->where('lang_key','number_of_nearest_place')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_nearest_place" class="form-control" id="number_of_nearest_place" value="<?php echo e($package->number_of_nearest_place); ?>">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="number_of_photo"><?php echo e($websiteLang->where('lang_key','number_of_photo')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_photo" class="form-control" id="number_of_photo" value="<?php echo e($package->number_of_photo); ?>">
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="feature"><?php echo e($websiteLang->where('lang_key','allow_feature')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <select name="feature" id="feature" class="form-control">
                                        <option <?php echo e($package->is_featured==1 ? 'selected' :''); ?>  value="1"><?php echo e($websiteLang->where('lang_key','yes')->first()->custom_text); ?></option>
                                        <option <?php echo e($package->is_featured==0 ? 'selected' :''); ?>  value="0"><?php echo e($websiteLang->where('lang_key','no')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>

                            <?php if($package->is_featured !=0): ?>
                                <div class="col-md-4" id="feature-row">
                                    <div class="form-group">
                                        <label for="number_of_feature_property"><?php echo e($websiteLang->where('lang_key','number_of_featured_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="number" name="number_of_feature_property" id="number_of_feature_property" class="form-control" value="<?php echo e($package->number_of_feature_property); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>

                            <?php if($package->is_featured ==0): ?>
                                <div class="col-md-4 d-none" id="feature-row">
                                    <div class="form-group">
                                        <label for="number_of_feature_property"><?php echo e($websiteLang->where('lang_key','number_of_featured_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="number" name="number_of_feature_property" id="number_of_feature_property" class="form-control" value="<?php echo e($package->number_of_feature_property); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>




                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="top_property"><?php echo e($websiteLang->where('lang_key','allow_top_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <select name="top_property" id="top_property" class="form-control">
                                        <option <?php echo e($package->is_top==1 ? 'selected' :''); ?>  value="1"><?php echo e($websiteLang->where('lang_key','yes')->first()->custom_text); ?></option>
                                        <option <?php echo e($package->is_top==0 ? 'selected' :''); ?>  value="0"><?php echo e($websiteLang->where('lang_key','no')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>


                            <?php if($package->is_top !=0): ?>
                                <div class="col-md-4" id="top-row">
                                    <div class="form-group">
                                        <label for="number_of_top_property"><?php echo e($websiteLang->where('lang_key','number_of_top_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="number" name="number_of_top_property" id="number_of_top_property" class="form-control" value="<?php echo e($package->number_of_top_property); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>

                            <?php if($package->is_top ==0): ?>
                                <div class="col-md-4 d-none" id="top-row">
                                    <div class="form-group">
                                        <label for="number_of_top_property"><?php echo e($websiteLang->where('lang_key','number_of_top_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                        <input type="number" name="number_of_top_property" id="number_of_top_property" class="form-control" value="<?php echo e($package->number_of_top_property); ?>">
                                    </div>
                                </div>
                            <?php endif; ?>




                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="urgent"><?php echo e($websiteLang->where('lang_key','allow_urgent_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <select name="urgent" id="urgent" class="form-control">
                                        <option <?php echo e($package->is_urgent==1 ? 'selected' :''); ?>  value="1"><?php echo e($websiteLang->where('lang_key','yes')->first()->custom_text); ?></option>
                                        <option <?php echo e($package->is_urgent==0 ? 'selected' :''); ?>  value="0"><?php echo e($websiteLang->where('lang_key','no')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>

                            <?php if($package->is_urgent !=0): ?>
                            <div class="col-md-4" id="urgent-row">
                                <div class="form-group">
                                    <label for="number_of_urgent_property"><?php echo e($websiteLang->where('lang_key','number_of_urgent_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_urgent_property" id="number_of_urgent_property" class="form-control" value="<?php echo e($package->number_of_urgent_property); ?>">
                                </div>
                            </div>
                            <?php endif; ?>
                             <?php if($package->is_urgent ==0): ?>
                            <div class="col-md-4 d-none" id="urgent-row">
                                <div class="form-group">
                                    <label for="number_of_urgent_property"><?php echo e($websiteLang->where('lang_key','number_of_urgent_property')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <input type="number" name="number_of_urgent_property" id="number_of_urgent_property" class="form-control" value="<?php echo e($package->number_of_urgent_property); ?>">
                                </div>
                            </div>
                            <?php endif; ?>




                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="status"><?php echo e($websiteLang->where('lang_key','package_order')->first()->custom_text); ?><span class="text-danger">*</span></label>
                                    <input type="text" value="<?php echo e($package->package_order); ?>" id="package_order" name="package_order" class="form-control">
                                    <span class="text-danger d-none" id="order-error"></span>
                                </div>
                            </div>

                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="status"><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?> <span class="text-danger">*</span></label>
                                    <select name="status" id="status" class="form-control">
                                        <option <?php echo e($package->status==1 ? 'selected' :''); ?>  value="1"><?php echo e($websiteLang->where('lang_key','yes')->first()->custom_text); ?></option>
                                        <option <?php echo e($package->status==0 ? 'selected' :''); ?>  value="0"><?php echo e($websiteLang->where('lang_key','no')->first()->custom_text); ?></option>
                                    </select>
                                </div>
                            </div>


                        </div>
                        <button type="submit" class="btn btn-success"><?php echo e($websiteLang->where('lang_key','update')->first()->custom_text); ?></button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <script>
        (function($) {
        "use strict";
        $(document).ready(function () {
            $("#package_type").on('change',function(){
                var type=$("#package_type").val()
                if(type==0){
                    $("#price-row").addClass('d-none')
                }
                if(type==1){
                    $("#price-row").removeClass('d-none')
                }

            })

            $("#feature").on('change',function(){
                var type=$("#feature").val()
                if(type==0){
                    $("#feature-row").addClass('d-none')
                }
                if(type==1){
                    $("#feature-row").removeClass('d-none')
                }

            })

            $("#top_property").on('change',function(){
                var type=$("#top_property").val()
                if(type==0){
                    $("#top-row").addClass('d-none')
                }
                if(type==1){
                    $("#top-row").removeClass('d-none')
                }

            })

            $("#urgent").on('change',function(){
                var type=$("#urgent").val()
                if(type==0){
                    $("#urgent-row").addClass('d-none')
                }
                if(type==1){
                    $("#urgent-row").removeClass('d-none')
                }

            })

            $("#package_order").on('keyup',function(){
                var text=$("#package_order").val()
                if(isNaN(text)){
                    $("#order-error").text('Please insert positive number')
                    $("#order-error").removeClass('d-none')
                }else{
                    if(text<0){
                        $("#order-error").text('Please insert positive number')
                        $("#order-error").removeClass('d-none')
                    }else{
                        $("#order-error").addClass('d-none')
                    }
                }
            })


        });

        })(jQuery);
    </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/edit.blade.php ENDPATH**/ ?>