<?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="active"><a data-toggle="tab" href="<?php echo site_url('cuest/reg01/reg03_uso_de_la_tierra/');        ?>" aria-expanded="true" style="  background-color: #F0F0F0">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=""><a href="<?php echo site_url('cuest/reg01/reg07_asistencia_tecnica/');     ?>" aria-expanded="false">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('reg02_capitulo_b_ocup'); ?></h3>
									</div>
									<?php 
									if (is_array($_SESSION['errores_cuestionario']) && array_key_exists('reg03_uso_de_la_tierra', $_SESSION['errores_cuestionario']))
								    {
								       	if ($_SESSION['errores_cuestionario']['reg03_uso_de_la_tierra'] != NULL) {
	                                	
	                                	    echo '<pre>';
	                                	    echo '<h4><b>Errores</b></h4>';
		
	                                	    foreach ($_SESSION['errores_cuestionario']['reg03_uso_de_la_tierra'] 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('reg03_encabezado', 'encabezado', array('class' => 'col-sm-12 control-label', 'style' => 'text-align: center;')); ?>
									</div>
									
									<?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'form-edit_user')); ?>
									<!-- Primer bloque -->
									<div class="box-body">
										<div class="col-md-6">
											<?php echo $message;?>
											<div class="form-group">
												<table id="tabla" class="table table-striped">
													<thead>
														<tr>
															<th class="col-md-1"><br>#</br></th>
															<th class="col-md-2"><?php echo lang('reg03_l20_1');?></th>
															<th class="col-md-3"><?php echo lang('reg03_l20_2');?></th>
														</tr>
													</thead>
													<tbody>
														<?php 
														$i = 0;
														foreach ($reg03_sup as $values):?>
														
														<tr>
															<td><br><?php echo $i = $i + 1; ?></br></td>
															<td style="white-space:nowrap;"><?php
																echo $l20_1[$i];
																?>                                                                    
															</td>
															<td><?php  
																echo form_input(array(
																		'type'  => 'text',
																		'name'  => 'l20_2_' . $i,
																		'id'    => 'l20_2_' . $i,
																		'value' => $values->l20_2,
															            'class' => 'superficie form-control',
															            'onkeypress' => 'return isNumberKey(event)'
																	));
																?>
															</td>
														</tr>
														<?php
															endforeach;
														?>
														<tr>
															<td></td>
															<td style="white-space:nowrap;"><?php
																echo "<b>Total Hectareas</b>"; 
																?>                                                                    
															</td>
															<td><?php  
																echo form_input(array(
																		'type'     => 'text',
																		'name'     => 'l20_total_hectareas',
																		'id'       => 'l20_total_hectareas',
																		'value'    => '',
															            'class'    => 'form-control',
															            'readonly' => true
																	));
																?>
															</td>
														</tr>
													</tbody>
												</table>
											</div>
										</div>
										<div class="col-md-6">
											<div class="form-group">
												<?php echo lang('reg02_l20_1_1', 'l20_1_1', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													echo form_input($l20_1_1); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_1', 'l21_1', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_1', $l21_1, $l21_1_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_2', 'l21_2', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_2', $l21_2, $l21_2_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_3', 'l21_3', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_3', $l21_3, $l21_3_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_4', 'l21_4', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_4', $l21_4, $l21_4_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_5', 'l21_5', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_5', $l21_5, $l21_5_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_6', 'l21_6', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_6', $l21_6, $l21_6_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_7', 'l21_7', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_7', $l21_7, $l21_7_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_8', 'l21_8', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_8', $l21_8, $l21_8_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_9', 'l21_9', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_9', $l21_9, $l21_9_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_10', 'l21_10', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_10', $l21_10, $l21_10_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_11', 'l21_11', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_11', $l21_11, $l21_11_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_12', 'l21_12', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango" id="l21_12"'; 
													echo form_dropdown('l21_12', $l21_12, $l21_12_sel,$attribute); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_12_esp', 'l21_12_esp', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													echo form_input($l21_12_esp); ?>
												</div>
											</div>
											<div class="form-group">
												<?php echo lang('reg02_l21_13', 'l21_13', array('class' => 'col-sm-6 control-label', 'style' => 'display: inline-block;text-align: left;')); ?>
												<div class="col-sm-5">
													<?php  
													$attribute = 'class="selectpicker show-tick form-control" title="Fuera de rango"'; 
													echo form_dropdown('l21_13', $l21_13, $l21_13_sel,$attribute); ?>
												</div>
											</div>
										</div>
										<hr></hr>
										<!-- Sección botones -->
										<div class="form-group">
											<div <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>
