<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$verdebug ="no";
?>

<style type="text/css">
	
 
.luz_azul {
    background: #65bcee !important ; /*abddfa*/
}

 

.luz_naranja {
    background: #ffb94d !important ;   /*ffcd7f*/
}
</style>
<div class="content-wrapper">
	<section class="content-header">
		<?php echo $pagetitle; ?>
		<?php echo $breadcrumb; ?>
	</section>

	<section class="content">
		<div class="row">
			<div class="filterable">
				<div class="col-md-5">
					<div class="box box-primary">
						<div class="box-header">
							<h3 class="box-title">
								<!-- <span class="fa fa-file-pdf-o"> </span> -->
								<span class="text-bold text-primary color-palette">Panel 2A  </span>
								Codificacion asistida 
							</h3>
						</div>
						<?php echo form_open(base_url().'monitoreo/asignacion_supervisor_verificador/index/', array('class' => 'form-horizontal', 'id' => 'form-panel_asignacion_coordinador_supervisor')); ?>
						<div class="box-body">
			          <input type 	="hidden"
			                   name 	="p1_todas_las_colonias_input"
			                   id 		="p1_todas_las_colonias_input"
			                   value 	="" 
			            /> 
			          <input type 	="hidden"
			                   name 	="xfiltrar_colonia"
			                   id 		="xfiltrar_colonia"
			                   value 	="<?php   echo htmlspecialchars($filtrar_colonia); ?>" 
			            /> 

							<div class="form-group">
									<?php echo lang('asignacion_colonia', 'p1_colonia', array('class' => 'col-sm-2 control-label')); ?>
									<div class="col-sm-10">
										<?php  

										if (!isset($filtrar_colonia))
										{
											$filtrar_colonia = 'Seleccione una colonia';
										}

										$aux_id = "p1_colonia";

										$attribute = 'class="form-control input-sm" title="Seleccione Colonia" 
													  onchange = filtrar_colonia("p1_colonia")
													  id="p1_colonia"'
										  ;
										  
										echo form_dropdown('p1_colonia', $colonia, $filtrar_colonia, $attribute);  
										?>
									</div>
							</div>

							<div class="form-group">

								<?php echo lang('asignacion_verificador', 'p1_supervisor', array('class' => 'col-sm-2 control-label')); ?>
								<div class="col-sm-5">
									<?php  

									if (!isset($p1_mantener_supervisor))
									{
										$p1_mantener_supervisor = '';
									}

									$attribute = 'class="form-control input-sm" title="Seleccione el verificador"
									 			  	id="p1_supervisor"'; 
/*
													onchange="enviar_supervisor(
													'.$filtrar_colonia.',
													'.$p1_mantener_supervisor.')
*/									
									echo form_dropdown('p1_supervisor', $verificador_asignado, $p1_mantener_supervisor, $attribute);  
									?>
								</div>
								<?php 
								echo form_button(array(
									'type' 		=> 'button',  
									'class' 	=> 'btn fa fa-refresh col-sm-1',  
									'content' 	=> '', 
									'id' 		=> 'btn_refrescar',
									'value'		=> 'btn_refrescar',  
									"onClick"	=> "refrescar_lotes_asignados_supervisor('p1_colonia' )",
									)
								); ?>
								<?php echo lang('asignacion_total_colonias', 'p1_todas_las_colonias', array('class' => 'col-sm-3 control-label')); ?>

								<div class="col-sm-1">

									<?php  

									if (!isset($checkbox_colonias))
									{
										$checkbox_colonias = FALSE;
										$checkbox_disabled = '';
									}else{
										$checkbox_colonias = TRUE;
										$checkbox_disabled = 'disabled';
									}

									$atributos = array( 
									'name'			=> 'p1_todas_las_colonias',
									'id'			=> 'p1_todas_las_colonias',
									'value'			=> 'todas_las_colonias',
									'checked'		=> $checkbox_colonias,
									$checkbox_disabled	=> $checkbox_disabled,
									'style'			=> 'margin:10px',
									'onchange'		=> "todas_las_colonias('form-panel_asignacion_coordinador_supervisor')"
									);
									echo form_checkbox($atributos);
									?>
								</div>

							</div>

						</div><!-- /.box-body -->
						<div class="box-footer">
							 
						</div>
						<?php echo form_close(); ?>

						
						<div class ="box-body">

							<table id="tabla_panel2A" class="table table-striped table-hover display compact disabled">
								<thead>
									<th >#</th>
									<th >Lote</th>
									<th style="  text-align: center">Registros</th>
									<th style="  text-align: center">Georeferencia</th> 
								</thead>
								<tbody> 
									<?php
									$contador_A=0;
									foreach ($datos_panel_2A as $values):
	//									if ($values->codigo_colonia == $filtrar_colonia || $checkbox_colonias == "true" ){
											$contador_A++; ?>

										<tr 
										id 		= panel_2A00<?php echo $contador_A; ?>								
										style 	="cursor:pointer; "
										onClick ="capturar_registro(this, 'tabla_listado_2A', 'form-panel_asignacion_coordinador_supervisor')" 
										>
											<td style="width:20px; text-align: center">
											<?php echo $contador_A; ?></td>
											<td  >
											<?php echo htmlspecialchars($values->lote,						ENT_QUOTES, 'UTF-8'); ?></td>
											<td style="  text-align: center">
											<?php echo htmlspecialchars($values->cantidad_registros,		ENT_QUOTES, 'UTF-8'); ?></td>
											<td style="  text-align: center">
											<?php echo htmlspecialchars($values->ubigeo,					ENT_QUOTES, 'UTF-8'); ?></td>
											 
											<?php // echo anchor('monitoreo/equipos/seleccionar_supervisor/'.$values->equipo_id_supervisor.'/', lang('actions_edit')); ?>
										</tr>
									<?php
	//								}
									endforeach;?>
 
								</tbody> 
							</table>
							
						</div>
						<div class ="box-body">
							<span>Cantidad de lotes para asignar:</span>
							<br>
							<span>Cantidad de registros para asignar:</span>
							<br>

									<?php
if (isset($error_asignar_uno_a_uno)  )
{	
	echo '<br>' ;
	echo "Error al desvincular lote: ".$error_asignar_uno_a_uno ."<br>";
}
if ($verdebug =="yes"){
	echo "<br>" ;
	echo '<<< INICIO DEBUG >>>' ;
	echo '<br>' ;
	echo '$p1_mantener_supervisor'. $p1_mantener_supervisor;
	echo '<br>' ;
	//echo "filtrar_colonia: ".$filtrar_colonia; 
	echo '<br>' ;
	echo '-------------------------------------------------------' ;
} 

if (isset($accion) && isset($panel2_id) &&  $verdebug =="yes")	
{ 
	echo '<br>' ;
	echo "accion: ".$accion ."<br>";
	echo "res1: ".$panel2_id ."<br>";
	echo "res2: ".$panel2_lot."<br>";
	echo "res3: ".$panel2_reg."<br>";
	echo "res4: ".$panel2_geo."<br>";
}
if (isset($error_asignar_uno_a_uno) &&  $verdebug =="yes")	
{
	echo " -------------------------------  <br>";
	echo "Atencion: ".$error_asignar_uno_a_uno."<br>";  ; 
}
 
?>
						</div>
					</div>

				</div><!-- /.col-md-5 -->




				<div class="col-md-1">

					<!-- <div class="box box-warning " style="background:#222d32; color:#fff; min-height:738px"> -->

					<div class="box box-warning "  color:#fff; min-height:738px">
					  <div class ="box-body h3" style="text-align:center">
						 
					  		<span style='font-size: 13px'> Todos </span>
							<br> 
							<?php 
							echo form_button(array(
								'type' 		=> 'button',  
								'class' 	=> 'btn btn-warning fa fa-fast-forward', 
								'disabled'	=> "disabled",
								'content' 	=> '', 
								'id' 		=> 'btn_agregar_todos',
								'value'		=> 'btn_agregar_todos',
								'onClick'	=> 'btn_accion_asignacion(this)',
								)
							); ?>
							 
							<br> 
							<br> 

							<span style='font-size: 13px'> Uno a uno </span>
							<br> 
							<?php
							echo form_button(array(
								'type' 		=> 'button',  
								'class' 	=> 'btn btn-warning fa fa-forward', 
								'disabled'	=> "disabled",
								'content' 	=> '', 
								'id' 		=> 'btn_agregar_uno_a_uno',
								'value'		=> 'btn_agregar_uno_a_uno',
								'onClick'	=> 'btn_accion_asignacion(this)',
								)
							);
							?> 
							<br> 
							<br> 

							<span style='font-size: 13px'> Remover </span>
							<br> 
							<?php
							echo form_button(array(
								'type' 		=> 'button',  
								'class' 	=> 'btn btn-primary fa fa-backward', 
								'disabled'	=> "disabled",
								'content' 	=> '', 
								'id' 		=> 'btn_remover_uno_a_uno',
								'value'		=> 'btn_remover_uno_a_uno',
								'onClick'	=> 'btn_accion_asignacion(this)',
								)
							); ?>
							 
							<br> 
							<br> 

							<span style='font-size: 13px'> Remover todo </span>
							<br> 
							<?php
							echo form_button(array(
								'type' 		=> 'button',  
								'class' 	=> 'btn btn-primary fa fa-fast-backward', 
								'disabled'	=> "disabled",
								'content' 	=> '', 
								'id' 		=> 'btn_remover_todos',
								'value'		=> 'btn_remover_todos',
								'onClick'	=> 'btn_accion_asignacion(this)',
								)
							); 
							?>
						</div>
					<br  >
					</div>

				</div><!-- /.col-md-2 -->


				<!-- /.col-md-6 -->
				<div class="col-md-6">
					<div class="box box-warning">
						<div class="box-header">
							<h3 class="box-title">
								<!-- <span class="fa fa-file-pdf-o"> </span> -->
								<span class="text-bold text-warning color-palette"> Panel 2B </span>
								Localizacion Geografica 
							</h3>
						</div>

						<?php echo form_open(base_url().'monitoreo/asignacion_supervisor_verificador/index/', array('class' => 'form-horizontal', 'id' => 'form-panel_asignacion_supervisor_verificador')); ?>
						<div class="box-body">																																	

							<div class="form-group hidden">
								<?php echo lang('asignacion_supervisor', 'p2_supervisor', array('class' => 'col-sm-2 control-label')); ?>
								<div class="col-sm-10 ">

									<?php  

									if (!isset($p1_mantener_supervisor))
									{
										$p1_mantener_supervisor = 'Seleccione una colonia';
									}

									$attribute = 'class="form-control input-sm" title="Seleccione el supervisor" 
												
												  id="p2_supervisor" '
												  ;
									//echo form_dropdown('p1_supervisor', $colonia, $filtrar_colonia, $attribute);  
									echo form_dropdown('p2_supervisor', $supervisor, $p1_mantener_supervisor, $attribute);  
									?>
 
								</div>
							</div>

							<div class="form-group ">
								<?php echo lang('resultados_para_supervisor', 'p2_verificador', array('class' => 'col-sm-2')); ?>

								<?php if(isset($p1_mantener_supervisor) && $p1_mantener_supervisor != ""){ ?>
										<div class="col-sm-10" id="nombre_supervisor_filtrado_asignaciones"></div>
								<?php }else{ ?>
										<div class="col-sm-10 hide hidden" id="nombre_supervisor_filtrado_asignaciones" hide></div>
								<?php }?>
								
							</div>
						</div><!-- /.box-body -->
						<div class="box-footer">

						</div>
						<?php echo form_close();?>

						

						<div class="box-body">

							<table id="tabla_panel2B" class="table table-striped table-hover compact">
								<thead >
					 				<th style="text-align: right">#</th>
									<th>Lote</th>
									<th>Cantidad Registros</th>
									<th>Registros Analizados</th>
									<th>Ubicacion</th> 
								</thead>
								<tbody>
									<?php 
									$contador_B=0;
									foreach ($datos_panel_2B as $values):
					 					$contador_B++;
										?>
										<tr 
										id 		= panel_2B00<?php echo $contador_B; ?>								
										style 	="cursor:pointer; " 
										onClick ="capturar_registro(this, 'tabla_listado_2B', 'form-panel_asignacion_supervisor_verificador')"
										>
											<td style="width:20px; text-align: center">
											<?php echo $contador_B; ?></td>
											<td style="width:200px; ">
											<?php echo htmlspecialchars($values->lote,						ENT_QUOTES, 'UTF-8'); ?></td>
											<td >
											<?php echo htmlspecialchars($values->cantidad_registros,		ENT_QUOTES, 'UTF-8'); ?></td>
											<td >
											<?php echo htmlspecialchars($values->cantidad_reg_analizado,	ENT_QUOTES, 'UTF-8'); ?></td>
											<td>
											<?php echo htmlspecialchars($values->ubigeo, 					ENT_QUOTES, 'UTF-8'); ?></td>
											<?php // echo anchor('monitoreo/equipos/seleccionar_supervisor/'.$values->equipo_id_supervisor.'/', lang('actions_edit')); ?>
										</tr>
									<?php endforeach; ?>
								</tbody>
							 
							</table>
						</div>
						<div class ="box-body">
							<span>Cantidad de lotes asignados al supervisor:	</span> <br>
							<span>Cantidad de registros asignados al supervisor:</span>
						</div>
					</div><!-- /.col-md-6 -->
				</div>
			</div>
		</div>
	</section>
</div>

