<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>

<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-12">
					<div class="box">
						<div class="box-body">
						<div style="overflow-x: scroll;">
							<?php echo form_open(base_url().'monitoreo/panel_control/panel_control/liberar_operador', array('class' => 'form-horizontal', 'id' => 'form-liberar')); ?>
								<?php if (!empty($message)):?>
								<pre>
								<h5><?php echo $message;?></h5>
								</pre>
								<?php endif; ?>
								<div class="form-group">
									<div class="col-sm-5">
                            			<?php $attribute = 'class="selectpicker show-tick form-control" title="Seleccione la manzana" name="dptodistritocoloniamz" id="dptodistritocoloniamz"';
	                                    
	                                    echo form_dropdown('dptodistritocoloniamz', $dptodistritocoloniamz, '', $attribute);   ?>
	                                </div>
	                                <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => 'LIBERAR', 'id' => 'boton_liberar'));
										 ?>
                            	</div>
                            	<div class="form-group">
									<label class="checkbox-inline"><h5><b>
							    	  Generar excel de Población:</b></h5>
							    	</label>
                            	</div>
                            <?php echo form_close();?>
                            		
                            <?php echo form_open(base_url().'monitoreo/panel_control/panel_control/generar_excel_poblacion', array('class' => 'form-horizontal', 'id' => 'form-generar_excel')); ?>
                            	<div class="form-group">
									<div class="col-sm-5">
                            			<?php $attribute = 'class="selectpicker show-tick form-control" title="Seleccione la colonia" name="dptodistritocolonia" enabled id="dptodistritocolonia"';
	                                    
	                                    echo form_dropdown('dptodistritocolonia', $dptodistritocolonia, '', $attribute);   ?>
	                                </div>
	                                <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-success fa fa-file-excel-o', 'content' => 'GENERAR EXCEL', 'id' => 'boton_excel'));
										 ?>
                            	</div>
                            <?php echo form_close();?>



                            	<?php echo form_close();?>
                            	<?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'form-liberar')); ?>
                            	<!--<div class="form-group">
									<?php echo lang('control_estado', 'estado', array('class' => 'col-sm-1 control-label')); ?>
	                                <div class="col-sm-2">
	                                    <?php  
	                                        $attribute = 'class="selectpicker show-tick form-control" title="Seleccione"'; 
	                                        echo form_dropdown('proceso', $estado, '',$attribute); ?>
	                                </div>
	                                <?php echo lang('control_l06', 'l06', array('class' => 'col-sm-1 control-label')); ?>
	                                <div class="col-sm-2">
	                                    <?php  
	                                        $attribute = 'class="selectpicker show-tick form-control" title="Seleccione"'; 
	                                        echo form_dropdown('l06', $l06, '',$attribute); ?>
	                                </div>
	                                <?php echo lang('control_l07', 'l07', array('class' => 'col-sm-1 control-label')); ?>
	                                <div class="col-sm-2">
	                                    <?php  
	                                        $attribute = 'class="selectpicker show-tick form-control" title="Seleccione"'; 
	                                        echo form_dropdown('l07', $l07, '',$attribute); ?>
	                                </div>
	                                <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => 'LIBERAR', 'id' => 'boton'));
										 ?>
                            	</div>-->
                            	<hr>
                            	<div style="background-color: #e8f2fb; width: 85%" class="form-group">
                            		<label class="checkbox-inline"><h5><b>
							    	  Ordenar por:</b></h5>
							    	</label>
                            		<label class="checkbox-inline">
							    	  <input type="checkbox" name="dpto" id="dpto" value="dpto">				<?php echo lang(	'control_dpto'	    		);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="distrito" value="distrito">					<?php echo lang(	'control_distrito'	    	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="colonia" value="colonia">					<?php echo lang(	'control_colonia'	    	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="manzana" value="manzana">					<?php echo lang(	'control_manzana'	    	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="lote_a" value="lote_a">						<?php echo lang(	'control_lote_a'			);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="lote_b" value="lote_b">						<?php echo lang(	'control_lote_b'			);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="cuest" value="cuest">						<?php echo lang(	'control_cuest'				);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="situacion_lote" value="situacion_lote">		<?php echo lang(	'control_situacion_lote'	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="condicion_lote" value="condicion_lote">		<?php echo lang(	'control_condicion_lote'	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="ocupante_actual" value="ocupante_actual">	<?php echo lang(	'control_ocupante_actual'	);?>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="nombre_proceso" value="nombre_proceso">		<?php echo lang(	'control_nombre_proceso'	);?>
							    	</label>
							    	<label class="checkbox-inline"><h5><b>
							    	  Orden:</b></h5>
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="ASC" value="ASC">Ascendente
							    	</label>
							    	<label class="checkbox-inline">
							    	  <input type="checkbox" name="DESC" value="DESC">Descendente
							    	</label>
							    </div>
							    <hr>
                            	<?php echo form_close();?>

                            <table id="tabla_operador" class="table table-striped table-hover">
								<thead>
									<tr>
										<th><?php echo lang(	'control_dpto'	    			);?></th>
                                        <th><?php echo lang(	'control_distrito' 				);?></th>
                                        <th><?php echo lang(	'control_colonia'				);?></th>
                                        <th><?php echo lang(	'control_manzana'				);?></th>
                                        <th><?php echo lang(	'control_lote_a'				);?></th>
                                        <th><?php echo lang(	'control_lote_b'				);?></th>
										<th><?php echo lang(	'control_cuest'					);?></th>
                                        <th><?php echo lang(	'control_situacion_lote'		);?></th>
                                        <th><?php echo lang(	'control_condicion_lote'		);?></th>
                                        <th><?php echo lang(	'control_ocupante_actual'		);?></th>
                                        <th><?php echo lang(	'control_cultivo'				);?></th>
                                        <th><?php echo lang(	'control_produccion_ganadera'	);?></th>
                                        <th><?php echo lang(	'control_asistencia_crediticia'	);?></th>
                                        <th><?php echo lang(	'control_asistencia_tecnica'	);?></th>
                                        <th><?php echo lang(	'control_organizacion'			);?></th>
                                        <th><?php echo lang(	'control_nombre_proceso'		);?></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
									</tr>
								</thead>
								<tbody class="muestra_geocolonias">
									<?php foreach ($control_operador as $values):?>
										<tr>
										<?php 	if ($values->proceso == 'A02') {
													$bgcolor = '#F2F5A9';
												}elseif ($values->proceso == 'A03') {
													$bgcolor = '#A9BCF5';
												}elseif ($values->proceso == 'A04') {
													$bgcolor = '#81F781';
												}elseif ($values->proceso == 'A07') {
													$bgcolor = '#FA5858';
												}else{
													$bgcolor = 'white';
												}
										?>
											<td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->dpto, 					ENT_QUOTES, 'UTF-8'); ?></td>
		
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->distrito, 				ENT_QUOTES, 'UTF-8'); ?></td>
		
											<td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->colonia, 					ENT_QUOTES, 'UTF-8'); ?></td>	
					
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->manzana, 					ENT_QUOTES, 'UTF-8'); ?></td>	
			
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->lote_a, 					ENT_QUOTES, 'UTF-8'); ?></td>																	
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->lote_b, 					ENT_QUOTES, 'UTF-8'); ?></td>	
			
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->cuest, 					ENT_QUOTES, 'UTF-8'); ?></td>	
	
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->situacion_lote, 			ENT_QUOTES, 'UTF-8'); ?></td>	
	
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->condicion_lote, 			ENT_QUOTES, 'UTF-8'); ?></td>	
                                            
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->ocupante_actual, 			ENT_QUOTES, 'UTF-8'); ?></td>	
	
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->cultivo, 					ENT_QUOTES, 'UTF-8'); ?></td>	
	
                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->produccion_ganadera, 		ENT_QUOTES, 'UTF-8'); ?></td>

                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->asistencia_crediticia, 	ENT_QUOTES, 'UTF-8'); ?></td>

                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->asistencia_tecnica, 		ENT_QUOTES, 'UTF-8'); ?></td>

                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->organizacion, 			ENT_QUOTES, 'UTF-8'); ?></td>

                                            <td bgcolor="<?php echo $bgcolor ?>"><?php echo htmlspecialchars($values->nombre_proceso, 			ENT_QUOTES, 'UTF-8'); ?></td>

											<!--<td bgcolor="<?php echo $bgcolor ?>">
												<?php echo anchor('cuest/reg01/vista_ident_geo/'.$values->id_registro_lote, '<i class="glyphicon glyphicon-eye-open btn btn-xs bg-blue color-palette"></i>'); ?>
											</td>-->
											<td bgcolor="<?php echo $bgcolor ?>">
												<?php echo anchor('cuest/reg01/vista_ident_geo/'.$values->id_registro_lote, '<i class="fa fa-pencil btn btn-xs bg-orange color-palette"></i>'); ?>
											</td>
											<td bgcolor="<?php echo $bgcolor ?>">
												<?php echo anchor('monitoreo/panel_control/panel_control/terminar_operador/'.$values->id_registro_lote, '<i class="fa fa-check fa-lg"></i>'); ?>
												
											</td>
											<td bgcolor="<?php echo $bgcolor ?>">
												<?php echo anchor('monitoreo/panel_control/panel_control/terminar_operador/'.$values->id_registro_lote, '<i class="fa fa-check fa-lg"></i>'); ?>
												
											</td>
										</tr>

									<?php endforeach;?>
								</tbody>
							</table>
							</div>
							<?php echo $pagination; ?>
						</div>
						<div class="box-body">
							<?php foreach ($estadistica_registros as $value):?>
							<b><h4>Registros asignados: <?php echo $value->registros_asignados; ?></h4></b>
							<b><h4>Registros analizados: <?php echo $value->registros_analizados; ?></h4></b>
							<?php endforeach; ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
</div>


