@extends('layouts.app')

@section('content')
<div class="page-header" style="background-color: #6382a6;;">
  <div class="modulo "><img class="imagenmodulo1" src="{{ URL::asset('dashboardimage/support.png') }}">
  <img class="imagenmodulo2" src="{{ URL::asset('dashboardimage/linea.png') }}">&nbsp   GESTIÓN DE COMUNICACIÓN</div>
</div>

	{!! Form::open(array('url'=>'gestioncomunicacion?return='.$return, 'class'=>'form-horizontal form-material validated sximo-form','files' => true ,'id'=> 'FormTable' )) !!}
	<div class="toolbar-nav">
		<div class="row">
			
			<div class="col-md-6 " >
				
					<!--<button name="apply" class="tips btn btn-sm btn-primary   "  title="{{ __('core.btn_back') }}" > {{ __('core.sb_apply') }} </button>-->
				<button type="submit" class="btn btn-sm  " name="save" style="border-color:#7fb3e3;">GUARDAR</button>
					<a href="{{ url($pageModule.'?return='.$return) }}" class="tips btn btn-sm " style="border-color:#ff7a7a;" >SALIR</a>	
			</div>
			<div class="col-md-6 text-right " >
				<!--<a href="{{ url($pageModule.'?return='.$return) }}" class="tips btn btn-secondary  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('ComID', $row['ComID']) !!}					
									  <div class="form-group row  " >
										<label for="Tema" class=" control-label col-md-4 text-left"> Tema :</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  " style="display: none;">
										<label for="Respuesta" class=" control-label col-md-4 text-left"> Respuesta :</label>
										<div class="col-md-6">
										  <textarea name='Respuesta' rows='5' id='Respuesta' class='form-control form-control-sm '  
				           >{{ $row['Respuesta'] }}</textarea> 
										 </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="Residencia" 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="Usuario" class=" control-label col-md-4 text-left"> Usuario :</label>
										<div class="col-md-6">
										  <select name='Usuario' rows='5' id='Usuario' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
										  <input  type='hidden' name='Email' id='Email' value='{{ Auth::user()->email }}' 
						     class='form-control form-control-sm ' /> 
									  </div> </fieldset></div></div>
	
		</div>
		
		<input type="hidden" name="action_task" value="save" />
		
		
		</div>
	</div>		

@include('sximo.module.template.ajax.formjavascript')
	{!! Form::close() !!}
	
   <script type="text/javascript">
	$(document).ready(function() { 
		
		
		
		$("#Condominio").jCombo("{!! url('gestioncomunicacion/comboselect?filter=condominios:Nombre:Nombre') !!}",
		{  initial_text: "-- Seleccionar --", selected_value : '{{ $row["Condominio"] }}' });
		
		$("#Usuario").jCombo("{!! url('gestioncomunicacion/comboselect?filter=tb_users:email:first_name|last_name|Label') !!}&parent=Condominio:",
		{ parent: '#Condominio',initial_text: "-- Seleccionar --",  selected_value : '{{ $row["Usuario"] }}' });
		 	
		 	 

		$('.removeMultiFiles').on('click',function(){
			var file =  $(this).attr('url') ;
			var removeUrl = '{{ url( $pageModule."/removefiles?file=")}}'+ file;
			$(this).parent().remove();
			$.get(removeUrl,function(response){});
			$(this).parent('div').empty();	
			return false;
		});
	});
	</script>
	<style>
  .btn:focus,.btn:active {
   outline: none !important;
   box-shadow: none;
}  
    
    
</style>	
@stop