<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php $this->load->view('template/head.php'); ?>
<?php $this->load->view('template/header_admin.php'); ?>
<section>
    <div id="container">
        <h3 class="text-center"><?= $titulo ?></h3>
    </div>
    <a href="<?php echo base_url('paises') ?>" class="btn btn-info">Regresar a lista de paises</a>
    <div class="row contenedor-form">
        <?php
         $form_data         = ['name'       => 'crear_pais_form',
           'id'         => 'crear-pais-form',
           'class'      => 'create-form',
           'novalidate' => '',
         ];
         $attributes_labels = ['class' => 'control-label'];
        ?>
        <?php echo form_open(base_url('paises/create'), $form_data); ?>
        <?php if (isset($pais)): ?>
             <?= form_hidden('edit', 1) ?>
             <?= form_hidden('COD_PAIS', $pais->COD_PAIS) ?>
         <?php endif; ?>
        <div class="col-lg-4 col-md-4" style="margin:0 auto;float:none;">
            <div class="form-group input-type"> 
                <?php echo form_label('Código del País', 'COD_PAIS', $attributes_labels); ?>
                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-key"></i>
                    </div>
                    <?=
                     form_input(['name'     => 'COD_PAIS', 'type'     => 'number',
                       'id'       => 'COD_PAIS', 'class'    => 'form-control',
                       'required' => '', 'value'    => (isset($pais->TEX_NOMPAIS)) ? $pais->COD_PAIS : ''])
                    ?>   
                </div>
            </div> 
            <div class="form-group input-type"> 
                <?php echo form_label('Nombre del País', 'TEX_NOMPAIS', $attributes_labels); ?>
                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-map-marker"></i>
                    </div>
                    <?=
                     form_input(['name'     => 'TEX_NOMPAIS',
                       'id'       => 'TEX_NOMPAIS', 'class'    => 'form-control uppercase',
                       'required' => '', 'onkeyup'  => 'uppercase(this.id);',
                       'value'    => (isset($pais->TEX_NOMPAIS)) ? $pais->TEX_NOMPAIS : ''])
                    ?>   
                </div>
            </div> 
            <div class="boton-submit">
                <div class="input-group">
                    <a href="<?php echo base_url($route) ?>" class="btn btn-danger" style="margin-right: 10px;">Regresar</a>
                    <input type="submit" value="Guardar" class="btn btn-default">
                </div>
            </div>

        </div>
    </div>
    <?php echo form_close(); ?>
</section>
<?php
 $data_view['loajs'] = $load_js;
 $this->load->view('template/footer.php', $data_view);
?>