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

?>

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

 

.luz_naranja {
    background: #ffb94d !important ;   /*ffcd7f*/
}
</style>

 <!--script type="text/javascript" src="<?php //echo 'C:/xampp/htdocs/intranet2/js/funciones.js'    ?>">
     
 </script-->


<div class="content-wrapper">
    <section class="content-header">
        <?php echo $pagetitle; ?>
        <?php echo $breadcrumb; ?>
    </section>

    <section class="content">  
        <div class="row">
            <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li  class="active" ><a  data-toggle="tab" href="<?php echo site_url('man_espacial/colonias/mantenimiento'); ?>" aria-expanded="true" style="background-color:#F0F0F0">Mantenimiento</a></li>
                </ul>
                <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 Información Colonia -->
                            <div class="col-md-4">
                                <div class="box box-primary">
                                    <div class="box-header with-border ">
                                        <h3 class="box-title">Información de la Colonia</h3>
                                    </div>
                                    <div class="box-body">
                                        <table class="table table-striped table-hover">
                                            <tbody>
<!-- foreeach -->                               <?php foreach ($col_info as $colonia):?>
                                                <tr>
                                                    <th><?php echo lang('colonias_dpto_cod'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['departamento'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_dist_cod'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['distrito'],            ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_col_cod'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['col_cod'],               ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_col_desc'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['col_desc'],               ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>        
                                                <tr>
                                                    <th><?php echo lang('colonias_col_codgeo'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['col_codgeo'],           ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_resolucion_hab'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['resolucion_hab'],     ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_fecha_hab'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['fecha_hab'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_antecedentes'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['antecedentes'],           ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_fecha_inscripcion'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['fecha_inscripcion'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_fecha_pericia'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['fecha_pericia'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_fecha_deslinde'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['fecha_deslinde'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_dist_matriz'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['distrito_matriz'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_formato_lado'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['formato_lado'],             ENT_QUOTES, 'UTF-8'); ?></
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_formato_hrumbo'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['formato_hrumbo'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                                <tr>
                                                    <th><?php echo lang('colonias_colonia_titulada'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['colonia_titulada'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>   
                                                <tr>
                                                    <th><?php echo lang('colonias_formato_decimal_rumbo'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['formato_decimal_rumbo'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>   
                                                <tr>
                                                    <th><?php echo lang('colonias_formato_decimal_distancia'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['formato_decimal_distancia'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>   
                                                <tr>
                                                    <th><?php echo lang('colonias_formato_decimal_coordenada'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['formato_decimal_coordenada'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>              
                                                <tr>
                                                    <th><?php echo lang('colonias_estado_colonia'); ?></th>
                                                    <td><?php echo htmlspecialchars($colonia['estado_colonia'],          ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>              
<!-- endforeeach -->                            <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        <hr>
                                        <div class="form-group">
                                            <div class="col-md-offset-1 col-md-10" align="center">
                                                <div class="btn-group">
                                                    <?php echo anchor('man_espacial/colonias/colonias', 'ATRAS', array('class' => 'btn btn-default btn-flat')); ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                             </div>
                            <!-- FIN Bloque Información Expediente -->
                            <!-- Bloque Datos Graficos -->
                            <div class="col-md-8">
                                <div class="box box-success">
                                    <div class="box-header with-border">
                                        <h3 class="box-title">Mantenimiento - Datos Gráficos</h3>
                                    </div>
                                    <?php if (isset($message)): ?>
                                        <pre>
                                            <?php echo $message;?>  
                                        </pre>    
                                    <?php endif ?>
                                    <div class="box-body">
                                        <div class="col-md-6">
                                            <table class="table table-striped table-hover">
                                                <tbody>                                                   
                                                <?php foreach ($datos_graficos as $colonia_grf):?>
                                                    <tr>
                                                        <th><?php echo 'LOTES'; ?></th>
                                                        <td><?php echo htmlspecialchars($colonia_grf['SIRT_PARCELAS'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                <?php endforeach;?>
                                                <?php foreach ($datos_graficos as $colonia_grf):?>
                                                    <tr>
                                                        <th><?php echo 'VIVIENDAS'; ?></th>
                                                        <td><?php echo htmlspecialchars($colonia_grf['SIRT_PARCELAS'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                <?php endforeach;?>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div class="col-md-6">
                                        <table class="table table-striped table-hover">
                                            <tbody>
                                            <?php foreach ($datos_graficos as $colonia_grf):?>
                                                <tr>
                                                    <th><?php echo 'HIDRICOS'; ?></th>
                                                    <td><?php echo htmlspecialchars($colonia_grf['SIRT_PARCELAS'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                            <?php endforeach;?>
                                            <?php foreach ($datos_graficos as $colonia_grf):?>
                                                <tr>
                                                    <th><?php echo ''; ?></th>
                                                    <td><?php echo htmlspecialchars('',      ENT_QUOTES, 'UTF-8'); ?></td>
                                                </tr>
                                            <?php endforeach;?>                                                        
                                            </tbody>
                                        </table>
                                        </div>
                                        <!-- Crear Formulario -->
                                        <?php echo form_open_multipart('man_espacial/colonias/Mantenimiento/importar_shapes', array('class' => 'form-horizontal', 'id' => 'form-importar_shapes')); ?>
                                        <?php echo form_input($dpto_cod);?>
                                        <?php echo form_input($dist_cod);?>
                                        <?php echo form_input($col_cod);?>
                                        <?php echo form_input($col_desc);?>
                                        <?php echo form_input($gid);?>
                                        <?php echo form_input($estado);?>
                                        <!-- Sección botones 1 -->
                                        <div class="form-group">
                                            <div class="col-sm-12" align="center">

                                                <input id="shapes[]" name="shapes[]" type="file" class="file-loading" webkitdirectory directory>
                                                           
                                            </div>
                                        </div>
                                        <div class="box-body col-sm-8"> 
                                            <div id="avance">                               
                                            </div> 
                                        </div>    
                                        <div class="box-body col-sm-8">
                                            <table id="tabla" class="table table-striped table-hover">
                                                <thead class="acciones_cabecera">
                                                    <tr>
                                                        <th>Parcelas Temporales</th>
                                                        <th>Pericia</th>
                                                        <th>Mapas</th>
                                                        <th>Control y Parcelas Procesadas</th>
                                                        <th>Adm. Sistemas</th>
                                                    </tr>

                                                </thead>
                                                <tbody class="acciones_cuerpo">  
                                                    <tr>
                                                        <td class='col-sm-2'>
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/eliminar_geometrias/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Eliminar', array('class' => ' fa btn btn-xs bg-red color-palette')); 
                                                                //}
                                                            ?>
                                                            <?php echo '&nbsp;';?>    
                                                            <?php  
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => ' fa btn btn-xs bg-green color-palette', 'content' => ' Importar  EPSG(32721)', 'id' => 'boton','value' => '1'));            
                                                                //}
                                                            ?>                                       
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/gen_exp_polilineas/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'] .'/'.$colonia['gid'], 'Polilineas', array('class' => ' fa btn btn-xs bg-blue color-palette'));
                                                                //}
                                                            ?>
                                                            <?php echo '&nbsp;';?> 
                                                            <?php 
                                                                //if (grupo_usuario(18))  { 
                                                                 echo anchor('man_espacial/colonias/mantenimiento/download_lotescol/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'] .'/'.$colonia['gid'] , 'Descargar Colonia.', array('class' => ' fa btn btn-xs bg-orange color-palette')); 
                                                                //}
                                                            ?> 
                                                            <!--/td-->
                                                        </td>
                                                        <td class='col-sm-2'>
                                                            <a onclick="generar_pericia_man()">
                                                            <i class="fa btn btn-xs bg-red color-palette">Generar Pericias</i></a> 
                                                            <br>
                                                            <a onclick="eliminar_pericia_1a1_man()">
                                                            <i class="fa btn btn-xs bg-orange color-palette">Eliminar Pericias</i>
                                                            <br>
                                                            <a onclick="validar_informe_pericial_dgrp_man()">
                                                            <i class="fa btn btn-xs bg-aqua color-palette">Imprimir Percias PDF (DGRP)</i>
                                                            <a onclick="validar_informe_folio_real_man()">
                                                            <i class="fa btn btn-xs bg-purple color-palette">Imprimir Folio Real PDF (DGRP)</i>
                                                            <a onclick="validar_informe_folio_real_word_man()">
                                                            <i class="fa btn btn-xs bg-purple color-palette">Imprimir Folio Real WORD (DGRP)</i> </a>
                                                            <!--/td-->
                                                        </td>
                                                        <td class='col-sm-2'>
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $url_mapserver . '/i3geo/ferramentas/imprimir/imprimir_A3_Mapear_4_colores.php?mapfile=C:/ms4w/Apache/htdocs/i3geo/aplicmap/imprimir_A3_Mapear_4_colores.map&interface=googlemaps&dpto=' . $colonia['dpto_cod'] . '&distrito=' . $colonia['dist_cod'] . '&colonia=' . $colonia['col_cod']; 
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-aqua color-palette'>A3: 4 Colores</i>
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $url_mapserver . '/i3geo/ferramentas/imprimir/imprimir_A3_Mapear_5_colores.php?mapfile=C:/ms4w/Apache/htdocs/i3geo/aplicmap/imprimir_A3_Mapear_5_colores.map&interface=googlemaps&dpto=' . $colonia['dpto_cod'] . '&distrito=' . $colonia['dist_cod'] . '&colonia=' . $colonia['col_cod']; 
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-aqua color-palette'>A3: 5 Colores</i>
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $url_mapserver . '/i3geo/ferramentas/imprimir/imprimir_A0_mapa_catastral.php?mapfile=C:/ms4w/Apache/htdocs/i3geo/aplicmap/imprimir_A0_mapa_catastral.map&interface=googlemaps&dpto=' . $colonia['dpto_cod'] . '&distrito=' . $colonia['dist_cod'] . '&colonia=' . $colonia['col_cod']; 
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-aqua color-palette'>A0: Mapa Catastral</i>
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $_SESSION['url_mapserver'] . '/i3geo/ferramentas/imprimir/meg_a3_mapa_tematico01.php?mapfile=c:/ms4w/Apache/htdocs/i3geo/aplicmap/meg_a3_mapa_tematico01.map&interface=googlemaps&objectid=' . $colonia['gid'].'&usr='.$_SESSION['user_id'] ;
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-red color-palette'>A3: Tematico Satelital Sentinel</i> 
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $_SESSION['url_mapserver'] . '/i3geo/ferramentas/imprimir/jrl_a3_mapa_tematico03.php?mapfile=c:/ms4w/Apache/htdocs/i3geo/aplicmap/jrl_a3_mapa_tematico03.map&interface=googlemaps&objectid=' . $colonia['gid'].'&usr='.$_SESSION['user_id'] ;
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-white color-palette'>A3: Tematico Geoserver:Landsat8</i> 
                                                            <a href=<?php 
                                                                        //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                            echo $_SESSION['url_mapserver'] . '/i3geo/ferramentas/imprimir/gcb_a3_mapa_tematico02.php?mapfile=c:/ms4w/Apache/htdocs/i3geo/aplicmap/gcb_a3_mapa_tematico02.map&interface=googlemaps&objectid=' . $colonia['gid'].'&usr='.$_SESSION['user_id'] ;
                                                                        //}
                                                                    ?>  >
                                                            <i class='fa btn btn-xs bg-blue color-palette'>A3: Tematico </i>                          
                                                        </td>
                                                        <td class='col-sm-2'>
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/validar_pericias/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Validar Pericia', array('class' => ' fa btn btn-xs bg-red color-palette')); 
                                                                //}
                                                            ?>
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/confirmar_pericias/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Confirmar Pericia', array('class' => ' fa btn btn-xs bg-green color-palette')); 
                                                                //}
                                                            ?>                                                            
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/habilitar_pericias/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Habilitar Pericia', array('class' => ' fa btn btn-xs bg-aqua color-palette')); 
                                                                //}
                                                            ?>   
                                                                     
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/eliminar_periciaconfirmada/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Desconfirmar Pericia', array('class' => ' fa btn btn-xs bg-orange color-palette')); 
                                                                //}
                                                            ?>    
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/eliminar_in_parc/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Eliminar Validadas', array('class' => ' fa btn btn-xs bg-red color-palette')); 
                                                                //}
                                                            ?>    
                                                        </td>
                                                        <td class='col-sm-2'>
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/actualizar_geocolonia/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Actualizar Geocolonia', array('class' => ' fa btn btn-xs bg-green color-palette')); 
                                                                //}
                                                            ?>                                        
                                                            <?php 
                                                                //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('man_espacial/colonias/mantenimiento/actualizar_geometria/'.$colonia['gid'].'/'.$colonia['dpto_cod'].'/'.$colonia['dist_cod'] .'/'.$colonia['col_cod'], 'Actualizar geometria', array('class' => ' fa btn btn-xs bg-aqua color-palette')); 
                                                                //}
                                                            ?> 
                                                        </td>
                                                    </tr>                                   
                                                </tbody>
                                            </table>
                                        </div>
                                        <table id="tabla" class="table table-striped table-hover">
                                        <thead class="acciones_cabecera">
                                            <tr>
                                                <!--th>Dpto.</th-->
                                                <!--th>Distrito</th-->
                                                <!--th>Colonia</th-->
                                                <!--th>Descripción</th-->
                                                <th>Parcelas Temporales</th>
                                                <th>Pericia</th>
                                                <th>Mapas</th>
                                                <th>Control y Parcelas Procesadas</th>
                                                <th>Adm. Sistemas</th>
                                            </tr>
                                        <!-- Sección Acciones -->
                                        <div class="form-group">
                                            <div class="col-sm-12" align="center">
                                                <?php 
                                                    //if ($colonia['estado_colonia'] == 'A' OR grupo_usuario(18))  { 

                                                        echo anchor('man_espacial/colonias/colonias', 'ATRAS', array('class' => 'btn btn-default btn-flat')); 
                                                    //}
                                                ?> 
                                            </div>
                                        </div> <!-- FIN form-gorup-->
                                        <!-- FIN ACCIONES-->
                                                <!-- Cierra Formulario -->
                                                <?php echo form_close(); ?>  
                                        <!--div class="col-md-12"-->
                                        <!-- Sección botones 3 -->
                                        <div class="form-group">
                                            <div class="col-sm-12" align="center">
                                                <!--div class="panel panel-danger"-->
                                                <div >
                                                    <div class="panel-heading">Requisitos mínimos para importación de shape</div>
                                                    <div class="panel-body">
                                                        <table id="tabla" class="table table-striped    table-hover">
                                                            <thead style="font-size: 12px">
                                                                <tr>
                                                                    <th>NOMBRE ARCHIVO</th>
                                                                    <th>FORMATO NOMBRE</th>
                                                                    <th>CAMPOS MINIMOS</th>
                                                                    <th>FORMATO CAMPO</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody style="font-size: 12px">
                                                                <tr>
                                                                    <td>LOTES</td>
                                                                    <td>mayúscula | sin acento</td>
                                                                    <td>Campos del Template</td>
                                                                    <td>minúscula | sin acento</td>
                                                                </tr>
                                                                <tr>
                                                                    <td>HIDRICO</td>
                                                                    <td>mayúscula | sin acento</td>
                                                                    <td>tipo</td>
                                                                    <td>minúscula | sin acento</td>
                                                                </tr>
                                                                <tr>
                                                                    <td>VIVIENDAS</td>
                                                                    <td>mayúscula | sin acento</td>
                                                                    <td>tipo, encuesta</td>
                                                                    <td>minúscula | sin acento</td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </div> <!-- FIN form-gorup-->
                                        <!-- FIN sección botones -->
                                        <!--/div-->
                                    </div> <!-- FIN box-body --> 
                                </div>
                            </div>
                            <!-- FIN Bloque Datos Graficos -->
                        </div><!-- /.box-body -->
                    </div><!-- /.tab-pane -->
                </div><!-- /.tab-content -->
            </div><!-- nav-tabs-custom --> 
        </div>
    </section>
</div>
