<?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="col-md-12">
                             <div class="box">
                                <div class="box-body">
                                  <div style="overflow-x: scroll;">
                                      <table id="tabla_in_temp" class="table table-striped table-hover">
                                          <thead>
                                            <tr>
											                          <th><?php echo lang('in_temp_dpto');?></th>
                                                <th><?php echo lang('in_temp_dpto_desc');?></th>
                                                <th><?php echo lang('in_temp_distrito');?></th>
                                                <th><?php echo lang('in_temp_dist_desc');?></th>
                                                <th><?php echo lang('in_temp_colonia');?></th>
                                                <th><?php echo lang('in_temp_col_desc');?></th>
                                                <th><?php echo lang('in_temp_mz_agr');?></th>
                                                <th><?php echo lang('in_temp_lote_agr');?></th>
                                                <th></th>
                                                <th></th>
                                                <th></th>
                                                <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('in_temp_dpto');?>" 
                                                value="<?php if (isset($_SESSION['arraywhere_in_temp']['dpto'])) 
                                                             {  
                                                                echo $_SESSION['arraywhere_in_temp']['dpto'];
                                                             }else{
                                                                echo '';
                                                             } ?>"
                                                enable autofocus></th>

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

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

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

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

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

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

                                                <th><input id="lote_agr" name="lote_agr" type="text" class="form-control" 
                                                placeholder="<?php echo lang('in_temp_lote_agr');?>" 
                                                value="<?php if (isset($_SESSION['arraywhere_in_temp']['lote_agr'])) 
                                                             {  
                                                                echo $_SESSION['arraywhere_in_temp']['lote_agr'];
                                                             }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>
                                                <th></th>
                                                <th></th>
                                            <?php echo form_close();?>
                                            </tr>
                                          </thead>
                                          <tbody>
<?php foreach ($in_temp as $values):?>
                                            <tr>
                                                <td><?php echo htmlspecialchars($values->dpto, ENT_QUOTES, 'UTF-8'); ?></td>

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

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

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

                                                <td><?php echo htmlspecialchars($values->mz_agr, ENT_QUOTES, 'UTF-8'); ?></td>												
                                                
                                                <td><?php echo htmlspecialchars($values->lote_agr, ENT_QUOTES, 'UTF-8'); ?></td>																			
                                                
                                                <td>
                                                   <?php echo anchor('man_espacial/in_temp/in_temp/edit/'.$values->gid, lang('actions_edit'), array('title' => 'Editar datos')); 
                                                   ?>
                                                </td>                                              
                                                
                                                <td>                                                
                                                   <?php 
                                                    echo anchor('man_espacial/in_temp/in_temp/verparcela/'.$values->objectid, '<i class="glyphicon glyphicon-eye-open btn btn-xs bg-blue color-palette"></i>', array('title' => 'Ver parcela')); 
                                                    ?>
                                                </td>                                                                                               
                                                
                                                <td>
                                                   <?php 
                                                    if (0 == $values->total_hojas) 
                                                      {  
                                                        echo anchor('man_espacial/in_temp/in_temp/generar_planoindividualA4/'.$values->objectid.'/'.$values->dpto.'/'.$values->distrito.'/'.$values->colonia.'/'.$values->mz_agr.'/'.$values->lote_agr.'/'.$values->par_escala.'/1'
                                                        , '<i class="fa fa-map btn btn-sm bg-green color-palette">&nbsp&nbsp0</i>', array('target' => '_blank','title' => 'Plano Página 0'));
                                                      } 

                                                    if (1 <= $values->total_hojas) 
                                                      {  
                                                        echo anchor('man_espacial/in_temp/in_temp/generar_planoindividualA4/'.$values->objectid.'/'.$values->dpto.'/'.$values->distrito.'/'.$values->colonia.'/'.$values->mz_agr.'/'.$values->lote_agr.'/'.$values->par_escala.'/1'
                                                        , '<i class="btn btn-sm bg-green color-palette">&nbspPlano&nbsp&nbspPag. 1</i>', array('target' => '_blank','title' => 'Plano Página 1'));
                                                      } 

                                                    if (2 <= $values->total_hojas) 
                                                      { 
                                                        echo anchor('man_espacial/in_temp/in_temp/generar_planoindividualA4/'.$values->objectid.'/'.$values->dpto.'/'.$values->distrito.'/'.$values->colonia.'/'.$values->mz_agr.'/'.$values->lote_agr.'/'.$values->par_escala.'/2'
                                                        , '<i class="btn btn-sm bg-green color-palette">&nbspPlano&nbsp&nbspPag. 2</i>', array('target' => '_blank','title' => 'Plano Página 2'));
                                                      } 

                                                    if (3 <= $values->total_hojas) 
                                                      {  
                                                        echo anchor('man_espacial/in_temp/in_temp/generar_planoindividualA4/'.$values->objectid.'/'.$values->dpto.'/'.$values->distrito.'/'.$values->colonia.'/'.$values->mz_agr.'/'.$values->lote_agr.'/'.$values->par_escala.'/3'
                                                        , '<i class="btn btn-sm bg-green color-palette">&nbspPlano&nbsp&nbspPag. 3</i>', array('target' => '_blank','title' => 'Plano Página 3'));
                                                      } 

                                                    if (4 <= $values->total_hojas) 
                                                      {  
                                                        echo anchor('man_espacial/in_temp/in_temp/generar_planoindividualA4/'.$values->objectid.'/'.$values->dpto.'/'.$values->distrito.'/'.$values->colonia.'/'.$values->mz_agr.'/'.$values->lote_agr.'/'.$values->par_escala.'/4'
                                                        , '<i class="btn btn-sm bg-green color-palette">&nbspPlano&nbsp&nbspPag. 4</i>', array('target' => '_blank','title' => 'Plano Página 4'));
                                                      } 
                                                                                                     
                                                    ?>
                                                </td>
                                                
                                                <td>
                                                    <a title="Informe Deslinde" href="<?php echo $_SESSION['url_i3geo']?>/i3geo/ferramentas/imprimir/imprimir_A4_informe_deslinde.php?mapfile=C:/ms4w/Apache/htdocs/i3geo/aplicmap/imprimir_A4_plano_individual.map&interface=googlemaps&objectid=<?php echo $values->objectid?>&dpto=<?php echo $values->dpto?>&distrito=<?php echo $values->distrito?>&colonia=<?php echo $values->colonia?>&mz_agr=<?php echo $values->mz_agr?>&lote_agr=<?php echo $values->lote_agr?>&usr=<?php echo $_SESSION['user_id'] ?>" target="_blank">
                                                        <i class="btn btn-info btn-sm">Deslinde</i>
                                                    </a>
                                                </td>
                                            </tr>
<?php endforeach;?>
                                          </tbody>
                                    </table>
                                  </div>  

                                  <div class="modal fade" id="myModal">
                                        <div class="modal-dialog">
                                            <div class="modal-content">

                                                <div class="modal-body">
                                          
                                          <div class="close-button">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                          </div>
                                          <div class="embed-responsive embed-responsive-16by9">
                                                                <iframe class="embed-responsive-item" frameborder="0"></iframe>
                                          </div>
                                                </div>

                                            </div>
                                        </div>
                                  </div> 
                                  <?php echo $pagination ?>
                                </div>
                            </div>
                         </div>
                    </div>
                </section>
            </div>
