<div class="form-ajax-box">
{!! Form::open(array('url'=>'mudanzas?return='.$return, 'class'=>'form-horizontal form-material validated','files' => true , 'parsley-validate'=>'','novalidate'=>' ','id'=> 'mudanzasFormAjax')) !!}

	<div class="toolbar-nav">	
		<div class="row">	
			<div class="col-sm-6 ">	
			<!--<button type="submit" class="btn btn-sm  " name="apply" style="border-color:#f29f41;">APLICAR CAMBIOS</button>-->
				<button type="submit" class="btn btn-sm  " name="save" style="border-color:#7fb3e3;">GUARDAR</button>
				<a href="javascript://ajax" onclick="ajaxViewClose('#{{ $pageModule }}')" class="tips btn btn-sm float-leftt " style="border-color:#ff7a7a;" >SALIR</a>	
			</div>	
			<div class="col-md-6 text-right">
				<!--<a href="javascript://ajax" onclick="ajaxViewClose('#{{ $pageModule }}')" class="tips btn btn-sm  " title="{{ __('core.btn_back') }}" ><i class="fa  fa-times"></i></a>-->				
			</div>
					
		</div>
	</div>	
	<div class="card"style="margin-bottom:320px;">
			<div class="card-body" style="overflow-y: scroll;">

	
	<div class="row"><div class="col-md-12">
						<fieldset style="border-color:#7fb3e3;"><legend> Información General</legend>
				{!! Form::hidden('id', $row['id']) !!}					
									  					
									  <div class="form-group row  " >
										<label for="Inicio" class=" control-label col-md-4 text-left" style="font-weight:600;"> Inicio :</label>
										<div class="col-md-6">
										  
					{!! Form::text('fechadeinicio', $row['fechadeinicio'],array('class'=>'form-control form-control-sm datetime')) !!}
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Final" class=" control-label col-md-4 text-left" style="font-weight:600;"> Final :</label>
										<div class="col-md-6">
										  
					{!! Form::text('fechafinal', $row['fechafinal'],array('class'=>'form-control form-control-sm datetime')) !!}
				 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Vias" class=" control-label col-md-4 text-left" style="font-weight:600;"> Vias :</label>
										<div class="col-md-6">
										  <select name='vias[]' multiple rows='5' id='vias' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Datos" class=" control-label col-md-4 text-left" style="font-weight:600;"> Datos :</label>
										<div class="col-md-6">
										  <textarea name='Datos' rows='5' id='Datos' class='form-control form-control-sm '  
				           >{{ $row['Datos'] }}</textarea> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  <div class="form-group row  " style="margin-bottom:-50px;">
										<!--<label for="Email" class=" control-label col-md-4 text-left"> Email </label>-->
										<div class="col-md-6">
										  <input  type='hidden' name='email' id='email' value='{{Auth::user()->email}}' 
						     class='form-control form-control-sm ' /> 
						     <input  type='hidden' name='title' id='title' value='Mudanza' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> </fieldset></div></div>									
						
	<input type="hidden" name="action_task" value="save" />

	</div>
	

</div>		
{!! Form::close() !!}
</div>

<style type="text/css">
	.modal-body .form-ajax-box {
		margin: -15px;
	}
</style>
@include('sximo.module.template.ajax.formjavascript')
<script type="text/javascript">
$(document).ready(function() { 
	 
	
	
		$("#vias").jCombo("{!! url('mudanzas/comboselect?filter=vias:Tipo:Tipo') !!}",
		{  selected_value : '{{ $row["vias"] }}' });
		 	
	 
	
	var form = $('#mudanzasFormAjax'); 
	form.parsley();
	form.submit(function(){
		
		if(form.parsley().isValid()){			
			var options = { 
				dataType:      'json', 
				beforeSubmit :  function() {
				},
				success		:   function(data) {

					if(data.status == 'success')
					{
						ajaxViewClose('#{{ $pageModule }}');
						ajaxFilter('#{{ $pageModule }}','{{ $pageUrl }}/data');
						notyMessage(data.message);	
						$('#sximo-modal').modal('hide');	
					} else {
						notyMessageError(data.message);	
						return false;
					}	

				}  
			}  
			$(this).ajaxSubmit(options); 
			return false;
						
		} else {
			return false;
		}		
	
	});

});
$('.datetime').bootstrapMaterialDatePicker({ format:'YYYY-MM-DD hh:mm A',lang : 'es', cancelText: 'Cancelar'});
</script>



