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

 <ul class="breadcrumb">
        <li><a href="<?=url('home')?>"><i class="icon-home2 position-left"></i> Home</a></li>
        <li><a href="<?=url('/backend/property/index')?>">Provider List</a></li>
        <li><a href="<?=url('/backend/space/listView')?>">Spaces List</a></li>
        <li class="active">Update/<?=$model->id?></li>
  </ul>

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


<?php $__env->startSection('content'); ?>
                 <div class="panel panel-white">
                                <div class="panel-heading">
                                    <h6 class="panel-title"><i class="icon-home position-left"></i>Update Space Details</h6>
                                </div>
                                
                            <div class="panel-body">
                  
                    <form role="form" action="<?=url('/backend/spaces/update/'.$model->id)?>" method="post">
                        <div class="row">



                            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                                <div class="form-group <?php echo e($errors->has('title') ? ' has-error' : ''); ?>">
                                    <label>Property</label>
                                    <select class="form-control" name="property_id" id="property_id" >
                                    <option value="">-----Select Property-----</option>
                                    <?php foreach($properties as $property):?>
                                     <option value="<?=$property->id?>"

                                     <?php if($model->property->id==$property->id):?>selected <?php endif;?>


                                     >
                                     <?php echo e($property->title); ?>-- <?php echo e($property->location); ?>



                                     </option>

                                    <?php endforeach;?>
                                        

                                    </select>
                                  
                                     <?php if($errors->has('title')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('title')); ?></strong>
                                                </span>
                                            <?php endif; ?>

                                </div>
                            </div>

                            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                                <div class="form-group <?php echo e($errors->has('category') ? ' has-error' : ''); ?>">
                                    <label>Category</label>
                                <input type="text"  class="form-control"  id="category" readonly name="category" value="<?=$model->property->category->name;?>" />
                                  
                                     <?php if($errors->has('category')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('category')); ?></strong>
                                                </span>
                                            <?php endif; ?>

                                </div>
                            </div>
                         </div>
                      
                       
                        <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                                <div class="form-group <?php echo e($errors->has('title') ? ' has-error' : ''); ?>">
                                    <label>Type</label>
                                    <input type="text"  class="form-control"  id="subcategory" readonly name="type" value="<?=$model->property->subcategory->name;?>
                                  "/>
                                  
                                     <?php if($errors->has('type')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('type')); ?></strong>
                                                </span>
                                            <?php endif; ?>

                                </div>
                            </div>
                        <div class="form-group col-md-6 <?php echo e($errors->has('number') ? ' has-error' : ''); ?>">
                            <label>Space Number <span id="latitude" class="label label-default"></span> <span id="longitude" class="label label-default"></span></label>
                            <input class="form-control" name="number" type="text" id="town" placeholder="Enter Space Number" autocomplete="off" value="<?=@$model->number?>">
                             <?php if($errors->has('number')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('number')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                           
                        </div>
                        
                        </div>

                        <div class="row">
                         <div class="form-group col-md-6 <?php echo e($errors->has('location') ? ' has-error' : ''); ?>">
                            <label>Space Name <span id="latitude" class="label label-default"></span> <span id="longitudes" class="label label-default"></span></label>
                            <input class="form-control" type="text" name="title" id="location" placeholder="Enter a Name That can be used to locate this space" autocomplete="off" value="<?=@$model->title?>">
                             <?php if($errors->has('title')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('title')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                            
                        </div>
                        <div class="form-group col-md-6 <?php echo e($errors->has('number') ? ' has-error' : ''); ?>">
                            <label>Unit Price <span id="latitude" class="label label-default"></span> <span  class="label label-default"></span></label>
                            <input class="form-control" name="unit_price" type="text" id="town" placeholder="Unit Price" autocomplete="off" value="<?=@$model->unit_price?>">
                             <?php if($errors->has('unit_price')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('unit_price')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                           
                        </div>
                        
                        </div>

                         <div class="row hidden bunga">
                         <div class="form-group col-md-6 <?php echo e($errors->has('location') ? ' has-error' : ''); ?>">
                            <label>Number of BathRooms<span id="latitude" class="label label-default"></span> <span id="longitudes" class="label label-default"></span></label>
                            <input class="form-control" type="text" name="number_of_bathrooms"  placeholder="Number of Bathrooms" value="<?=@$model->no_of_bathrooms?>">
                             <?php if($errors->has('number_of_bathrooms')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('number_of_bathrooms')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                            
                        </div>
                        <div class="form-group col-md-6 <?php echo e($errors->has('number') ? ' has-error' : ''); ?>">
                            <label>Number Of BedRooms <span id="latitude" class="label label-default"></span> <span  class="label label-default"></span></label>
                            <input class="form-control" name="number_of_bedrooms" type="text" id="town" placeholder="Number Of BedRooms"  value="<?=@$model->no_of_bedrooms?>">
                             <?php if($errors->has('number_of_bedrooms')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('number_of_bedrooms')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                           
                        </div>
                        
                        </div>

                          <div class="row">

                              <div class="form-group  col-md-12<?php echo e($errors->has('description') ? ' has-error' : ''); ?>">
                            <label>Other Space Description</label>
                            <textarea class="form-control" name="description"   rows="4"><?=@$model->description;?></textarea>
                             <?php if($errors->has('description')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('description')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                             </div>


                             </div>



                    <div class="row">

                    <div class="col-md-12">
                        <fieldset>
                        <legend>Utility Settings</legend>
                          <div class="form-group col-md-6 <?php echo e($errors->has('location') ? ' has-error' : ''); ?>">
                            <label>Water Meter Number<span id="latitude" class="label label-default"></span> <span id="longitudes" class="label label-default"></span></label>
                            <input class="form-control" type="text" name="water_meter_number"  placeholder="Water Meter Number" value="<?php echo e($model->water_meter_number); ?>">
                             <?php if($errors->has('water_meter_number')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('water_meter_number')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                            
                        </div>
                         <div class="form-group col-md-6 <?php echo e($errors->has('location') ? ' has-error' : ''); ?>">
                            <label>Electricity Meter Number</label>
                            <input class="form-control" type="text" name="electricity_meter_number"  placeholder="Electricity Meter Number" value="<?php echo e($model->electricity_meter_number); ?>">
                             <?php if($errors->has('electricity_meter_number')): ?>
                                                <span class="help-block">
                                                    <strong><?php echo e($errors->first('electricity_meter_number')); ?></strong>
                                                </span>
                                            <?php endif; ?>
                            
                        </div>
                          

                        </fieldset>
                          

                        </div>
                        

                    </div>


                        
                        <div class="row">
                            <h3>Property Images</h3>

                            <div id="property_images">
                                
                            </div>
                        </div>

                        
                        <div class="row">
                            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                <div class="form-group">
                                    <a href="#modal-message" class="uploadmodalwidget btn btn-default btn-sm" data-toggle="modal" id="uploadmodal" data-inputid="img_ids" data-mode="multiple" data-divid="property_images">Upload Images <i class="icon-play3 position-right"></i></a>
                                    
                                    <p class="help-block">You can select multiple images at once</p>
                                </div>
                            </div>

                            <input type="hidden" class="form-control" name="images" id="img_ids" value="">
                        </div>

                        
                      
                        <div class="form-group">
                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                         <button type="submit"  class="btn bg-teal-400 btn-labeled btn-labeled-right ml-10"><b><i class="icon-check"></i></b> Save Changes</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="clearfix"></div>


<?php echo e(Widget::MediaUploaderWidget()); ?>


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

<?php $__env->startPush('scripts'); ?>
<script type="text/javascript" src="<?php echo e(asset('assets/js/pages/uploader_bootstrap.js')); ?>"></script>
<script type="text/javascript">

   var category="<?=$model->property->category->name?>";
    if(category=="Commercial residential property" || category=="Commercial residential property"){
           $(".bunga").removeClass("hidden");
         }else{
           $(".bunga").addClass("hidden"); 
         }



   $("#property_id").on('change',function(){
    var id=$(this).val();
      var length=id.length;
     if(length>0){
      var url="<?=url('/backend/get_Cat/category')?>/"+id;
      $.getJSON(url,function(data){
        $("#category").val(data.category);
        $("#subcategory").val(data.subcategory);

        var cat=data.category;
    if(cat=="Commercial residential property" || cat=="Commercial residential property"){
           $(".bunga").removeClass("hidden");
         }else{
           $(".bunga").addClass("hidden"); 
         }
        

      });




     }

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

<?php echo $__env->make('layout.main_sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/realestate/Modules/Backend/Providers/../Resources/views/properties/spaces/edit.blade.php ENDPATH**/ ?>