<?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 Expediente</h3>
                                                </div>
                                                <div class="box-body">
                                                    <table class="table table-striped table-hover">
                                                        <tbody>
                                                        <?php foreach ($expe_info as $expe):?>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_id_expediente'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_id_expediente'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_gestion'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_gestion'],            ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_c_tipodoc'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_c_tipodoc'],               ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_tipo_ref'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_tipo_ref_desc'],           ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_id_expediente_ref'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_id_expediente_ref'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_doc_proponente'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_doc_proponente'],     ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_tipo_proyecto'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_tipo_proyecto'],      ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_proyecto'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_proyecto'],           ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_consultor_nom'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_consultor_nom'],      ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_tecnico'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_tecnico'],      ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_fproceso_geo'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_fproceso_geo'],      ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_nota'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_nota'],      ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_estado'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_estado_desc'],             ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo lang('expedientes_expe_secuencia'); ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_secuencia'],          ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'Observaciones'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_observacion'],          ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>   
                                                            <tr>
                                                                <th><?php echo 'Licencia'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_licencia'],          ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>   
                                                            <tr>
                                                                <th><?php echo 'Resolución'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_resolucion'],          ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>   
                                                            <tr>
                                                                <th><?php echo 'Tipo Dictamen'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe['expe_tipo_dictamen'],          ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>                                                            
                                                        <?php endforeach;?>
                                                        </tbody>
                                                    </table>
                                                    <hr>
                                                    <div class="form-group">
                                                        <div <div class="col-md-offset-1 col-md-10" align="center">
                                                            <div class="btn-group">
                                                                <?php echo anchor('expedientes/expedientes/', '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 'SEAM_POLIGONO'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_POLIGONO'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_UACTUAL'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_UACTUAL'],            ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_UALTER'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_UALTER'],               ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_U86'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_U86'],           ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_U04'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_U04'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_TSUELO'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_TSUELO'],     ENT_QUOTES, 'UTF-8'); ?></
                                                            </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 'SEAM_FINCAS'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_FINCAS'],      ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_CAP_SUELO'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_CAP_SUELO'],            ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_CLA_ECO'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_CLA_ECO'],               ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_COMP_DEF'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_COMP_DEF'],           ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_DEF_BOS'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_DEF_BOS'],  ENT_QUOTES, 'UTF-8'); ?></td>
                                                            </tr>
                                                            <tr>
                                                                <th><?php echo 'SEAM_PROP_CERT'; ?></th>
                                                                <td><?php echo htmlspecialchars($expe_grf['SEAM_PROP_CERT'],     ENT_QUOTES, 'UTF-8'); ?></
                                                            </tr>
                                                        <?php endforeach;?>
                                                        </tbody>
                                                    </table>
                                                    </div>



                                                            <!-- Crear Formulario -->

                                                            <?php echo form_open_multipart('expedientes/mantenimiento/importar_shapes', array('class' => 'form-horizontal', 'id' => 'form-importar_shapes')); ?>
                                                            <input id="shapes[]" name="shapes[]" type="file" class="file-loading" webkitdirectory directory>
                                                            <?php echo form_input($expe_id_expediente);?>
                                                            <?php echo form_input($expe_gestion);?>
                                                            <?php echo form_input($expe_id);?>
                                                            <?php echo form_input($expe_estado);?>

                                                    <!-- Sección botones -->
                                                    <div class="form-group">
                                                        <div <div class="col-sm-12" align="center">
      

                                                            <?php 
                                                                if ($expe['expe_estado'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo anchor('expedientes/mantenimiento/eliminar_geometrias/'.$expe['expe_id_expediente'].'/'.$expe['expe_gestion'] .'/'.$expe['expe_id'] , 'Eliminar', array('class' => ' btn btn-warning btn-flat')); 

                                                                }
                                                            ?>
                                                            <?php echo '&nbsp;';?>
                                                            <?php  
                                                                if ($expe['expe_estado'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-success btn-flat', 'content' => ' Importar  EPSG(32721)', 'id' => 'boton','value' => '1'));
                                                                }
                                                            ?>

                                                            <?php echo '&nbsp;';?>
                                                            <?php 
                                                                if ($expe['expe_estado'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-success btn-flat', 'content' => ' Importar EPSG(32720)', 'id' => 'boton','value' => '2'));
                                                                }  
                                                            ?>
                                                            <?php echo '&nbsp;';?>                      
                                                            <?php 
                                                                if ($expe['expe_estado'] == 'A' OR grupo_usuario(18))  { 
                                                                    echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-success btn-flat', 'content' => ' Importar EPSG(4326)', 'id' => 'boton','value' => '3'));
                                                                }    
                                                            ?>
                                                            <?php echo '&nbsp;';?>                             
                                                            <a href="#" id='verparcela' onclick="existe_grafico_expe_id(<?php echo $expe_info[0]['expe_id'] ?>)">
                                                                <i title="Ver Parcela" class="btn btn-primary btn-flat  fa fa-map">&nbsp;VISOR</i>
                                                            </a>
                                                            <?php echo '&nbsp;';?> 
                                                            <?php if (grupo_usuario(18))  { 
                                                                 echo anchor('expedientes/mantenimiento/download_expe/'.$expe['expe_id_expediente'].'/'.$expe['expe_gestion'] .'/'.$expe['expe_id'] , 'Descargar Exp.', array('class' => ' btn btn-warning btn-flat')); 
                                                                 }
                                                            ?>                                              

                                                        </div>
                                                    </div>


                                                            <!-- Cierra Formulario -->
                                                            <?php echo form_close(); ?>


                                                            <!-- Crear Formulario -->

                                                            <?php echo form_open_multipart('expedientes/mantenimiento/actualizar_dictamen', array('class' => 'form-horizontal', 'id' => 'form-actualizar_dictamen')); ?>

                                                            <?php echo form_input($expe_id_expediente);?>
                                                            <?php echo form_input($expe_gestion);?>
                                                            <?php echo form_input($expe_id);?>
                                                            <?php echo form_input($expe_estado);?>



                                                        <div class="col-md-6">                         
                                                        <table class="table table-striped table-hover">

                                                                <tr>
                                                                    <th><label for="expe_tipo_dictamen">Tipo Dictamen</label></th>
                                                                    <td> <?php  
                                                                            $attribute = 'class="form-control selectpicker" data-live-search="true" title="Tipo Dictamen." id="expe_tipo_dictamen" ';
                                                                            echo form_dropdown('expe_tipo_dictamen', $expe_tipo_dictamen, $expe_tipo_dictamen_sel,$attribute); ?></td>
                                                                </tr> 
                                                                <tr>
                                                                    <th><label for="expe_id_imagen1">Imagen 1</label></th>
                                                                    <td> <?php  
                                                                            $attribute = 'class="form-control selectpicker" data-live-search="true" title="Imagen 1." id="expe_id_imagen1" ';
                                                                            echo form_dropdown('expe_id_imagen1', $expe_id_imagen1, $expe_id_imagen1_sel,$attribute); ?></td>
                                                                </tr>   
                                                        </table>
                                                        </div>


                                                        <div class="col-md-6">  
                                                        <table class="table table-striped table-hover">
                                                                <tr>
                                                                    <th><label for="expe_id_imagen2">Imagen 2</label></th>
                                                                    <td> <?php  
                                                                            $attribute = 'class="form-control selectpicker" data-live-search="true" title="Imagen 2." id="expe_id_imagen2" ';
                                                                            echo form_dropdown('expe_id_imagen2', $expe_id_imagen2, $expe_id_imagen2_sel,$attribute); ?></td>
                                                                </tr> 
                                                                <tr>
                                                                    <th><label for="expe_id_imagen3">Imagen 3</label></th>
                                                                    <td> <?php  
                                                                            $attribute = 'class="form-control selectpicker" data-live-search="true" title="Imagen 3." id="expe_id_imagen3" ';
                                                                            echo form_dropdown('expe_id_imagen3', $expe_id_imagen3, $expe_id_imagen3_sel, $attribute); ?></td>
                                                                </tr> 
                                                        </table>           
                                                        </div>


                                                        <div class="col-md-12">  
                                                        <table class="table table-striped table-hover">
                                                                <tr>
                                                                    <th><label for="expe_dictamen">Texto Dictamen</label></th>
                                                                </tr>                                                             
                                                                <tr>
                                                                    <td> <?php echo form_textarea($expe_dictamen);?>
                                                                    </td>
                                                                </tr> 
                                                        </table>           
                                                        </div>


                                                        <!-- Sección botones -->
                                                        <div class="form-group">
                                                            <div <div class="col-sm-12" align="center">
          
                                                                          <?php  
                                                                    //if ($expe['expe_estado'] == 'P')  { 
                                                                        echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-success btn-flat', 'content' => ' Guardar Datos', 'id' => 'boton','value' => '1'));
                                                                    //}
                                                                ?>

                                                                <?php echo '&nbsp;';?>
                                                                <?php echo '&nbsp;';?>

                                                                <?php echo anchor('expedientes/mantenimiento/expe_mantenimiento/'.$expe['expe_id'], 'CANCELAR', array('class' => 'btn btn-default btn-flat', 'content' => 'CANCELAR')); ?>                                                                

                                                                <?php echo '&nbsp;';?>
                                                                <?php echo '&nbsp;';?>

                             
                                                                <?php if (grupo_usuario(18))  { 
                                                                     echo anchor('expedientes/mantenimiento/imprimirdictamen/'.$expe['expe_id'].'/'.$expe['expe_tipo_dictamen'] , 'Imp. Dictamen', array('class' => ' btn btn-warning btn-flat')); 
                                                                     }
                                                                ?> 
                                                            </div>
                                                        </div>


                                                            <!-- Cierra Formulario -->
                                                            <?php echo form_close(); ?>



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

                                                            <div class="panel panel-danger" >
                                                                <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>USO_ACTUAL</td>
                                                                                <td>mayúscula | sin acento</td>
                                                                                <td>area_m2 y uso</td>
                                                                                <td>minúscula | sin acento</td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>USO_ALTERNATIVO</td>
                                                                                <td>mayúscula | sin acento</td>
                                                                                <td>area_m2 y uso</td>
                                                                                <td>minúscula | sin acento</td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>POLIGONO_PROYECTO</td>
                                                                                <td>mayúscula | sin acento</td>
                                                                                <td>area_m2</td>
                                                                                <td>minúscula | sin acento</td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                 
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <!-- Fin sección botones -->
                                                </div>
                                            </div>
                                        </div>
                                        <!-- FIN Bloque Datos Graficos -->
                                    </div><!-- /.box-body -->
                                </div><!-- /.tab-pane -->
                            </div><!-- /.tab-content -->
                        </div><!-- nav-tabs-custom --> 
                    </div>
                </section>
            </div>
