<?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/municipios/create', 
	                                    '<i class="fa fa-plus"></i> '. lang('municipios_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('municipios_id');        ?></th>
                                              <th><?php echo lang('municipios_c_ut');       ?></th>
                                              <th><?php echo lang('municipios_departamen'); ?></th>
                                              <th><?php echo lang('municipios_provincia');  ?></th>
                                              <th><?php echo lang('municipios_municipio');  ?></th>
                                              <th><?php echo lang('municipios_capital');    ?></th>
                                              <th></th>
                                            </tr>
                                            <tr class="filters">
                                                    <?php echo form_open('ficha_catastral/municipios', array('class' => 'form-horizontal', 'id' => 'form-seach_municipios')); ?>
                                                    
                                                    <th><input id="gid" name="gid" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('municipios_id');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_municipios']['gid'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_municipios']['gid'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>

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

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

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

                                                    <th><input id="municipio" name="municipio" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('municipios_municipio');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_municipios']['municipio'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_municipios']['municipio'];
                                                                       }else{
                                                                        echo '';
                                                                       } ?>"
                                                                enable autofocus>
                                                    </th>
                                                    
                                                    <th><input id="capital" name="capital" type="text" class="form-control" 
                                                                placeholder="<?php echo lang('municipios_capital');?>" 
                                                                value="<?php if (isset($_SESSION['arraywhere_municipios']['capital'])) 
                                                                       {  
                                                                        echo $_SESSION['arraywhere_municipios']['capital'];
                                                                       }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 ($municipios as $values):?>
                                            <tr>
                                                <td><?php echo htmlspecialchars($values->gid, ENT_QUOTES, 'UTF-8'); ?></td>       

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

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

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

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

                                                <td><?php echo htmlspecialchars($values->capital, ENT_QUOTES, 'UTF-8'); ?></td>
                                                                                                                                                                      
                                                <td>
                                         	<?php 
                                                    echo anchor('ficha_catastral/municipios/vermunicipios_ol/'.$values->gid, lang('actions_see')); 
						     // echo '&nbsp'  
                                                    //echo anchor('ficha_catastral/municipios/ver/'.$values->gid, lang('actions_see')); 
                                                     // echo '&nbsp'  
                                                    //echo anchor('ficha_catastral/municipios/mantenimiento/'.$values->gid, '<i class="btn btn-xs bg-green color-palette">Mant.</i>'); 
                                                     //echo '&nbsp'                                                        
                                                    echo anchor('ficha_catastral/municipios/edit/'.$values->gid, lang('actions_edit')); 
                                                     //echo '&nbsp' 
                                                    echo anchor('ficha_catastral/municipios/delete/'.$values->gid, lang('actions_delete')); 
                                                     //echo '&nbsp'                                                      
                                                    //echo anchor('ficha_catastral/municipios/generarplanoU/'.$values->gid, ' U'); 
                                                    // echo '&nbsp'  
                                           	?>              
                                   
                                                </td>   
                                            </tr>
<?php endforeach;?>
                                        </tbody>
                                    </table>
                                    <?php
                                        echo $pagination;
                                        
                                    ?>
                                </div>
                            </div>
                         </div>
                      </div>
                    </div>
                </section>
            </div>