
<?php $__env->startSection('title'); ?>
<title><?php echo e(__('admin.Create Property')); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin-content'); ?>
      <!-- Main Content -->
      <div class="main-content">
        <section class="section">
          <div class="section-header">
            <h1><?php echo e(__('admin.Create Property')); ?></h1>
          </div>

          <div class="section-body property_box">
                <a href="<?php echo e(route('admin.property.index')); ?>" class="btn btn-primary"><i class="fas fa-list"></i> <?php echo e(__('admin.Property List')); ?></a>
                <div class="row mt-4">
                    <form action="<?php echo e(route('admin.property.store')); ?>" method="POST" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="col-md-12">
                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Basic Information')); ?></h4>
                                    <hr>
                                    <div class="form-group">
                                        <label><?php echo e(__('admin.Property Agent')); ?><span class="text-danger">*</span></label>
                                        <select name="agent" id="" class="form-control select2">
                                            <option value="0"><?php echo e(__('admin.Own Property')); ?></option>
                                            <?php $__currentLoopData = $agents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $agent): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($agent->id); ?>"><?php echo e($agent->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>

                                    </div>
                                    <div class="form-group">
                                        <label for="title"><?php echo e(__('admin.Title')); ?><span class="text-danger">*</span></label>
                                        <input type="text" name="title" class="form-control" id="title" value="<?php echo e(old('title')); ?>">
                                    </div>

                                    <div class="form-group">
                                        <label for="slug"><?php echo e(__('admin.Slug')); ?> <span class="text-danger">*</span></label>
                                        <input type="text" name="slug" class="form-control" id="slug" value="<?php echo e(old('slug')); ?>">
                                    </div>

                                    <div class="row">

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="category"><?php echo e(__('admin.Property Type')); ?> <span class="text-danger">*</span></label>
                                                <select name="property_type" id="property_type" class="form-control select2">
                                                    <option value=""><?php echo e(__('admin.Select')); ?></option>
                                                    <?php $__currentLoopData = $propertyTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option <?php echo e(old('property_type')==$item->id ? 'selected' : ''); ?> value="<?php echo e($item->id); ?>"><?php echo e($item->type); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="city"><?php echo e(__('admin.City')); ?> <span class="text-danger">*</span></label>
                                                <select name="city" id="city" class="form-control select2">
                                                    <option value=""><?php echo e(__('admin.Select')); ?></option>
                                                    <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option <?php echo e(old('city')==$item->id ? 'selected' : ''); ?> value="<?php echo e($item->id); ?>"><?php echo e($item->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="address"><?php echo e(__('admin.Address')); ?> <span class="text-danger">*</span></label>
                                                <input type="text" name="address" value="<?php echo e(old('address')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="phone"><?php echo e(__('admin.Phone')); ?></label>
                                                <input type="text" name="phone" value="<?php echo e(old('phone')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="email"><?php echo e(__('admin.Email')); ?> <span class="text-danger">*</span></label>
                                                <input type="email" name="email" value="<?php echo e(old('email')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="website"><?php echo e(__('admin.Website')); ?></label>
                                                <input type="url" name="website" value="<?php echo e(old('website')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="purpose"><?php echo e(__('admin.Purpose')); ?> <span class="text-danger">*</span></label>
                                                <select name="purpose" id="purpose" class="form-control">
                                                    <?php $__currentLoopData = $purposes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($item->id); ?>"><?php echo e($item->custom_purpose); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="price"><?php echo e(__('admin.Price')); ?> <span class="text-danger">*</span></label>
                                                <input type="text" name="price" class="form-control" value="<?php echo e(old('price')); ?>">
                                            </div>
                                        </div>

                                        <div class="col-md-6 d-none" id="period_box">
                                            <div class="form-group">
                                                <label for="period"><?php echo e(__('admin.Period')); ?> <span class="text-danger">*</span></label>
                                                <select name="period" id="period" class="form-control">
                                                    <option value="Daily"><?php echo e(__('admin.Daily')); ?></option>
                                                    <option value="Monthly"><?php echo e(__('admin.Monthly')); ?></option>
                                                    <option value="Yearly"><?php echo e(__('admin.Yearly')); ?></option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Others Information')); ?></h4>
                                    <hr>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Area(Square Feet)')); ?> <span class="text-danger">*</span></label>
                                                <input type="text" name="area" value="<?php echo e(old('area')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Unit')); ?> <span class="text-danger">*</span></label>
                                                <input type="number" name="unit" value="<?php echo e(old('unit')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Room')); ?> <span class="text-danger">*</span></label>
                                                <input type="number" name="room" value="<?php echo e(old('room')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Bedroom')); ?> <span class="text-danger">*</span></label>
                                                <input type="number" name="bedroom" value="<?php echo e(old('bedroom')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Bathroom')); ?> <span class="text-danger">*</span></label>
                                                <input type="number" name="bathroom" value="<?php echo e(old('bathroom')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Floor')); ?> <span class="text-danger">*</span></label>
                                                <input type="number" name="floor" value="<?php echo e(old('floor')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Kitchen')); ?> </label>
                                                <input type="number" name="kitchen" value="<?php echo e(old('kitchen')); ?>" class="form-control">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Total Parking Place')); ?></label>
                                                <input type="number" name="parking" value="<?php echo e(old('parking')); ?>" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Image, PDF and Video')); ?></h4>
                                    <hr>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.PDF File')); ?></label>
                                                <input type="file" name="pdf_file" class="form-control-file">
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Bannner Image')); ?> <span class="text-danger">*</span></label>
                                                <input type="file" name="banner_image" class="form-control-file">
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Thumbnail Image')); ?> <span class="text-danger">*</span></label>
                                                <input type="file" name="thumbnail_image" class="form-control-file">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Slider Images (Multiple)')); ?> <span class="text-danger">*</span></label>
                                                <input type="file" class="form-control-file" name="slider_images[]" multiple>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Youtube Video Id')); ?></label>
                                                <input type="text" class="form-control" name="video_link" value="<?php echo e(old('video_link')); ?>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Aminities')); ?></h4>
                                    <hr>
                                    <div class="row">
                                        <div class="col">
                                            <div class="form-group">
                                                <div>
                                                    <?php $__currentLoopData = $aminities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $aminity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(old('aminities')): ?>
                                                            <?php
                                                                $isChecked=false;
                                                            ?>
                                                            <?php $__currentLoopData = old('aminities'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $old_aminity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <?php if($aminity->id==$old_aminity): ?>
                                                                <?php
                                                                $isChecked=true;
                                                            ?>
                                                                <?php endif; ?>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                            <input id="<?php echo e($aminity->slug); ?>" <?php echo e($isChecked ? 'checked' :''); ?> value="<?php echo e($aminity->id); ?>" type="checkbox" name="aminities[]" >
                                                            <label class="mx-1" for="<?php echo e($aminity->slug); ?>"><?php echo e($aminity->aminity); ?></label>

                                                        <?php else: ?>
                                                            <input value="<?php echo e($aminity->id); ?>" type="checkbox" name="aminities[]" id="<?php echo e($aminity->slug); ?>">
                                                            <label class="mx-1" for="<?php echo e($aminity->slug); ?>"><?php echo e($aminity->aminity); ?></label>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </div>

                                            </div>

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

                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Nearest Locations')); ?></h4>
                                    <hr>
                                    <div class="row">
                                        <div class="col-8" id="nearest-place-box">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('admin.Nearest Locations')); ?></label>
                                                        <select name="nearest_locations[]" id="" class="form-control">
                                                            <option value=""><?php echo e(__('admin.Select')); ?></option>
                                                            <?php $__currentLoopData = $nearest_locatoins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option value="<?php echo e($item->id); ?>"><?php echo e($item->location); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-md-4">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('admin.Distance(km)')); ?></label>
                                                        <input type="text" class="form-control" name="distances[]">
                                                    </div>
                                                </div>
                                                <div class="col-md-2">
                                                    <button id="addNearestPlaceRow" type="button" class="btn btn-success nearest-row-btn plus_btn"><i class="fas fa-plus" aria-hidden="true"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div id="hidden-location-box" class="d-none">
                                <div class="delete-dynamic-location">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Nearest Locations')); ?></label>
                                                <select name="nearest_locations[]" id="" class="form-control">
                                                    <option value=""><?php echo e(__('admin.Nearest Locations')); ?></option>
                                                    <?php $__currentLoopData = $nearest_locatoins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($item->id); ?>"><?php echo e($item->location); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-4">
                                            <div class="form-group">
                                                <label for=""><?php echo e(__('admin.Distance(km)')); ?></label>
                                                <input type="text" class="form-control" name="distances[]">
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <button type="button" class="btn btn-danger nearest-row-btn removeNearestPlaceRow plus_btn"><i class="fas fa-trash" aria-hidden="true"></i></button>
                                        </div>
                                    </div>
                                </div>


                            </div>


                            <div class="card mb-4">
                                <div class="card-body">
                                    <h4><?php echo e(__('admin.Property Details and Google Map')); ?></h4>
                                    <hr>

                                    <div class="row">
                                        <div class="col">
                                            <div class="form-group">
                                                <label><?php echo e(__('admin.Google Map Code')); ?></label>
                                                <textarea class="form-control text-area-5" rows="5" name="google_map_embed_code"><?php echo e(old('google_map_embed_code')); ?></textarea>
                                            </div>

                                            <div class="form-group mt-3">
                                                <label for="description"><?php echo e(__('admin.Description')); ?> <span class="text-danger">*</span></label>
                                                <textarea class="summernote" id="summernote" name="description"><?php echo e(old('description')); ?></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="card mb-4">
                                <div class="card-body">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="status"><?php echo e(__('admin.Status')); ?> <span class="text-danger">*</span></label>
                                                <select name="status" id="status" class="form-control">
                                                    <option  value="1"><?php echo e(__('admin.Active')); ?></option>
                                                    <option  value="0"><?php echo e(__('admin.Inactive')); ?></option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="featured"><?php echo e(__('admin.Featured')); ?> <span class="text-danger">*</span></label>
                                                <select name="featured" id="featured" class="form-control">
                                                    <option <?php echo e(old('featured')==0 ? 'selected': ''); ?> value="0"><?php echo e(__('admin.No')); ?></option>
                                                    <option <?php echo e(old('featured')==1 ? 'selected': ''); ?> value="1"><?php echo e(__('admin.Yes')); ?></option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="top_property"><?php echo e(__('admin.Top Property')); ?> <span class="text-danger">*</span></label>
                                                <select name="top_property" id="top_property" class="form-control">
                                                    <option value="1"><?php echo e(__('admin.Yes')); ?></option>
                                                    <option value="0"><?php echo e(__('admin.No')); ?></option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="urgent_property"><?php echo e(__('admin.Urgent Property')); ?> <span class="text-danger">*</span></label>
                                                <select name="urgent_property" id="urgent_property" class="form-control">
                                                    <option value="1"><?php echo e(__('admin.Yes')); ?></option>
                                                    <option value="0"><?php echo e(__('admin.No')); ?></option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="seo_title"><?php echo e(__('admin.SEO Title')); ?></label>
                                                <input type="text" name="seo_title" class="form-control" id="seo_title" value="<?php echo e(old('seo_title')); ?>">
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="seo_description"><?php echo e(__('admin.SEO Description')); ?></label>
                                                <textarea name="seo_description" id="seo_description" cols="30" rows="3" class="form-control text-area-5" ><?php echo e(old('seo_description')); ?></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <button class="btn btn-success"><?php echo e(__('admin.Save')); ?></button>
                                </div>
                            </div>

                        </div>
                    </form>
                </div>
          </div>
        </section>
      </div>






    <script>
        (function($) {
        "use strict";
        $(document).ready(function () {
            $("#title").on("focusout",function(e){
                $("#slug").val(convertToSlug($(this).val()));
            })

            $("#purpose").on("change",function(){
                var purposeId=$(this).val()
                if(purposeId==2){
                    $("#period_box").removeClass('d-none');
                }else if(purposeId==1){
                    $("#period_box").addClass('d-none');
                }
            })


            //start dynamic nearest place add and remove

            $("#addNearestPlaceRow").on("click",function(){
                var new_row=$("#hidden-location-box").html();
                $("#nearest-place-box").append(new_row)

            })
            $(document).on('click', '.removeNearestPlaceRow', function () {
                $(this).closest('.delete-dynamic-location').remove();
            });
            //end dynamic nearest place add and remove



        });

        })(jQuery);

        function convertToSlug(Text)
            {
                return Text
                    .toLowerCase()
                    .replace(/[^\w ]+/g,'')
                    .replace(/ +/g,'-');
            }
    </script>

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

<?php echo $__env->make('admin.master_layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home3/paprdcor/topriserealtors.com/resources/views/admin/create_property.blade.php ENDPATH**/ ?>