<!-- Modal ADD Branch -->
@php($uniqid = uniqid())
<div class="modal fade" id="md_update_inventory" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'inventory.update', 'id' => 'form_update_inventory', 'class' => 'cls_form')) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Update {{ucwords(str_replace('_',' ',$plot_labels['module']))}}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class ="card">
          <div class = "card-body form-fieldset">
                 <div class="row">

                  <div class="col-sm-12">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['branch']))}}: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['rate'])),":message") }}</small>

            <div class="input-group mb-3">
             
             <input readonly="" type="text" name="" value="{{$curr_plot->branch->code}} {{$curr_plot->branch->name}}" class="form-control form-control-sm">
          
              
            </div>
          </div>
               <div class="col-sm-12">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['type']))}}: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['type'])),":message") }}</small>

            <div class="input-group mb-3">
             
             <select onchange="verifyCategory(event,this,'zxc');" class="form-control form-control-sm cls_selection plot_type" name="{{$plot_labels['type']}}">
              <option value = "selected">Select {{ucwords(str_replace('_',' ',$plot_labels['type']))}}</option>
               @foreach(EF::getTypeList() as $rows)
                 <option @if($rows === $curr_plot->type) selected @endif value="{{$rows}}">{{$rows}}</option>
               @endforeach
             </select>

            </div>
          </div>
                <div class="col-sm-12 floor_section_zxc" @if(strlen(trim($curr_plot->floor)) == 0) style="display: none;" @endif>
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['floor']))}}:<i style = "color:red;"></i></label>
            <small class="form-errors pull-right req" value="">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['floor'])),":message") }}</small>

            <div class="input-group mb-3">
             
             <select class="form-control form-control-sm cls_selection plot_category" name="{{$plot_labels['floor']}}">
               <option  value = "">Select {{ucwords(str_replace('_',' ',$plot_labels['floor']))}}</option>
               @foreach(EF::getFloorList() as $rows)
                 <option @if($rows === $curr_plot->floor) selected @endif value="{{$rows}}">{{$rows}}</option>
               @endforeach
             </select>

            </div>
          </div>

          <div class="col-sm-12">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['plot_name']))}}: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['plot_name'])),":message") }}</small>
            <div class="input-group mb-3">
              {{Form::Text($plot_labels['plot_name'],$curr_plot->plot_id, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['plot_name'])) , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>
           

         


   <!-- NORMAL BLOCK -->
              <div class="col-sm-6 ">
                <label class="label-color">{{ucwords(str_replace('_',' ',$plot_labels['block']))}}: <i style = "color:red;"></i></label>
                <small class="form-errors pull-right req" value="">{{ $errors->first($plot_labels['block'],":message") }}</small>

                <div class="input-group mb-3">
                  <select  onchange="showOtherBlockField(event,this,'{{$uniqid}}');"  name="{{$plot_labels['block']}}" class="form-control form-control-sm  cls_selection normal_block_{{$uniqid}}">
                    <option value="selected" selected>Select Block</option>
                    @foreach($project_block_list as $rows)

                      @if(strlen(trim($rows->block_name)))
                        <option @if($curr_plot->block_name === $rows->block_name) selected="true" @endif  value="{{$rows->block_name}}">{{$rows->block_name}}</option>
                      @endif

                    @endforeach
                    <option value="Other">Other</option>
                  </select>
                </div>
              </div>
              <!-- END NORMAL BLOCK -->
              <!-- END NORMAL BLOCK -->

              <!-- OTHER BLOCK -->
              <div class="col-sm-6 other_block_section_{{$uniqid}}" style="display: none;">
                <label class="label-color">Block Name: <i style = "color:red;"></i></label>
                <small class="form-errors pull-right req" value="">{{ $errors->first('other_block',":message") }}</small>

                <div class="input-group mb-3">
                   <input type="text" name="other_block" class="form-control form-control-sm normal_other_block_{{$uniqid}} cls_required" placeholder="Block Name">
                  
                </div>
              </div>

             <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['category']))}}:<i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['category'])),":message") }}</small>

            <div class="input-group mb-3">
             
             <select class="form-control form-control-sm cls_selection plot_category" name="{{$plot_labels['category']}}">
               <option value = "selected">Select {{ucwords(str_replace('_',' ',$plot_labels['category']))}}</option>
               @foreach(EF::getCategoryList() as $rows)
                 <option @if($curr_plot->category === $rows) selected="true" @endif  value="{{$rows}}">{{$rows}}</option>
               @endforeach
             </select>

            </div>
          </div>

  
          
          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['size']))}}: <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['size'])),":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::Email($plot_labels['size'],$curr_plot->size, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['size'])) , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>
          </div>

        
          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['dimension']))}}: <i style = "color:red;"></i></label>
            <small class="form-errors pull-right req" value="">@if($errors->any($plot_labels['dimension_x']) || $errors->any($plot_labels['dimension_y'])) Dimension is invalid. @endif</small>

            @php($dimesnion = explode('X',$curr_plot->dimensions))

            @if(isset($dimesnion[0]) && isset($dimesnion[1]))
                              
            @else
            
                @php($dimesnion[0] = '')
                @php($dimesnion[1] = '')
           @endif

            <div class="input-group mb-3">
             
              {{Form::Number($plot_labels['dimension_x'],trim($dimesnion[0]), ['class' => 'form-control form-control-sm  cls_decimal_digit',  'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default' , 'min' => '1'])}}
              <b style = "margin-left:5%; margin-right:5%;">X</b>

             
              {{Form::Number($plot_labels['dimension_y'],trim($dimesnion[1]), ['class' => 'form-control form-control-sm  cls_decimal_digit', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default' , 'min' => '1'])}}
            </div>
          </div>

                   <div class="col-sm-12">
 
             <input @if($curr_plot->parking_check > 0) checked @endif type="checkbox" name="parking_check" value="1"> <b>Parking Included ?</b>
             
   
          </div>

          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['rate']))}}:<i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['rate'])),":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::Text($plot_labels['rate'],$curr_plot->rate, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['rate'])), 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onkeyup' => 'numberInWordsValue(this,"rate_into_words")'])}}
            </div>
          </div>

          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['rate']))}} Into Words:</label>
           

            <div class="input-group mb-3">
             
              <input placeholder="{{ucwords(str_replace('_',' ',$plot_labels['rate']))}} In To Words" type="text" readonly="" class="form-control-sm form-control rate_into_words" value="{{EF::numberToWords($curr_plot->rate)}}" >
            </div>
            
          </div>

          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['feature_charges']))}}:</label>
            <small class="form-errors pull-right req" value="">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['feature_charges'])),":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::Text($plot_labels['feature_charges'],$curr_plot->featurecharges, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['feature_charges'])), 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onkeyup' => 'numberInWordsValue(this,"feature_charges_into_words")'])}}
            </div>
            
          </div>

          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['feature_charges']))}} Into Words:</label>
           

            <div class="input-group mb-3">
             
              <input value="{{EF::numberToWords($curr_plot->featurecharges)}}" placeholder="{{ucwords(str_replace('_',' ',$plot_labels['feature_charges']))}} In To Words" type="text" readonly="" class="form-control-sm form-control feature_charges_into_words" >
            </div>
            
          </div>

          {{-- <div class="col-sm-12">
             <label class="label-color">{{ucwords(str_replace('_',' ',$plot_labels['feature_list']))}}:</label><br>
             @foreach(EF::getFeatureList() as $rows)
               <div class="form-check form-check-inline">
                  <input class="form-check-input feature_list" name="{{$plot_labels['feature_list']}}[]" type="checkbox" id="" value="{{$rows}}">
                <label class="form-check-label">{{$rows}}</label>
              </div>
             @endforeach
           </div>
           --}}
           <div class="col-sm-12">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['feature_description']))}}:</label>
            <small class="form-errors pull-right req" value="">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['feature_description'])),":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::TextArea($plot_labels['feature_description'],$curr_plot->feature_description, ['class' => 'form-control form-control-sm  cls_required plot_features_des', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['feature_description'])), 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','rows'=>2, ])}}
            </div>
          </div>
{{--
          <div class="col-sm-6">
            <label class="label-color"> {{ucwords(str_replace('_',' ',$plot_labels['location']))}}:<i style = "color:red;"> *</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first(ucwords(str_replace('_',' ',$plot_labels['location'])),":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::TextArea($plot_labels['location'], '', ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => ucwords(str_replace('_',' ',$plot_labels['location'])), 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','rows'=>2, ])}}
            </div>
          </div>
--}}
          
        </div>  
          </div>
        </div>
     
         
      </div>
      <div class="modal-footer">
        
        <input type="hidden" name="inventory" value="{{Crypt::encrypt($curr_plot->id)}}">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

        <button type="submit" class="btn btn-primary cls_submit"  content="add {{ucwords(str_replace('_',' ',$plot_labels['module']))}}">Update {{ucwords(str_replace('_',' ',$plot_labels['module']))}} </button>

      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD BRANCH -->