<?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(
	                                    'ficha_catastral/lotes/lotes/create', 
	                                    '<i class="fa fa-plus"></i> '. lang('lotes_create'), 
	                                    array('class' => 'btn btn-block btn-primary btn-flat')
	                                );?>
	                            </h3>                                                        
                                </div>
                             
                                    <div class="box-body" style="overflow-x: scroll">
                                    <table id="tabla" class="table table-striped table-hover">
                                        <thead>
                                            <tr>
                                              <th><?php echo lang('lotes_gid');         ?></th>
                                              <th><?php echo lang('lotes_lote');       ?></th>
                                              <th><?php echo lang('lotes_nombres_propietarios');       ?></th>
                                              <th><?php echo lang('lotes_cod_manz');     ?></th>
                                              <th><?php echo lang('lotes_cod_dist'); ?></th>
                                              <th><?php echo lang('lotes_cod_ru');   ?></th>
                                              <th><?php echo lang('lotes_cod_muni');    ?></th>
                                              <th><?php echo lang('lotes_cod_cat');      ?></th>
                                              <th><?php echo lang('lotes_cod_zonaho');     ?></th>
                                              <th><?php echo lang('lotes_sup_lev');        ?></th>
                                              <th><?php echo anchor('ficha_catastral/lotes/lotes/reset_busqueda/', '<i title="Limpiar busqueda" class="glyphicon glyphicon-refresh btn btn-primary"></i>'); ?></th>
                                            </tr>
                                            <tr class="filters">
                                                    <?php echo form_open('ficha_catastral/lotes/lotes/', array('class' => 'form-horizontal', 'id' => 'form-seach_lotes')); ?>
                                                    
                                                    <th><input id="gid" name="gid" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_gid');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['gid'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['gid'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>

                                                    <th><input id="lote" name="lote" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_lote');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['lote'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['lote'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>
                                                    
                                                    
                                                    <th><input id="nombres_propietarios" name="nombres_propietarios" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_nombres_propietarios');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['nombres_propietarios'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['nombres_propietarios'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>

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

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

                                                    <th><input id="radiourb" name="radiourb" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_cod_ru');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['cod_ru'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['cod_ru'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>
                                                    
                                                    <th><input id="municipio" name="municipio" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_cod_muni');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['cod_muni'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['cod_muni'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>

                                                    <th><input id="cod_cat" name="cod_cat" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_cod_cat');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['cod_cat'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['cod_cat'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>
                                                    
                                                    <th><input id="zonaho" name="zonaho" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_cod_zonaho');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['cod_zonaho'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['cod_zonaho'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>                                                   
                                                    <th><input id="sup_m2" name="sup_m2" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('lotes_sup_lev');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_lotes']['sup_lev'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_lotes']['sup_lev'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>      
                                                                                                        
                                                    <th>
                                                    <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-primary btn-flat glyphicon glyphicon-search', 'id' => 'boton')); ?>
                                                    <?php echo form_close();?>
                                                    </th>
                                                    <th></th>
                                            </tr>
                                        </thead>
                                        <tbody>                                    
				<?php foreach ($lotes as $values):?>
                                            <tr>
                                                <td><?php echo htmlspecialchars($values->gid, ENT_QUOTES, 'UTF-8'); ?></td>       

                                                <td><?php echo htmlspecialchars($values->lote, ENT_QUOTES, 'UTF-8'); ?></td>

                                                <td><?php echo htmlspecialchars($values->nombres_propietarios, ENT_QUOTES, 'UTF-8'); ?></td>

                                                <td><?php echo htmlspecialchars($values->cod_manz, ENT_QUOTES, 'UTF-8'); ?></td>

                                                <td><?php echo htmlspecialchars($values->cod_dist, ENT_QUOTES, 'UTF-8'); ?></td>

                                                <td><?php echo htmlspecialchars($values->cod_ru, ENT_QUOTES, 'UTF-8'); ?></td>

                                                <td><?php echo htmlspecialchars($values->cod_muni, ENT_QUOTES, 'UTF-8'); ?></td>
                                                
                                                <td><?php echo htmlspecialchars($values->cod_cat, ENT_QUOTES, 'UTF-8'); ?></td>
                                                       
                                                <td><?php echo htmlspecialchars($values->cod_zonaho, ENT_QUOTES, 'UTF-8'); ?></td>
                                                
                                                <td><?php echo htmlspecialchars($values->sup_lev, ENT_QUOTES, 'UTF-8'); ?></td> 
                                                                                               
                                                <td>
                                         	<?php 
                                                    echo anchor('ficha_catastral/lotes/lotes/verlotes_ol/'.$values->gid, lang('actions_see')); 
						     // echo '&nbsp'  
                                                    //echo anchor('ficha_catastral/lotes/lotes/ver/'.$values->gid, lang('actions_see')); 
                                                     // echo '&nbsp'  
                                                    //echo anchor('ficha_catastral/lotes/lotes/mantenimiento/'.$values->gid, '<i class="btn btn-xs bg-green color-palette">Mant.</i>'); 
                                                     //echo '&nbsp'                                                        
                                                    echo anchor('ficha_catastral/lotes/lotes/edit/'.$values->gid, lang('actions_edit')); 
                                                     //echo '&nbsp' 
                                                    echo anchor('ficha_catastral/lotes/lotes/delete/'.$values->gid, lang('actions_delete')); 
                                                    echo anchor('ficha_catastral/lotes/ident_geo/lotes_ident_geo/'.$values->gid.'/E', '<i class="btn btn-xs bg-green color-palette">Ficha</i>')
                                                    //'<i class="btn btn-xs bg-orange color-palette">Mant.</i>'
                                                    
                                                     //echo '&nbsp'                                                      
                                                    //echo anchor('ficha_catastral/lotes/generarplanoU/'.$values->gid, ' U'); 
                                                    // echo '&nbsp'  
                                           	?>              
                                   
                                                </td>   
                                            </tr>
                <?php endforeach;?>
                                        </tbody>
                                    </table>
                                    <?php
                                        echo $pagination;
                                        
                                    ?>
                                </div>
                            </div>
                         </div>
                      </div>
                    </div>
                </section>
            </div>