<?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="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li  class="active" ><a  data-toggle="tab" href="<?php echo site_url('cuest/reg01/vista_reg01'); ?>" aria-expanded="true" style="background-color:#F0F0F0">Mantenimiento</a></li>
                    <!--<li class=""><a href="<?php echo site_url('expedientes/dictamen_a/index/'.$expe_info[0]['expe_id']);?>" aria-expanded="false">Dictamen A</a></li>-->
                    <!--<li class=""><a href="<?php echo site_url('expedientes/dictamen_b/index/'.$expe_info[0]['expe_id']);?>" aria-expanded="false">Dictamen B</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 Expediente -->
                            <div class="col-md-4">
                                <div class="box box-primary">
                                    <div class="box-header with-border ">
                                        <h3 class="box-title">Información Proyecto</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_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 $expe_grf):?>
                                                    <tr>
                                                        <th><?php echo 'USO 1986'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['uso86'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr> 
                                                    <tr>
                                                        <th><?php echo 'USO ACTUAL'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['uso_actual'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>                                              
                                                    <tr>
                                                        <th><?php echo 'USO ALTERNATIVO'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['uso_alternativo'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <th><?php echo 'CAPACIDAD'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['capacidad'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <th><?php echo 'TAXONOMIA'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['taxonomia'],      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 $expe_grf):?>
                                                    <tr>
                                                        <th><?php echo 'BLOQUES'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['bloques'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>                                                   
                                                    <tr>
                                                        <th><?php echo 'ALDEAS'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['aldeas'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <th><?php echo 'FINCAS'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['fincas'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <th><?php echo 'PARCELAS'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['parcelas'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <th><?php echo 'LOTES'; ?></th>
                                                        <td><?php echo htmlspecialchars($expe_grf['lotes'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    </tr>                                                    
                                                <?php endforeach;?>
                                                </tbody>
                                            </table>
                                        </div>

                                        <hr>
                                        
                                        <!-- Sección botones -->
                                        <div class="form-group">
                                            <div class="col-sm-12" align="center">
                                                
                                                <?php echo anchor('man_espacial/parcelas/parcelas/vercolonias_ol/'.$colonia['gid'], lang('actions_see')); ?>
                                                <?php echo '&nbsp;';?>
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/download_colmen/'.$colonia['gid'], 'Descargar', array('class' => ' btn btn-warning btn-flat')); ?>
                                                <?php echo '&nbsp;';?>           
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/generar_lotes/'.$colonia['gid'], 'Gen.Lotes', array('class' => ' btn btn-secondary btn-flat')); ?>        
                                                <?php echo '&nbsp;';?>           
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/actualizar_categorias/'.$colonia['gid'], 'Act.Categorias', array('class' => ' btn btn-secondary btn-flat')); ?>    
                                                <?php echo '&nbsp;';?>            
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/actualizar_usos/'.$colonia['gid'], 'Act.U.Alter.', array('class' => ' btn btn-secondary btn-flat')); ?>        
                                                <?php echo '&nbsp;';?>            
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/actualizar_usos2/'.$colonia['gid'], 'Act.U.Actual', array('class' => ' btn btn-secondary btn-flat')); ?>  
                                                <?php echo '&nbsp;';?>            
                                                <?php echo anchor('man_espacial/colonias/Mantenimiento/actualizar_usos3/'.$colonia['gid'], 'Act.U.86', array('class' => ' btn btn-secondary btn-flat')); ?>                                                  
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <div class="col-sm-12" align="center">


                                                <?php echo form_open_multipart('man_espacial/colonias/Mantenimiento/importar_shapes_colmen', 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);?>                                                 

                                                <input id="shapes[]" name="shapes[]" type="file" class="file-loading" webkitdirectory directory>

                                                <label class="control-label" for="id_epsg">EPSG:</label>
                                                <?php $attribute = 'class="form-control selectpicker" required ="required" title="EPSG" id="id_epsg" required="required"';
                                                    echo form_dropdown('id_epsg', $t_epsg, $t_epsg_sel, $attribute); ?>                                                

                                                <div class="col-md-3" align="left">
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar USO 1986', 'id' => 'boton','value' => '10'));?>                                   
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar  USO ACTUAL', 'id' => 'boton','value' => '11'));?>                  
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar USO ALTERNATIVO', 'id' => 'boton','value' => '12'));?> 
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar CAPACIDAD', 'id' => 'boton','value' => '15'));?>            
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar TAXONOMIA', 'id' => 'boton','value' => '16'));?>                                                
                                                </div>

                                                <div class="col-md-3" align="left">
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar BLOQUES', 'id' => 'boton','value' => '18'));?>                                
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar ALDEAS', 'id' => 'boton','value' => '17'));?>                                         
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar FINCAS', 'id' => 'boton','value' => '13'));?>
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => ' Importar PARCELAS', 'id' => 'boton','value' => '14'));?>                               
                                                </div>

                                                <div class="col-md-3" align="left">
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar USO 1986', 'id' => 'boton','value' => '20'));?>               
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar  USO ACTUAL', 'id' => 'boton','value' => '21'));?>                  
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar USO ALTERNATIVO', 'id' => 'boton','value' => '22'));?> 
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar CAPACIDAD', 'id' => 'boton','value' => '25'));?>            
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar TAXONOMIA', 'id' => 'boton','value' => '26'));?>                                                
                                                </div>
                                                <div class="col-md-3" align="left">
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar BLOQUES', 'id' => 'boton','value' => '28'));?>                                          
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar ALDEAS', 'id' => 'boton','value' => '27'));?>                                       
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar FINCAS', 'id' => 'boton','value' => '23'));?>
                                                <?php echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-warning btn-flat', 'content' => ' Eliminar PARCELAS', 'id' => 'boton','value' => '24'));?>  
                                                </div>      
                                                <?php echo form_close(); ?>
                                                <!-- Fin sección botones -->
                                                                                                     
                                            </div>
                                        </div>  
                                    </div>
                                    <div class="box-header with-border ">
                                        <h3 class="box-title">Categorias Uso Actual</h3>
                                    </div>                                    
                                    <div class="box-body">
                                        <div style="overflow-x: scroll">
                                        <table id="tabla_index_usos" class="table table-striped table-hover">
                                            <thead>
                                                <tr class="filters">
                                                    <th></th>
                                                    <th><?php echo lang('usos_uso');           ?></th>
                                                    <th><?php echo lang('usos_categoria');           ?></th>
                                                    <th><?php echo lang('usos_cantidad');            ?></th>
                                                </tr>
                                            </thead>
                                            <tbody>                                    
                                                <?php foreach ($u_actual as $values):?>
                                                <tr id="tdcol" style="cursor:pointer;">
                                                    
                                                    <td class="boton usuario" nowrap="true"><?php //echo htmlspecialchars($_SESSION['user_id'],      ENT_QUOTES, 'UTF-8'); ?></td>                                                     
                                                    <td class="boton uso" nowrap="true"><?php echo htmlspecialchars($values['uso'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton nombre_uso" nowrap="true"><?php echo htmlspecialchars($values['categoria'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton cantidad" nowrap="true"><?php echo htmlspecialchars($values['cantidad'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td>
                                                        <!--?php   
                                                            echo anchor('man_espacial/colonias/colonias/edit/'.$values->gid, lang('actions_edit')); 
                                                        ?-->
                                                        <!--?php echo '&nbsp' ?-->
                                                        <?php 
                                                            echo anchor('man_espacial/colonias/colonias/ver/'.$values['uso'], lang('actions_see')); 
                                                        ?>                                          
                                                    </td>
                                                </tr>
                                                <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        </div>
                                        <?php
                                        //echo $pagination; 
                                        ?>
                                    </div>
                                    <div class="box-header with-border ">
                                        <h3 class="box-title">Categorias Uso Alternativo</h3>
                                    </div>                                    
                                    <div class="box-body">
                                        <div style="overflow-x: scroll">
                                        <table id="tabla_index_usos" class="table table-striped table-hover">
                                            <thead>
                                                <tr class="filters">
                                                    <th></th>
                                                    <th><?php echo lang('usos_uso');           ?></th>
                                                    <th><?php echo lang('usos_categoria');           ?></th>
                                                    <th><?php echo lang('usos_cantidad');            ?></th>
                                                </tr>
                                            </thead>
                                            <tbody>                                    
                                                <?php foreach ($u_alter as $values):?>
                                                <tr id="tdcol" style="cursor:pointer;">
                                                    
                                                    <td class="boton usuario" nowrap="true"><?php //echo htmlspecialchars($_SESSION['user_id'],      ENT_QUOTES, 'UTF-8'); ?></td>                                                     
                                                    <td class="boton uso" nowrap="true"><?php echo htmlspecialchars($values['uso'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton nombre_uso" nowrap="true"><?php echo htmlspecialchars($values['categoria'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton cantidad" nowrap="true"><?php echo htmlspecialchars($values['cantidad'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td>
                                                        <!--?php   
                                                            echo anchor('man_espacial/colonias/colonias/edit/'.$values->gid, lang('actions_edit')); 
                                                        ?-->
                                                        <!--?php echo '&nbsp' ?-->
                                                        <?php 
                                                            echo anchor('man_espacial/colonias/colonias/ver/'.$values['uso'], lang('actions_see')); 
                                                        ?>                                          
                                                    </td>
                                                </tr>
                                                <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        </div>
                                        <?php
                                        //echo $pagination; 
                                        ?>
                                    </div>                                    
                                    <div class="box-header with-border ">
                                        <h3 class="box-title">Categorias Uso 1986</h3>
                                    </div>                                    
                                    <div class="box-body">
                                        <div style="overflow-x: scroll">
                                        <table id="tabla_index_usos" class="table table-striped table-hover">
                                            <thead>
                                                <tr class="filters">
                                                    <th></th>
                                                    <th><?php echo lang('usos_uso');           ?></th>
                                                    <th><?php echo lang('usos_categorias');           ?></th>
                                                    <th><?php echo lang('usos_cantidad');            ?></th>
                                                </tr>
                                            </thead>
                                            <tbody>                                    
                                                <?php foreach ($u_1986 as $values):?>
                                                <tr id="tdcol" style="cursor:pointer;">
                                                    
                                                    <td class="boton usuario" nowrap="true"><?php //echo htmlspecialchars($_SESSION['user_id'],      ENT_QUOTES, 'UTF-8'); ?></td>                                                     
                                                    <td class="boton uso" nowrap="true"><?php echo htmlspecialchars($values['uso'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton nombre_uso" nowrap="true"><?php echo htmlspecialchars($values['categorias'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td class="boton cantidad" nowrap="true"><?php echo htmlspecialchars($values['cantidad'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                    <td>
                                                        <!--?php   
                                                            echo anchor('man_espacial/colonias/colonias/edit/'.$values->gid, lang('actions_edit')); 
                                                        ?-->
                                                        <!--?php echo '&nbsp' ?-->
                                                        <?php 
                                                            echo anchor('man_espacial/colonias/colonias/ver/'.$values['uso'], lang('actions_see')); 
                                                        ?>                                          
                                                    </td>
                                                </tr>
                                                <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        </div>
                                        <?php
                                        //echo $pagination; 
                                        ?>
                                    </div>






                                </div>
                            </div>
                            <!-- FIN Bloque Datos Graficos -->


                        </div><!-- /.box-body -->
                    </div><!-- /.tab-pane -->
                </div><!-- /.tab-content -->
            </div><!-- nav-tabs-custom --> 
        </div>
    </section>
</div>
