
<?php 
include 'dbconnection.php';
$Email = Auth::user()->email; 




?>





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

	<div class="toolbar-nav">	
		<div class="row">	
			<div class="col-sm-6 col-md-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 " style="border-color:#ff7a7a;" >SALIR</a>
					
			</div>	
			  
			<div class="col-md-6 col-sm-6  text-left">
			  
							
			</div>
					
		</div>
	</div>	
		<div class="card">
			<div class="card-body">

	
	<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="Localización" class=" control-label col-md-4 text-left" style="font-weight:600;margin-bottom:5px;"> Localización :</label>
										<div class="col-md-6">
										  <!--<input  type='text' name='title' id='title' value='{{ $row['title'] }}'class='form-control form-control-sm ' />--> 
						               <select NAME="title" id = "condominio" class='select2 '>
        
                     <option value=''>--- Seleccionar ---</option>

                     <?php while($row1 = mysqli_fetch_array($result1)):;?>

                     <option  value="<?php echo $row1[1];?>"><?php echo $row1[1];?></option>

                     <?php endwhile;?>
						
					</select>	
						                </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 						
									  <!--<div class="form-group row  " >
										<!--<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='lalom@x' 
						     class='form-control form-control-sm ' /> 
										 <!--</div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div>--> 					
									  <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  "style="margin-bottom:-30px;" >
										<label for="Descripción" class=" control-label col-md-4 text-left" style="font-weight:600;"> Descripción :</label>
										<div class="col-md-6">
										  <textarea name='description' rows='5' id='description' class='form-control form-control-sm '  
				           >{{ $row['description'] }}</textarea> 
										 </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() { 
	 
	$("#title").jCombo("{!! url('reservacionesusuario/comboselect?filter=localizacion:Nombre:Nombre') !!}",
		{ initial_text: "-- Seleccionar --",selected_value : '{{ $row["title"] }}' });	
	 	
	 
	
	var form = $('#reservacionesusuarioFormAjax'); 
	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>

<style>
label{   font-weight: 600;}  

select {
  // A reset of styles, including removing the default dropdown arrow
  appearance: none;
  background-color: transparent;
  height: 40px; 
  padding: 0 1em 0 0;
  margin: 0;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  cursor: inherit;
  line-height: inherit;
   border-radius: 8px;
  margin-top:7px;
  border-color: #cccccc;
  padding:5px;
}	

    
    
</style>