@extends('layouts.dashboard')

@section('page_title')
	Letters
@endsection

@section('page_header_title')
Letters
@endsection



@section('page_body')
{{ Breadcrumbs::render('letters') }}

  {{ Form::open(array('route' => 'letters.pdf','id' => 'form_pdf_letters',  'class' => 'cls_form')) }}
<div class="row row-cards row-deck">

  @php($label_list = EF::getWhiteLabel())

  <div class="col-12 ">                

    <div class="card" style = "padding:20px;">
    	<div class = "row">
    	     <div class="col-6">
            <div class = "row">
              <div class = "col-6">
                
               <label class="label-color">Letter:</label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('letter_type',":message") }}</small>

            <div class="input-group mb-3">
            
              @php($letter_list = ['Select Letter Type'])

              @foreach(EF::getLettersList() as $rows)
                @php($letter_list += [$rows => $rows])
              @endforeach

             {{Form::select('letter_type', $letter_list, '' , array('class' => 'form-control form-control-sm type cls_selection', 'onchange' => 'resetLetterView(this,"payment_reminder_section")'))}}
            </div> 
            </div> 


          <div class="col-6">
                            <label class="label-color">Date: </label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('date',":message") }}</small>

            <div class="input-group mb-3">
           
              {{Form::Date('date', '', ['class' => 'form-control form-control-sm cls_date letter_date', 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>

          </div>
          </div> 
          <div class ="row payment_reminder_section" style ="display:none;" >
            <div class = "col-12">
                             <label class="label-color">Bank:</label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('letter_type',":message") }}</small>

            <div class="input-group mb-3">
              <select  class="form-control-sm form-control bank selected_bank " name="bank" >
                  <option selected="true" value="{{Crypt::encrypt(0)}}">Select Bank</option>
                  @foreach($bank_list as $rows)
                    <option value="{{Crypt::encrypt($rows->id)}}">{{ucwords($rows->branch_code)}} | {{ucwords($rows->bank_name)}} | {{ucwords($rows->location)}}</option>
                  @endforeach
              </select>
            </div>
            </div>
          </div>
       
            
            <div class = "row">
                       <div class = "col-6">
                  <label class="label-color">{{ucwords(str_replace('_',' ',$label_list['branch']))}}:</label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first($label_list['branch'],":message") }}</small>

            <div class="input-group mb-3">
            
            <select name="project" class="form-control form-control-sm cls_selection selected_branch" onchange="getProjectBookings(event,this)">
          <option value="{{Crypt::encrypt(0)}}">Select {{ucwords(str_replace('_',' ',$label_list['branch']))}}</option>
              @foreach($branch_list as $rows)
 
            <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->name}}</option>
              @endforeach
               </select>
            </div> 
            </div>
              <div class = "col-6">
             <label class="label-color">Booking:</label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('booking',":message") }}</small>

            <div class="input-group mb-3">
            
            <select name="booking" class="form-control form-control-sm cls_selection selected_booking"  onchange="getLetterdata(event,'selected_booking','type','letter_date','bank')">
	        <option value="{{Crypt::encrypt(0)}}">Select Booking</option>
	        
               </select>
            </div> 
          </div>
     
        </div>
      </div>
     
          <div class ="col-6 " style = "border: 1px solid; border-color: #328ab3; padding:7px;">
         
          	<div class = "right_view">
          	</div>
          	
          </div>
      </div>
    	</div>

    	
    	

    </div>

    		

</div>
<div class="row row-cards row-deck ">
  <div class=" mx-auto">   
<div class="bottom_view" >
    		</div>
    	</div>
    </div>
       {{ Form::close() }}

@endsection

@section('page_modal')

@endsection

@section('page_script')
@include('scripts.letters') 
@endsection
