<?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="filterable">
                <div class="col-md-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h3 class="box-title">
                                
                                <?php echo anchor(
                                    'man_espacial/fincas/fincas/create', 
                                    '<i class="fa fa-plus"></i> '. lang('fincas_create'), 
                                    array('class' => 'btn btn-block btn-primary btn-flat')
                                );?>
                            </h3>
                            <h4><?php echo $message;?></h4>
                        </div>
                        <div class="box-body">
                            <div style="overflow-x: scroll">
                            <table id="tabla" class="table table-striped table-hover">
                                <thead>
                                    <tr class="filters">
                                        <th><?php echo lang('fincas_dpto');           ?></th>
                                        <th><?php echo lang('fincas_distrito');           ?></th>
                                        <th><?php echo lang('fincas_colonia');            ?></th>
                                        <th><?php echo lang('fincas_finca');           ?></th>
                                        <th><?php echo lang('fincas_padron');         ?></th>
                                        <th><?php echo lang('fincas_sup_legal');             ?></th>
                                        <th><?php echo lang('fincas_sup_gis');          ?></th>
                                        <th><?php echo lang('fincas_observacion');       ?></th>
                                        <th><?php echo lang('fincas_antecedente');          ?></th>
                                        <th><?php echo lang('fincas_fecha_inscrip');          ?></th>
                                        <!-- 
                                        Reemplazar Acciones por una imagen para tener mejor diseño
                                        --> 
                                        <th></th>
                                    </tr>
                                    <tr>
                                    <?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'form-create_geocolonia')); ?>
                                        <th><input id="dpto" name="dpto" type="text" class="form-control" maxlength="2"
                                        placeholder="<?php echo lang('fincas_dpto');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['dpto'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['dpto'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable autofocus></th>

                                        <th><input id="distrito" name="distrito" type="text" class="form-control" maxlength="2"
                                        placeholder="<?php echo lang('colonias_dist_cod');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['distrito'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['distrito'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="colonia" name="colonia" type="text" class="form-control" maxlength="3"
                                        placeholder="<?php echo lang('colonias_col_cod');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['colonia'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['colonia'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="finca" name="finca" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_desc');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['finca'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['finca'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="padron" name="padron" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['padron'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['padron'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="sup_legal" name="sup_legal" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['sup_legal'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['sup_legal'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="sup_gis" name="sup_gis" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['sup_gis'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['sup_gis'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="observacion" name="observacion" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['observacion'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['observacion'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="antecedente" name="antecedente" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['antecedente'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['antecedente'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>

                                        <th><input id="fecha_inscrip" name="fecha_inscrip" type="text" class="form-control" 
                                        placeholder="<?php echo lang('colonias_col_codgeo');?>" 
                                        value="<?php if (isset($_SESSION['arraywhere_fincas']['fecha_inscrip'])) 
                                                     {  
                                                        echo $_SESSION['arraywhere_fincas']['fecha_inscrip'];
                                                     }else{
                                                        echo '';
                                                     } ?>"
                                        enable></th>


                                        <th><?php echo form_button(array('type' => 'submit', 'class' => 'glyphicon glyphicon-search btn btn-primary btn-flat', '' => '', 'id' => 'boton'));
                                                 ?></th>

                                        <th></th>
                                    <?php echo form_close();?>
                                    </tr>
                                </thead>
                                <tbody>                                    
                                    <?php foreach ($fincas as $values):?>
                                    <tr id="tdcol" >
                                        <td class="boton dpto" nowrap="true"><?php echo htmlspecialchars($values->dpto,      ENT_QUOTES, 'UTF-8'); ?></td>                            
                                        <td class="boton distrito" nowrap="true"><?php echo htmlspecialchars($values->distrito,  ENT_QUOTES, 'UTF-8'); ?></td>                            
                                        <td class="boton colonia" nowrap="true"><?php echo htmlspecialchars($values->colonia,    ENT_QUOTES, 'UTF-8'); ?></td>                     
                                        
                                        <td class="boton col_desc" nowrap="true"><?php echo htmlspecialchars($values->finca,  ENT_QUOTES, 'UTF-8'); ?></td>
                                        <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->padron,         ENT_QUOTES, 'UTF-8'); ?></td>
                                        <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->sup_legal,     ENT_QUOTES, 'UTF-8'); ?></td>

                                        <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->sup_gis,          ENT_QUOTES, 'UTF-8'); ?></td>
                                        <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->observacion,       ENT_QUOTES, 'UTF-8'); ?></td>
                                        <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->antecedente,  ENT_QUOTES, 'UTF-8'); ?></td>

                                         <td class="boton" nowrap="true"><?php echo htmlspecialchars($values->fecha_inscrip,  ENT_QUOTES, 'UTF-8'); ?></td>

                                        <td>
                                            <?php echo anchor('man_espacial/fincas/fincas/edit/'.$values->gid, lang('actions_edit')); ?>
                                            <?php echo '&nbsp' ?>
                                            <?php echo anchor('man_espacial/fincas/fincas/ver/'.$values->gid, lang('actions_see')); ?>
                                            
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                            </div>
                            <?php
                            echo $pagination; 
                        ?>
                        </div>
                        
                        <div class="box-body col-sm-8">
                            <table id="tabla" class="table table-striped table-hover">
                                <thead class="acciones_cabecera">
                                    
                                </thead>
                                <tbody class="acciones_cuerpo">                                    
                                    
                                </tbody>
                            </table>
                        </div>
                        <div class="box-body col-sm-8"> 
                            <div id="resultado">                                
                            </div> 
                        </div>                            
                        <div class="box-body col-sm-8"> 
                            <div id="avance">                               
                            </div> 
                        </div>                            
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
            
            
