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

class Dictamen_b extends Admin_Controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('expedientes/dictamen_model');
		//$this->lang->load('expedientes/dictamen_lang');

		/* Titulo de la pagina :: Common */
		$this->page_title->push(lang('menu_dictamen_b'));
		$this->data['pagetitle'] = $this->page_title->show();

		//verificación de módulo para el reset de las variables de sessión utilizadas en la misma
		if ($_SESSION['id_modulo'] != 'DICTAMEN_B') {

			//$_SESSION['arraywhere_expedientes'] 		 = NULL;
			//$_SESSION['arraywhere_expedientes_busqueda'] = NULL;
			//$_SESSION['id_modulo'] = 'EXPEDIENTES';
		}
		
		/* Breadcrumbs :: Common */
		$this->breadcrumbs->unshift(2, lang('menu_expedientes'), 'expedientes/expedientes');
	}

	
	public function index($expe_id)
	{
		if ( ! $this->ion_auth->logged_in() OR ! $this->ion_auth->is_admin())
		{
			redirect('auth/login', 'refresh');
		}
		else
		{	
			/********* DATOS EXP ****************/
			$this->data['expe_info'] = $this->dictamen_model->dropdown_data('exp', array('expe_id' => $expe_id))->row();
			/********* FIN DATOS EXP ****************/

			/********* DATOS DIC1_DATOS ****************/
			$exist_exp 	= $this->dictamen_model->dropdown_data('dic1_datos', array('dic1_expe_id' => $expe_id))->result_array();

			$this->data['expe_id'] = $exist_exp[0]['dic1_expe_id'];
			
			
			foreach ($exist_exp as $value) {

				$dict_datos[$value['concepto']] = $value['valor'];
			}

			$dict_datos = (object)$dict_datos;
			$this->data['dict_datos'] = $dict_datos;
			/********* FIN DATOS DIC1_DATOS ****************/

			/********* DATOS DIC2_MAPAS_IMG ****************/
			$dic2_mapimg_campos = $this->dictamen_model->dropdown_data('dic2_mapas_img', array('dic2_expe_id' => $expe_id))->result_array();

			foreach ($dic2_mapimg_campos as $valued2) {

				foreach ($valued2 as $key => $val) {
					if ($key != 'dic2_id_mapa') {
						$arrayd2[$valued2['dic2_id_mapa']][$key] = $val;
					}
				}
			}

			$dic2_mapimg = (object)$arrayd2;
			/********* FIN DATOS DIC2_MAPAS_IMG ****************/

			/********* DATOS DIC3_VERIFICACION ****************/
			$dic3_verificacion_campos = $this->dictamen_model->dropdown_data('dic3_verificacion', array('dic3_expe_id' => $expe_id))->result_array();

			foreach ($dic3_verificacion_campos as $valued3) {

				foreach ($valued3 as $key => $val) {
					if ($key != 'dic3_id_analisis') {
						$arrayd3[$valued3['dic3_id_analisis']][$key] = $val;
					}
				}
			}

			$dic3_verificacion = (object)$arrayd3;
			/********* FIN DATOS DIC3_VERIFICACION ****************/


			if ($_POST) { 

				if($_POST['dic1_mapa_localizacion']){
					$arraycampos[] = array('mapa_localizacion','SI');
				}else{
					$arraycampos[] = array('mapa_localizacion','NO');
				}

				if($_POST['dic1_leyenda_tematica']){
					$arraycampos[] = array('leyenda_tematica','SI');
				}else{
					$arraycampos[] = array('leyenda_tematica','NO');
				}

				if($_POST['dic1_leyenda_signos_conv']){
					$arraycampos[] = array('leyenda_signos_conv','SI');
				}else{
					$arraycampos[] = array('leyenda_signos_conv','NO');
				}

				if($_POST['dic1_fuente_tematica']){
					$arraycampos[] = array('fuente_tematica','SI');
				}else{
					$arraycampos[] = array('fuente_tematica','NO');
				}

				if($_POST['dic1_fuente_cartografica']){
					$arraycampos[] = array('fuente_cartografica','SI');
				}else{
					$arraycampos[] = array('fuente_cartografica','NO');
				}

				if($_POST['dic1_norte']){
					$arraycampos[] = array('norte','SI');
				}else{
					$arraycampos[] = array('norte','NO');
				}

				if($_POST['dic1_escala_grafica']){
					$arraycampos[] = array('escala_grafica','SI');
				}else{
					$arraycampos[] = array('escala_grafica','NO');
				}

				if($_POST['dic1_escala_numerica']){
					$arraycampos[] = array('escala_numerica','SI');
				}else{
					$arraycampos[] = array('escala_numerica','NO');
				}

				if($_POST['dic1_cuadro_superficies_porc']){
					$arraycampos[] = array('cuadro_superficies_porc','SI');
				}else{
					$arraycampos[] = array('cuadro_superficies_porc','NO');
				}

				if($_POST['dic1_proyeccion_carto_utm']){
					$arraycampos[] = array('proyeccion_carto_utm','SI');
				}else{
					$arraycampos[] = array('proyeccion_carto_utm','NO');
				}

				if($_POST['dic1_elipsoide_wgs84']){
					$arraycampos[] = array('elipsoide_wgs84','SI');
				}else{
					$arraycampos[] = array('elipsoide_wgs84','NO');
				}

				if($_POST['dic1_red_vial']){
					$arraycampos[] = array('red_vial','SI');
				}else{
					$arraycampos[] = array('red_vial','NO');
				}

				if($_POST['dic1_red_hidrografica']){
					$arraycampos[] = array('red_hidrografica','SI');
				}else{
					$arraycampos[] = array('red_hidrografica','NO');
				}

				if($_POST['dic1_equipamiento']){
					$arraycampos[] = array('equipamiento','SI');
				}else{
					$arraycampos[] = array('equipamiento','NO');
				}

				if($_POST['dic1_linderamiento']){
					$arraycampos[] = array('linderamiento','SI');
				}else{
					$arraycampos[] = array('linderamiento','NO');
				}

				if($_POST['dic1_distancias']){
					$arraycampos[] = array('distancias','SI');
				}else{
					$arraycampos[] = array('distancias','NO');
				}

				if($_POST['dic1_rumbos']){
					$arraycampos[] = array('rumbos','SI');
				}else{
					$arraycampos[] = array('rumbos','NO');
				}

				if($_POST['dic1_colindantes']){
					$arraycampos[] = array('colindantes','SI');
				}else{
					$arraycampos[] = array('colindantes','NO');
				}

				if($_POST['dic1_cuadricula_utm']){
					$arraycampos[] = array('cuadricula_utm','SI');
				}else{
					$arraycampos[] = array('cuadricula_utm','NO');
				}

				if($_POST['dic1_coordenadas_esquinero']){
					$arraycampos[] = array('coordenadas_esquinero','SI');
				}else{
					$arraycampos[] = array('coordenadas_esquinero','NO');
				}

				if($_POST['dic1_titulo_mapa']){
					$arraycampos[] = array('titulo_mapa','SI');
				}else{
					$arraycampos[] = array('titulo_mapa','NO');
				}

				if($_POST['dic1_propietario']){
					$arraycampos[] = array('propietario','SI');
				}else{
					$arraycampos[] = array('propietario','NO');
				}

				if($_POST['dic1_lugar']){
					$arraycampos[] = array('lugar','SI');
				}else{
					$arraycampos[] = array('lugar','NO');
				}

				if($_POST['dic1_distrito']){
					$arraycampos[] = array('distrito','SI');
				}else{
					$arraycampos[] = array('distrito','NO');
				}

				if($_POST['dic1_departamento']){
					$arraycampos[] = array('departamento','SI');
				}else{
					$arraycampos[] = array('departamento','NO');
				}

				if($_POST['dic1_finca']){
					$arraycampos[] = array('finca','SI');
				}else{
					$arraycampos[] = array('finca','NO');
				}

				if($_POST['dic1_padron']){
					$arraycampos[] = array('padron','SI');
				}else{
					$arraycampos[] = array('padron','NO');
				}

				if($_POST['dic1_responsable_cartografia']){
					$arraycampos[] = array('responsable_cartografia','SI');
				}else{
					$arraycampos[] = array('responsable_cartografia','NO');
				}

				if($_POST['dic1_fecha_impresion']){
					$arraycampos[] = array('fecha_impresion','SI');
				}else{
					$arraycampos[] = array('fecha_impresion','NO');
				}

				if($_POST['dic1_responsable_cartografia']){
					$arraycampos[] = array('responsable_cartografia','SI');
				}else{
					$arraycampos[] = array('responsable_cartografia','NO');
				}

				if($_POST['dic1_aclaracion']){
					$arraycampos[] = array('aclaracion','SI');
				}else{
					$arraycampos[] = array('aclaracion','NO');
				}

				if($_POST['dic1_responsable_cartografia']){
					$arraycampos[] = array('responsable_cartografia','SI');
				}else{
					$arraycampos[] = array('responsable_cartografia','NO');
				}

				if($_POST['dic1_responsable_cartografia']){
					$arraycampos[] = array('responsable_cartografia','SI');
				}else{
					$arraycampos[] = array('responsable_cartografia','NO');
				}
				
				echo '<pre>';
				print_r($arraycampos);
				echo '</pre>';
				show_error(1);

				if ($_POST['expe_id_expediente']) 
				{
					$arraywhere['expe_id_expediente'] 					= $_POST['expe_id_expediente'];
					$arraywherebusq['expe_id_expediente like '] 		= '%'.$_POST['expe_id_expediente'].'%';
				}

			}else{
				//*******************************************************
				//*******************************************************
				$this->data['dic2_imagen_17_12_86_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_17_12_86_imp',
					'id'       => 'dic2_imagen_17_12_86_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_17_12_86['dic2_impresion']=='SI'){
					$this->data['dic2_imagen_17_12_86_imp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_s'] = TRUE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_17_12_86['dic2_impresion']=='NO') {
					$this->data['dic2_imagen_17_12_86_imp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_17_12_86_imp']['checked_x'] = TRUE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_17_12_86_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_17_12_86_shp',
					'id'       => 'dic2_imagen_17_12_86_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_17_12_86['dic2_shapefile']=='SI'){
					$this->data['dic2_imagen_17_12_86_shp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_s'] = TRUE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_17_12_86['dic2_shapefile']=='NO') {
					$this->data['dic2_imagen_17_12_86_shp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_17_12_86_shp']['checked_x'] = TRUE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_17_12_86_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_17_12_86_form',
					'id'       => 'dic2_imagen_17_12_86_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_17_12_86['dic2_formato']=='SI'){
					$this->data['dic2_imagen_17_12_86_form']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_form']['checked_s'] = TRUE;
					$this->data['dic2_imagen_17_12_86_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_17_12_86['dic2_formato']=='NO') {
					$this->data['dic2_imagen_17_12_86_form']['checked_x'] = FALSE;
					$this->data['dic2_imagen_17_12_86_form']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_17_12_86_form']['checked_x'] = TRUE;
					$this->data['dic2_imagen_17_12_86_form']['checked_s'] = FALSE;
					$this->data['dic2_imagen_17_12_86_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_17_12_86_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_imagen_17_12_86_esc',
					'id'       => 'dic2_imagen_17_12_86_esc',
					'value'    => $dic2_mapimg->imagen_17_12_86['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_imagen_actualizada_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_actualizada_imp',
					'id'       => 'dic2_imagen_actualizada_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_actualizada['dic2_impresion']=='SI'){
					$this->data['dic2_imagen_actualizada_imp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_imp']['checked_s'] = TRUE;
					$this->data['dic2_imagen_actualizada_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_actualizada['dic2_impresion']=='NO') {
					$this->data['dic2_imagen_actualizada_imp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_imp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_actualizada_imp']['checked_x'] = TRUE;
					$this->data['dic2_imagen_actualizada_imp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_actualizada_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_actualizada_shp',
					'id'       => 'dic2_imagen_actualizada_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_actualizada['dic2_shapefile']=='SI'){
					$this->data['dic2_imagen_actualizada_shp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_shp']['checked_s'] = TRUE;
					$this->data['dic2_imagen_actualizada_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_actualizada['dic2_shapefile']=='NO') {
					$this->data['dic2_imagen_actualizada_shp']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_shp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_actualizada_shp']['checked_x'] = TRUE;
					$this->data['dic2_imagen_actualizada_shp']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_actualizada_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_imagen_actualizada_form',
					'id'       => 'dic2_imagen_actualizada_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->imagen_actualizada['dic2_formato']=='SI'){
					$this->data['dic2_imagen_actualizada_form']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_form']['checked_s'] = TRUE;
					$this->data['dic2_imagen_actualizada_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->imagen_actualizada['dic2_formato']=='NO') {
					$this->data['dic2_imagen_actualizada_form']['checked_x'] = FALSE;
					$this->data['dic2_imagen_actualizada_form']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_imagen_actualizada_form']['checked_x'] = TRUE;
					$this->data['dic2_imagen_actualizada_form']['checked_s'] = FALSE;
					$this->data['dic2_imagen_actualizada_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_imagen_actualizada_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_imagen_actualizada_esc',
					'id'       => 'dic2_imagen_actualizada_esc',
					'value'    => $dic2_mapimg->imagen_actualizada['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_uso_tierra_17_12_86_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_tierra_17_12_86_imp',
					'id'       => 'dic2_uso_tierra_17_12_86_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_tierra_17_12_86['dic2_impresion']=='SI'){
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_s'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_tierra_17_12_86['dic2_impresion']=='NO') {
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_x'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_tierra_17_12_86_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_tierra_17_12_86_shp',
					'id'       => 'dic2_uso_tierra_17_12_86_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_tierra_17_12_86['dic2_shapefile']=='SI'){
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_s'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_tierra_17_12_86['dic2_shapefile']=='NO') {
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_x'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_tierra_17_12_86_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_tierra_17_12_86_form',
					'id'       => 'dic2_uso_tierra_17_12_86_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_tierra_17_12_86['dic2_formato']=='SI'){
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_s'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_tierra_17_12_86['dic2_formato']=='NO') {
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_x'] = TRUE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_tierra_17_12_86_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_tierra_17_12_86_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_uso_tierra_17_12_86_esc',
					'id'       => 'dic2_uso_tierra_17_12_86_esc',
					'value'    => $dic2_mapimg->uso_tierra_17_12_86['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_uso_actual_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_actual_imp',
					'id'       => 'dic2_uso_actual_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_actual['dic2_impresion']=='SI'){
					$this->data['dic2_uso_actual_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_imp']['checked_s'] = TRUE;
					$this->data['dic2_uso_actual_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_actual['dic2_impresion']=='NO') {
					$this->data['dic2_uso_actual_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_actual_imp']['checked_x'] = TRUE;
					$this->data['dic2_uso_actual_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_actual_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_actual_shp',
					'id'       => 'dic2_uso_actual_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_actual['dic2_shapefile']=='SI'){
					$this->data['dic2_uso_actual_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_shp']['checked_s'] = TRUE;
					$this->data['dic2_uso_actual_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_actual['dic2_shapefile']=='NO') {
					$this->data['dic2_uso_actual_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_actual_shp']['checked_x'] = TRUE;
					$this->data['dic2_uso_actual_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_actual_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_actual_form',
					'id'       => 'dic2_uso_actual_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_actual['dic2_formato']=='SI'){
					$this->data['dic2_uso_actual_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_form']['checked_s'] = TRUE;
					$this->data['dic2_uso_actual_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_actual['dic2_formato']=='NO') {
					$this->data['dic2_uso_actual_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_actual_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_actual_form']['checked_x'] = TRUE;
					$this->data['dic2_uso_actual_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_actual_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_actual_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_uso_actual_esc',
					'id'       => 'dic2_uso_actual_esc',
					'value'    => $dic2_mapimg->uso_actual['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_taxonomia_suelo_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_taxonomia_suelo_imp',
					'id'       => 'dic2_taxonomia_suelo_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->taxonomia_suelo['dic2_impresion']=='SI'){
					$this->data['dic2_taxonomia_suelo_imp']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_s'] = TRUE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->taxonomia_suelo['dic2_impresion']=='NO') {
					$this->data['dic2_taxonomia_suelo_imp']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_taxonomia_suelo_imp']['checked_x'] = TRUE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_taxonomia_suelo_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_taxonomia_suelo_shp',
					'id'       => 'dic2_taxonomia_suelo_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->taxonomia_suelo['dic2_shapefile']=='SI'){
					$this->data['dic2_taxonomia_suelo_shp']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_s'] = TRUE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->taxonomia_suelo['dic2_shapefile']=='NO') {
					$this->data['dic2_taxonomia_suelo_shp']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_taxonomia_suelo_shp']['checked_x'] = TRUE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_taxonomia_suelo_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_taxonomia_suelo_form',
					'id'       => 'dic2_taxonomia_suelo_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->taxonomia_suelo['dic2_formato']=='SI'){
					$this->data['dic2_taxonomia_suelo_form']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_form']['checked_s'] = TRUE;
					$this->data['dic2_taxonomia_suelo_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->taxonomia_suelo['dic2_formato']=='NO') {
					$this->data['dic2_taxonomia_suelo_form']['checked_x'] = FALSE;
					$this->data['dic2_taxonomia_suelo_form']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_taxonomia_suelo_form']['checked_x'] = TRUE;
					$this->data['dic2_taxonomia_suelo_form']['checked_s'] = FALSE;
					$this->data['dic2_taxonomia_suelo_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_taxonomia_suelo_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_taxonomia_suelo_esc',
					'id'       => 'dic2_taxonomia_suelo_esc',
					'value'    => $dic2_mapimg->taxonomia_suelo['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_capacidad_aptitud_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_capacidad_aptitud_imp',
					'id'       => 'dic2_capacidad_aptitud_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->capacidad_aptitud['dic2_impresion']=='SI'){
					$this->data['dic2_capacidad_aptitud_imp']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_s'] = TRUE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->capacidad_aptitud['dic2_impresion']=='NO') {
					$this->data['dic2_capacidad_aptitud_imp']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_capacidad_aptitud_imp']['checked_x'] = TRUE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_capacidad_aptitud_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_capacidad_aptitud_shp',
					'id'       => 'dic2_capacidad_aptitud_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->capacidad_aptitud['dic2_shapefile']=='SI'){
					$this->data['dic2_capacidad_aptitud_shp']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_s'] = TRUE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->capacidad_aptitud['dic2_shapefile']=='NO') {
					$this->data['dic2_capacidad_aptitud_shp']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_capacidad_aptitud_shp']['checked_x'] = TRUE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_capacidad_aptitud_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_capacidad_aptitud_form',
					'id'       => 'dic2_capacidad_aptitud_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->capacidad_aptitud['dic2_formato']=='SI'){
					$this->data['dic2_capacidad_aptitud_form']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_form']['checked_s'] = TRUE;
					$this->data['dic2_capacidad_aptitud_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->capacidad_aptitud['dic2_formato']=='NO') {
					$this->data['dic2_capacidad_aptitud_form']['checked_x'] = FALSE;
					$this->data['dic2_capacidad_aptitud_form']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_capacidad_aptitud_form']['checked_x'] = TRUE;
					$this->data['dic2_capacidad_aptitud_form']['checked_s'] = FALSE;
					$this->data['dic2_capacidad_aptitud_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_capacidad_aptitud_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_capacidad_aptitud_esc',
					'id'       => 'dic2_capacidad_aptitud_esc',
					'value'    => $dic2_mapimg->capacidad_aptitud['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_uso_alternativo_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_alternativo_imp',
					'id'       => 'dic2_uso_alternativo_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_alternativo['dic2_impresion']=='SI'){
					$this->data['dic2_uso_alternativo_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_imp']['checked_s'] = TRUE;
					$this->data['dic2_uso_alternativo_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_alternativo['dic2_impresion']=='NO') {
					$this->data['dic2_uso_alternativo_imp']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_alternativo_imp']['checked_x'] = TRUE;
					$this->data['dic2_uso_alternativo_imp']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_alternativo_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_alternativo_shp',
					'id'       => 'dic2_uso_alternativo_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_alternativo['dic2_shapefile']=='SI'){
					$this->data['dic2_uso_alternativo_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_shp']['checked_s'] = TRUE;
					$this->data['dic2_uso_alternativo_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_alternativo['dic2_shapefile']=='NO') {
					$this->data['dic2_uso_alternativo_shp']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_alternativo_shp']['checked_x'] = TRUE;
					$this->data['dic2_uso_alternativo_shp']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_alternativo_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_uso_alternativo_form',
					'id'       => 'dic2_uso_alternativo_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->uso_alternativo['dic2_formato']=='SI'){
					$this->data['dic2_uso_alternativo_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_form']['checked_s'] = TRUE;
					$this->data['dic2_uso_alternativo_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->uso_alternativo['dic2_formato']=='NO') {
					$this->data['dic2_uso_alternativo_form']['checked_x'] = FALSE;
					$this->data['dic2_uso_alternativo_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_uso_alternativo_form']['checked_x'] = TRUE;
					$this->data['dic2_uso_alternativo_form']['checked_s'] = FALSE;
					$this->data['dic2_uso_alternativo_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_uso_alternativo_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_uso_alternativo_esc',
					'id'       => 'dic2_uso_alternativo_esc',
					'value'    => $dic2_mapimg->uso_alternativo['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_mapa_fincas_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_fincas_imp',
					'id'       => 'dic2_mapa_fincas_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_fincas['dic2_impresion']=='SI'){
					$this->data['dic2_mapa_fincas_imp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_imp']['checked_s'] = TRUE;
					$this->data['dic2_mapa_fincas_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_fincas['dic2_impresion']=='NO') {
					$this->data['dic2_mapa_fincas_imp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_imp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_fincas_imp']['checked_x'] = TRUE;
					$this->data['dic2_mapa_fincas_imp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_fincas_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_fincas_shp',
					'id'       => 'dic2_mapa_fincas_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_fincas['dic2_shapefile']=='SI'){
					$this->data['dic2_mapa_fincas_shp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_shp']['checked_s'] = TRUE;
					$this->data['dic2_mapa_fincas_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_fincas['dic2_shapefile']=='NO') {
					$this->data['dic2_mapa_fincas_shp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_shp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_fincas_shp']['checked_x'] = TRUE;
					$this->data['dic2_mapa_fincas_shp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_fincas_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_fincas_form',
					'id'       => 'dic2_mapa_fincas_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_fincas['dic2_formato']=='SI'){
					$this->data['dic2_mapa_fincas_form']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_form']['checked_s'] = TRUE;
					$this->data['dic2_mapa_fincas_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_fincas['dic2_formato']=='NO') {
					$this->data['dic2_mapa_fincas_form']['checked_x'] = FALSE;
					$this->data['dic2_mapa_fincas_form']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_fincas_form']['checked_x'] = TRUE;
					$this->data['dic2_mapa_fincas_form']['checked_s'] = FALSE;
					$this->data['dic2_mapa_fincas_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_fincas_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_mapa_fincas_esc',
					'id'       => 'dic2_mapa_fincas_esc',
					'value'    => $dic2_mapimg->mapa_fincas['dic2_escala'],
					'class'    => 'form-control',
				);
				//*******************************************************
				//*******************************************************
				$this->data['dic2_mapa_ubic_parcela_imp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_ubic_parcela_imp',
					'id'       => 'dic2_mapa_ubic_parcela_imp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_ubic_parcela['dic2_impresion']=='SI'){
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_s'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_ubic_parcela['dic2_impresion']=='NO') {
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_x'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_imp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_ubic_parcela_shp'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_ubic_parcela_shp',
					'id'       => 'dic2_mapa_ubic_parcela_shp',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_ubic_parcela['dic2_shapefile']=='SI'){
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_s'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_ubic_parcela['dic2_shapefile']=='NO') {
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_x'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_shp']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_ubic_parcela_form'] = array(
					'type'     => 'radio',
					'name'	   => 'dic2_mapa_ubic_parcela_form',
					'id'       => 'dic2_mapa_ubic_parcela_form',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic2_mapimg->mapa_ubic_parcela['dic2_formato']=='SI'){
					$this->data['dic2_mapa_ubic_parcela_form']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_s'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_n'] = FALSE;
				}elseif ($dic2_mapimg->mapa_ubic_parcela['dic2_formato']=='NO') {
					$this->data['dic2_mapa_ubic_parcela_form']['checked_x'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_n'] = TRUE;
				}else{
					$this->data['dic2_mapa_ubic_parcela_form']['checked_x'] = TRUE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_s'] = FALSE;
					$this->data['dic2_mapa_ubic_parcela_form']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic2_mapa_ubic_parcela_esc'] = array(
					'type'     => 'text',
					'name'	   => 'dic2_mapa_ubic_parcela_esc',
					'id'       => 'dic2_mapa_ubic_parcela_esc',
					'value'    => $dic2_mapimg->mapa_ubic_parcela['dic2_escala'],
					'class'    => 'form-control',
				);

				/*******************************************************
							DIC3_VERIFICACION
				*******************************************************/
				$this->data['dic3_reserv_bosque_legal_exis'] = array(
					'type'     => 'radio',
					'name'	   => 'dic3_reserv_bosque_legal_exis',
					'id'       => 'dic3_reserv_bosque_legal_exis',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic3_verificacion->reserv_bosque_legal['dic3_existencia']=='SI'){
					$this->data['dic3_reserv_bosque_legal_exis']['checked_x'] = FALSE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_s'] = TRUE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_n'] = FALSE;
				}elseif ($dic3_verificacion->reserv_bosque_legal['dic3_existencia']=='NO') {
					$this->data['dic3_reserv_bosque_legal_exis']['checked_x'] = FALSE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_s'] = FALSE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_n'] = TRUE;
				}else{
					$this->data['dic3_reserv_bosque_legal_exis']['checked_x'] = TRUE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_s'] = FALSE;
					$this->data['dic3_reserv_bosque_legal_exis']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic3_reserv_bosque_legal_sup'] = array(
					'type'     => 'text',
					'name'	   => 'dic3_reserv_bosque_legal_sup',
					'id'       => 'dic3_reserv_bosque_legal_sup',
					'value'    => $dic3_verificacion->reserv_bosque_legal['dic3_superficie'],
					'class'    => 'form-control',
				);
				/*******************************************************
				*******************************************************/
				$this->data['dic3_bosque_proteccion_hidrica_exis'] = array(
					'type'     => 'radio',
					'name'	   => 'dic3_bosque_proteccion_hidrica_exis',
					'id'       => 'dic3_bosque_proteccion_hidrica_exis',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic3_verificacion->bosque_proteccion_hidrica['dic3_existencia']=='SI'){
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_x'] = FALSE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_s'] = TRUE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_n'] = FALSE;
				}elseif ($dic3_verificacion->bosque_proteccion_hidrica['dic3_existencia']=='NO') {
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_x'] = FALSE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_s'] = FALSE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_n'] = TRUE;
				}else{
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_x'] = TRUE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_s'] = FALSE;
					$this->data['dic3_bosque_proteccion_hidrica_exis']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic3_bosque_proteccion_hidrica_sup'] = array(
					'type'     => 'text',
					'name'	   => 'dic3_bosque_proteccion_hidrica_sup',
					'id'       => 'dic3_bosque_proteccion_hidrica_sup',
					'value'    => $dic3_verificacion->bosque_proteccion_hidrica['dic3_superficie'],
					'class'    => 'form-control',
				);
				/*******************************************************
				*******************************************************/
				$this->data['dic3_deforest_bosque_nativo_exis'] = array(
					'type'     => 'radio',
					'name'	   => 'dic3_deforest_bosque_nativo_exis',
					'id'       => 'dic3_deforest_bosque_nativo_exis',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic3_verificacion->deforest_bosque_nativo['dic3_existencia']=='SI'){
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_x'] = FALSE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_s'] = TRUE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_n'] = FALSE;
				}elseif ($dic3_verificacion->deforest_bosque_nativo['dic3_existencia']=='NO') {
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_x'] = FALSE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_s'] = FALSE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_n'] = TRUE;
				}else{
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_x'] = TRUE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_s'] = FALSE;
					$this->data['dic3_deforest_bosque_nativo_exis']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic3_deforest_bosque_nativo_sup'] = array(
					'type'     => 'text',
					'name'	   => 'dic3_deforest_bosque_nativo_sup',
					'id'       => 'dic3_deforest_bosque_nativo_sup',
					'value'    => $dic3_verificacion->deforest_bosque_nativo['dic3_superficie'],
					'class'    => 'form-control',
				);
				/*******************************************************
				*******************************************************/
				$this->data['dic3_barreras_vivas_proteccion_exis'] = array(
					'type'     => 'radio',
					'name'	   => 'dic3_barreras_vivas_proteccion_exis',
					'id'       => 'dic3_barreras_vivas_proteccion_exis',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic3_verificacion->barreras_vivas_proteccion['dic3_existencia']=='SI'){
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_x'] = FALSE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_s'] = TRUE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_n'] = FALSE;
				}elseif ($dic3_verificacion->barreras_vivas_proteccion['dic3_existencia']=='NO') {
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_x'] = FALSE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_s'] = FALSE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_n'] = TRUE;
				}else{
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_x'] = TRUE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_s'] = FALSE;
					$this->data['dic3_barreras_vivas_proteccion_exis']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic3_barreras_vivas_proteccion_sup'] = array(
					'type'     => 'text',
					'name'	   => 'dic3_barreras_vivas_proteccion_sup',
					'id'       => 'dic3_barreras_vivas_proteccion_sup',
					'value'    => $dic3_verificacion->barreras_vivas_proteccion['dic3_superficie'],
					'class'    => 'form-control',
				);
				/*******************************************************
				*******************************************************/
				$this->data['dic3_areas_silv_protegidas_exis'] = array(
					'type'     => 'radio',
					'name'	   => 'dic3_areas_silv_protegidas_exis',
					'id'       => 'dic3_areas_silv_protegidas_exis',
					'value_x'  => '2',
					'value_s'  => '1',
					'value_n'  => '0',
					'class'    => 'form-control',
				);
				if($dic3_verificacion->areas_silv_protegidas['dic3_existencia']=='SI'){
					$this->data['dic3_areas_silv_protegidas_exis']['checked_x'] = FALSE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_s'] = TRUE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_n'] = FALSE;
				}elseif ($dic3_verificacion->areas_silv_protegidas['dic3_existencia']=='NO') {
					$this->data['dic3_areas_silv_protegidas_exis']['checked_x'] = FALSE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_s'] = FALSE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_n'] = TRUE;
				}else{
					$this->data['dic3_areas_silv_protegidas_exis']['checked_x'] = TRUE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_s'] = FALSE;
					$this->data['dic3_areas_silv_protegidas_exis']['checked_n'] = FALSE;
				}
				//*******************************************************
				$this->data['dic3_areas_silv_protegidas_sup'] = array(
					'type'     => 'text',
					'name'	   => 'dic3_areas_silv_protegidas_sup',
					'id'       => 'dic3_areas_silv_protegidas_sup',
					'value'    => $dic3_verificacion->areas_silv_protegidas['dic3_superficie'],
					'class'    => 'form-control',
				);
			}

			$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));

			// Breadcrumbs 
			$this->breadcrumbs->unshift(2, 'Dictamen B', 'expedientes/expedientes');
	        $this->data['breadcrumb'] = $this->breadcrumbs->show();

			// Load Template 
            $this->template->admin_render('expedientes/dictamen_b', $this->data);
		}
	}
}