<?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="box-header with-border" style="background-color: #E6E6E6">
				<h3 class="box-title"><b><?php echo lang('reg01_id_registro_lote'); ?>: </b></h3>
				<h3 class="box-title"><?php echo $_SESSION['identificador'] ?></h3>
			</div>
			<!-- Custom Tabs -->
			<div class="nav-tabs-custom">
				<ul class="nav nav-tabs">
					<li class=""><a href="<?php echo site_url('cuest/reg01/vista_ident_geo/'.$_SESSION['identificador']); ?>" aria-expanded="false">Ident.  Geog.</a ></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg01_caratula');        		?>" aria-expanded="false">Caratula</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg02_datos_del_lote/'); 		?>" aria-expanded="false">Reg02</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg02_ocup_i/');         		?>" aria-expanded="false">Ocup. I</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg02_ocup_ii/');        		?>" aria-expanded="false">Ocup. II</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg02_ocup_iii/');       		?>" aria-expanded="false">Ocup. III</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg02_ocup_iv/');        		?>" aria-expanded="false">Ocup. IV</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg11_ocup_v/');         		?>" aria-expanded="false">Ocup. V</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg03_uso_de_la_tierra/');       ?>" aria-expanded="false">Usos</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg04_cultivos_agricolas/');     ?>" aria-expanded="false">Cult. Agr.</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg05_produccion_ganadera/');    ?>" aria-expanded="false">Prod. Gan.</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg06_asistencia_crediticia/');  ?>" aria-expanded="false">Asist. Cred.</a></li>
					<li class="active"><a data-toggle="tab" href="<?php echo site_url('cuest/reg01/reg07_asistencia_tecnica/');        ?>" aria-expanded="true" style="  background-color: #F0F0F0">Asist. Técn.</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg08_organizacion_productor/'); ?>" aria-expanded="false">Org. Prod.</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg09_viviendas/');              ?>" aria-expanded="false">Viviendas</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg10_poblacion_censo/');        ?>" aria-expanded="false">Pob. Censo</a></li>
					<li class=""><a href="<?php echo site_url('cuest/reg01/reg12_poblacion_actual/');       ?>" aria-expanded="false">Pob. Actual</a></li>
				</ul>
				<!-- Contenido de la pestaña -->
				<div class="tab-content" style="background-color:#F0F0F0">
					<div id="tab_1" class="tab-pane active">
						<div class="box-body" style="background-color:#F0F0F0" id="div_reg01">
							<!-- Bloque de Formulario-->
							<div class="col-md-12">
								<div class="box box-primary">
									<div class="box-header with-border">
										<h3 class="box-title"><?php echo lang('reg07_capitulo_c_asist_tec'); ?></h3>
									</div>
									<?php 
									if (is_array($_SESSION['errores_cuestionario']) && array_key_exists('reg07_asistencia_tecnica', $_SESSION['errores_cuestionario']))
								    {
								       	if ($_SESSION['errores_cuestionario']['reg07_asistencia_tecnica'] != NULL) {
	                                	
	                                	    echo '<pre>';
	                                	    echo '<h4><b>Errores</b></h4>';
		
	                                	    foreach ($_SESSION['errores_cuestionario']['reg07_asistencia_tecnica'] as $key => $value)	 {
	                                	        echo '<h5>'.$value.'</h5><br>';
	                                	    } 
	                                	echo '</pre>';
	                                	}
								    }
	                                ?>
	                                <div id="pop" style="display: none;">
                                        <button type="button" class="btn btn-info" id="hide_fotos">Ocultar Fotos</button>
                                            <div id="carrusel">
                                            <?php if ($_SESSION['cant_fotos'] != 0): ?>
                                                <a href="#" class="izquierda_flecha">
                                                    <img src="http://192.168.1.131/intranet2/fotos_cuest_prb/carousel_back.png">
                                                </a>
                                                <a href="#" class="derecha_flecha">
                                                    <img src="http://192.168.1.131/intranet2/fotos_cuest_prb/carousel_next.png">
                                                </a>
                                                <a style="position:absolute;margin-right:-7%; right:0px; z-index:1; top:6%; margin-top:-2px;opacity: 0.5;cursor: pointer;" onMouseOver="this.style.opacity= 5" onMouseOut="this.style.opacity= 0.5" onclick="eliminar_imagen()" class="eliminar_img">
                                                    <img width="40%" height="40%" src="http://192.168.1.131/intranet2/fotos_cuest_prb/deleteico.png">
                                                </a>

                                                
                                                <div class="carrusel" style="left: 0px;">
                                                    <?php
                                                        $i = 0;
                                                        foreach ($_SESSION['array_fotos'] as $value):
                                                    ?>
                                                    <div class="product" id="product_<?php echo $i ?>">
                                                        <a href="<?php echo $value['ruta'] ?>" rel="shadowbox">
                                                            <img class="img_carrusel" alt="Sin imagen" id="<?php echo $value['id_foto'] ?>" src="<?php echo $value['ruta'] ?>" height="280px" width="500px">
                                                        </a>
                                                    </div>
                                                    
                                                    <?php
                                                        $i = $i + 1; 
                                                        endforeach; 
                                                    ?>
                                                </div>

                                            <?php else: ?>
                                                <h1>NO HAY FOTOS PARA ESTE CUESTIONARIO</h1>
                                            <?php endif; ?>
                                            <input id="cantidad_fotos" type="hidden" value="<?php echo $_SESSION['cant_fotos'] ?>" />
                                        </div>
                                    </div>
                                    <button type="button" class="foto_tbn btn btn-info" id="show_fotos">Ver Fotos</button>
									<div class="box-header with-border">
                                        <?php echo lang('reg07_l25', 'l25', array('class' => 'col-sm-5 control-label', 'style' => 'text-align: right;')); ?>
                                        <div class="col-sm-2">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Seleccione..."'; 
													echo form_dropdown('l25', $l25, $l25_sel,$attribute); ?>
										</div>
                                    </div>
									<?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'form-edit_user')); ?>
									<!-- Primer bloque -->
									<div class="box-body">
										<?php echo $message;?>
										<div style="overflow-x: scroll;">
										<table id="tabla" class="table table-striped table-hover">
											<thead>
												<tr>
													<th><?php echo lang('reg07_l25_1');?></th>
													<th><?php echo lang('reg07_l25_1_esp');?></th>
													<th><?php echo lang('reg07_l25_2');?></th>
													<th><?php echo lang('reg07_l25_3_1');?></th>
													<th><?php echo lang('reg07_l25_3_2');?></th>
													<th><?php echo lang('reg07_l25_3_3');?></th>
													<th><?php echo lang('reg07_l25_3_4');?></th>
													<th></th>
												</tr>
											</thead>
											<tbody>
											<?php if ($asistencia_tecnica): ?>
												<?php foreach ($asistencia_tecnica as $values):?>
													<tr>
														<td><?php echo htmlspecialchars($values->l25_1, ENT_QUOTES, 'UTF-8'); ?></td>

														<td><?php echo htmlspecialchars($values->l25_1_esp, ENT_QUOTES, 'UTF-8'); ?></td>

														<td><?php echo htmlspecialchars($values->l25_2, ENT_QUOTES, 'UTF-8'); ?></td>											
														<td><?php echo htmlspecialchars($values->l25_3_1, ENT_QUOTES, 'UTF-8'); ?></td>

														<td><?php echo htmlspecialchars($values->l25_3_2, ENT_QUOTES, 'UTF-8'); ?></td>												
														<td><?php echo htmlspecialchars($values->l25_3_3, ENT_QUOTES, 'UTF-8'); ?></td>

														<td><?php echo htmlspecialchars($values->l25_3_4, ENT_QUOTES, 'UTF-8'); ?></td>

														<?php if ($values->l25_1 == 9):?>
														<td align="center">
															<?php echo anchor('cuest/reg01/eliminar_asistencia_tecnica/'.$values->l25_1, lang('actions_delete')); ?>
														</td>
														<?php else: ?>
														<td align="center"></td>
														<?php endif; ?>
													</tr>
												<?php endforeach;?>
											<?php else: ?>
                                                    <tr>
                                                        <td colspan="10" align="center"><b>NO HAY RESULTADOS</b></td>
                                                    </tr>
                                            <?php endif ?>
											</tbody>
										</table>
										</div>
										<hr></hr>
										<div class="form-group">
											<!--<div class="col-sm-1"></div>-->
                                            <div class="col-sm-4">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="FUENTE DE CRÉDITO" id="l25_1"'; 
                                                    echo form_dropdown('l25_1', $l25_1, '',$attribute); ?>
                                            </div>
                                            <div class="col-sm-2">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="Recibió"'; 
                                                    echo form_dropdown('l25_2', $l25_2, '',$attribute); ?>
                                            </div>
                                            <div class="col-sm-2">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="Productor"'; 
                                                    echo form_dropdown('l25_3_1', $l25_3_1, '',$attribute); ?>
                                            </div>
                                            <div class="col-sm-1">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="Cónyugue"'; 
                                                    echo form_dropdown('l25_3_2', $l25_3_2, '',$attribute); ?>
                                            </div>
                                            <div class="col-sm-1">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="Hijo/a"'; 
                                                    echo form_dropdown('l25_3_3', $l25_3_3, '',$attribute); ?>
                                            </div>
                                            <div class="col-sm-1">
                                                <?php  
                                                    $attribute = 'class="selectpicker show-tick form-control" title="Otro"'; 
                                                    echo form_dropdown('l25_3_4', $l25_3_4, '',$attribute); ?>
                                            </div>
                                        </div>
                                        <div class="form-group">
											<div class="especificar col-sm-2">
                                            </div>
                                        </div>
                                        <!-- Sección botones -->
										<div class="form-group">
											<div class="col-sm-offset-1 col-sm-10" align="center">
												<div class="btn-group">
													<?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => lang('actions_submit'))); ?>
													<?php echo anchor('monitoreo/panel_control/panel_control/control_operador', 'ATRAS', array('class' => 'btn btn-default btn-flat')); ?>
												</div>
											</div>
										</div><!-- Fin sección botones -->
									</div><!-- Fin primer bloque -->
									<?php echo form_close();?>
								</div>
							</div><!-- /.box-body -->
							<!-- Fin Bloque Formulario -->
						</div><!-- /.tab-pane -->
					</div><!-- /.tab-content -->
				</div>
				<!-- Fin de contenido de la pestaña -->
			</div>
		</div>
	</section>
</div>
