

		 {!! Form::open(array('url'=>'comunicacion', 'class'=>'form-horizontal','files' => true , 'parsley-validate'=>'','novalidate'=>' ')) !!}

	@if(Session::has('messagetext'))
	  
		   {!! Session::get('messagetext') !!}
	   
	@endif
	<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> Comunicacion</legend>
				{!! Form::hidden('ComID', $row['ComID']) !!}					
									  <div class="form-group row  " >
										<label for="Pregunta" class=" control-label col-md-4 text-left"> Pregunta </label>
										<div class="col-md-6">
										  <input  type='text' name='Pregunta' id='Pregunta' value='{{ $row['Pregunta'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Condominio" class=" control-label col-md-4 text-left"> Condominio </label>
										<div class="col-md-6">
										  <select name='Condominio' rows='5' id='Condominio' class='select2 '   ></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='text' name='Email' id='Email' value='{{ $row['Email'] }}' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Residente" class=" control-label col-md-4 text-left"> Residente </label>
										<div class="col-md-6">
										  
					<?php $Residente = explode(',',$row['Residente']);
					$Residente_opt = array( 'No' => 'No' ,  'Si' => 'Si' , ); ?>
					<select name='Residente' rows='5'   class='select2 '  > 
						<?php 
						foreach($Residente_opt as $key=>$val)
						{
							echo "<option  value ='$key' ".($row['Residente'] == $key ? " selected='selected' " : '' ).">$val</option>"; 						
						}						
						?></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Administrador" class=" control-label col-md-4 text-left"> Administrador </label>
										<div class="col-md-6">
										  
					<?php $Administrador = explode(',',$row['Administrador']);
					$Administrador_opt = array( 'No' => 'No' ,  'Si' => 'Si' , ); ?>
					<select name='Administrador' rows='5'   class='select2 '  > 
						<?php 
						foreach($Administrador_opt as $key=>$val)
						{
							echo "<option  value ='$key' ".($row['Administrador'] == $key ? " selected='selected' " : '' ).">$val</option>"; 						
						}						
						?></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Usuario" class=" control-label col-md-4 text-left"> Usuario </label>
										<div class="col-md-6">
										  <select name='Usuario[]' multiple rows='5' id='Usuario' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> </fieldset></div></div>

			<div style="clear:both"></div>	
				
					
				  <div class="form-group">
					<label class="col-sm-4 text-right">&nbsp;</label>
					<div class="col-sm-8">	
					<button type="submit" name="apply" class="btn btn-default btn-sm" ><i class="fa  fa-check-circle"></i> {{ Lang::get('core.sb_apply') }}</button>
					<button type="submit" name="submit" class="btn btn-default btn-sm" ><i class="fa  fa-save "></i> {{ Lang::get('core.sb_save') }}</button>
				  </div>	  
			
		</div> 
		 <input type="hidden" name="action_task" value="public" />
		 {!! Form::close() !!}
		 
   <script type="text/javascript">
	$(document).ready(function() { 
		
		
		$("#Condominio").jCombo("{!! url('comunicacion/comboselect?filter=condominios:Nombre:Nombre') !!}",
		{  selected_value : '{{ $row["Condominio"] }}' });
		
		$("#Usuario").jCombo("{!! url('comunicacion/comboselect?filter=tb_users:email:first_name|last_name') !!}",
		{  selected_value : '{{ $row["Usuario"] }}' });
		 

		$('.removeCurrentFiles').on('click',function(){
			var removeUrl = $(this).attr('href');
			$.get(removeUrl,function(response){});
			$(this).parent('div').empty();	
			return false;
		});		
		
	});
	</script>		 
