<?php $this->load->view('template/head.php'); ?>
<?php
 $data_view['logo'] = $logo;
 shuffle($images);
 $this->load->view('header_acceso.php', $data_view);
 $claves_aleatorias = array_rand($images, 1);
?>
<style>
    body {background:url('<?php echo base_url($images[$claves_aleatorias]) ?>') !important;}
    .footer-texto {color: #ffffff !important; font-size: 14px !important; 
                   text-shadow:1px 1px rgba(0,0,0,0.4);}
    .footer-texto a, .footer-texto a:hover { color: #FC873A;text-shadow:none}
    .parsley-errors-list li {color: #F00; font-size: 15px; margin-top: 3px;line-height: 15px;}
    response {display:none;}
</style>
<div class="container">
    <div class="row login-row">
        <div class="messages" style="">
            <?php if (isset($message)): ?>
                 <?php if (isset($message['success'])): ?>
                     <div class="success"><?= $message['success'] ?></div>
                 <?php endif; ?>
                 <?php if (isset($message['error'])): ?>
                     <div class="error"><?= $message['error'] ?></div>
                 <?php endif; ?>
             <?php endif; ?>
        </div>
        <div class="col-lg-6 col-md-6 login-container">
            <h3><?= $titulo ?></h3>
            <?php
             $form_data         = array(
               'name'  => 'login_form',
               'id'    => 'login-form',
               'class' => 'login-form'
               // 'data-parsley-validate'=>""
             );
            ?>
            <?php echo form_open('acceso/login', $form_data); ?>
            <?php
             //Definiciones
             $attributes_labels = array(
               'class' => 'control-label',
             );
            ?>
            <?php
             //Identificación, contraseña y PIN.
             if ($tipo_acceso === 'CP'):
                 ?>
                 <?= form_hidden('TIPO_ACCESO', $tipo_acceso) ?> 
                 <?= form_hidden('NUM_IDETER', $identificacion) ?> 
                 <?= form_hidden('NUM_TELCEL', $celular) ?> 
                 <div class="form-group input-type">
                     <?= form_label('Digite el PIN', 'NUM_PINGEN', $attributes_labels); ?>
                     <div class="input-group">
                         <div class="input-group-addon">
                             <i class="fa fa-phone"></i>
                         </div>
                         <?=
                         form_input(['name'                    => 'NUM_PINGEN', 'id'                      => 'NUM_PINGEN', 'class'                   => 'form-control',
                           'data-parsley-type'       => 'number', 'data-parsley-minlength ' => '[4]',
                           'data-parsley-maxlength ' => '[6]', 'required'                => ''])
                         ?>
                     </div>
                 </div>
             <?php endif; ?>
            <div class="input-group submit-forms">
                <?= form_submit('submit', 'Validar', "class='btn btn-default btn-login'"); ?>
            </div>
            <?= form_close(); ?>
        </div>
    </div
    <?php $this->load->view('template/footer') ?>
