@extends('layouts.app')

@section('content')
<div class="page-header"><h2> {{ $pageTitle }} <small> {{ $pageNote }} </small> </h2></div>

	{!! Form::open(array('url'=>'autosinisters?return='.$return, 'class'=>'form-horizontal validated','files' => true )) !!}
	<div class="toolbar-nav">
		<div class="row">
			
			<div class="col-md-6 " >
				<button name="apply" class="tips btn btn-sm btn-default  "  title="{{ __('core.btn_back') }}" ><i class="fa  fa-check"></i> {{ __('core.sb_apply') }} </button>
				<button name="save" class="tips btn btn-sm btn-default"  title="{{ __('core.btn_back') }}" ><i class="fa  fa-paste"></i> {{ __('core.sb_save') }} </button> 
			</div>
			<div class="col-md-6 text-right " >
				<a href="{{ url($pageModule.'?return='.$return) }}" class="tips btn btn-sm "  title="{{ __('core.btn_back') }}" ><i class="fa  fa-times"></i></a> 
			</div>
		</div>
	</div>	


	<div class="p-5">
		<ul class="parsley-error-list">
			@foreach($errors->all() as $error)
				<li>{{ $error }}</li>
			@endforeach
		</ul>		
		<div class="row">
	<div class="col-md-12">
						<fieldset><legend> Sinistres Automobiles</legend>
				{!! Form::hidden('id', $row['id']) !!}					
									  <div class="form-group row  " >
										<label for="Compte" class=" control-label col-md-4 text-left"> Compte <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <select name='account_id' rows='5' id='account_id' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Sinistre" class=" control-label col-md-4 text-left"> Sinistre <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='sinister' id='sinister' value='{{ $row['sinister'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Compagnie" class=" control-label col-md-4 text-left"> Compagnie <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='cie' id='cie' value='{{ $row['cie'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Réf Cbt" class=" control-label col-md-4 text-left"> Réf Cbt <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='id_cbt' id='id_cbt' value='{{ $row['id_cbt'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Réf Compagnie" class=" control-label col-md-4 text-left"> Réf Compagnie <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='id_cie' id='id_cie' value='{{ $row['id_cie'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Police" class=" control-label col-md-4 text-left"> Police <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='police' id='police' value='{{ $row['police'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Assuré" class=" control-label col-md-4 text-left"> Assuré <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='insured' id='insured' value='{{ $row['insured'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date sinitre" class=" control-label col-md-4 text-left"> Date sinitre <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('sinister_date', $row['sinister_date'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date déclaration" class=" control-label col-md-4 text-left"> Date déclaration <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('declaration_date', $row['declaration_date'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Conducteur" class=" control-label col-md-4 text-left"> Conducteur <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='driver' id='driver' value='{{ $row['driver'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Matricule" class=" control-label col-md-4 text-left"> Matricule <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='matricule' id='matricule' value='{{ $row['matricule'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Expert" class=" control-label col-md-4 text-left"> Expert <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='expert' id='expert' value='{{ $row['expert'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date devis" class=" control-label col-md-4 text-left"> Date devis <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('quote_date', $row['quote_date'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Montant devis" class=" control-label col-md-4 text-left"> Montant devis <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='quote_amount' id='quote_amount' value='{{ $row['quote_amount'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date facture" class=" control-label col-md-4 text-left"> Date facture <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('invoice_date', $row['invoice_date'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Montant facture" class=" control-label col-md-4 text-left"> Montant facture <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='invoice_amount' id='invoice_amount' value='{{ $row['invoice_amount'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date rapport" class=" control-label col-md-4 text-left"> Date rapport <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('report_date', $row['report_date'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Montant rapport" class=" control-label col-md-4 text-left"> Montant rapport <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='report_amount' id='report_amount' value='{{ $row['report_amount'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date quittance" class=" control-label col-md-4 text-left"> Date quittance <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='receipt_date' id='receipt_date' value='{{ $row['receipt_date'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Montant Reg Client" class=" control-label col-md-4 text-left"> Montant Reg Client <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='custpayamount' id='custpayamount' value='{{ $row['custpayamount'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Montant Reg Cie" class=" control-label col-md-4 text-left"> Montant Reg Cie <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='ciepayamount' id='ciepayamount' value='{{ $row['ciepayamount'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Observations" class=" control-label col-md-4 text-left"> Observations <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <textarea name='observations' rows='5' id='observations' class='form-control form-control-sm '  
				           >{{ $row['observations'] }}</textarea> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Gestionnaire" class=" control-label col-md-4 text-left"> Gestionnaire <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='operator' id='operator' value='{{ $row['operator'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Sort du sinistre" class=" control-label col-md-4 text-left"> Sort du sinistre <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  <input  type='text' name='sinister_fate' id='sinister_fate' value='{{ $row['sinister_fate'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Date de mise à jour" class=" control-label col-md-4 text-left"> Date de mise à jour <span class="asterix"> * </span></label>
										<div class="col-md-6">
										  
				<div class="input-group input-group-sm m-b" style="width:150px !important;">
					{!! Form::text('SSISDate', $row['SSISDate'],array('class'=>'form-control form-control-sm datetime')) !!}
					<div class="input-group-append">
					 	<div class="input-group-text"><i class="fa fa-calendar"></i></span></div>
					 </div>
				</div>
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> </fieldset>
			</div>
			
			
	
		</div>

		<input type="hidden" name="action_task" value="save" />
		
		</div>
	</div>		
	{!! Form::close() !!}
		 
   <script type="text/javascript">
	$(document).ready(function() { 
		
		
		
		$("#account_id").jCombo("{!! url('autosinisters/comboselect?filter=sc_accounts:id:name') !!}",
		{  selected_value : '{{ $row["account_id"] }}' });
		 		 

		$('.removeMultiFiles').on('click',function(){
			var removeUrl = '{{ url("autosinisters/removefiles?file=")}}'+$(this).attr('url');
			$(this).parent().remove();
			$.get(removeUrl,function(response){});
			$(this).parent('div').empty();	
			return false;
		});		
		
	});
	</script>		 
@stop