<?php
 defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $permisos = $this->session->userdata('permisos'); ?>
<?php $this->load->view('template/head.php'); ?>
<style>
    [type=checkbox] {
        position: absolute;
    }
</style>
<script>

    function disableBack() {
        window.history.forward()
    }
    window.onload = disableBack();
    window.onpageshow = function (evt) {
        if (evt.persisted)
            disableBack();
    }
</script> 
<?php
 $this->load->view('template/header_admin.php');
?>
<section class="row contenedor-titulo votacion-titulo">
    <h3 class="text-center"><?= $instancia->TEX_NOMINS ?></h3>
</section>
<section id="tarjeton">
    <?php
     $contador = 0;
     if ($numero_candidatos_grid == 3 or $numero_candidatos_grid == 4) {
         $size_grid = 'candid-34';
     }
     if ($numero_candidatos_grid == 5) {
         $size_grid = 'candid-5';
     }
     if ($numero_candidatos_grid == 6) {
         $size_grid = 'candid-6';
     }
     if ($numero_candidatos_grid == 7 or $numero_candidatos_grid == 8) {
         $size_grid = 'candid-78';
     }
    ?>
    <div class="candidatos-contenedor" style="margin:0 auto; float: none; text-align: center; max-width: 100%">
        <?php foreach ($candidatos as $candidato): $contador++; ?>

             <?php
             if ($contador % $numero_candidatos_grid == 1):
                 echo '<br>';
             endif;
             ?>
             <!--        <div class="row tarjeton">-->
             <div class="candidato-grid" style="display: inline-block" >
                 <label class="voto-area">
                     <div id="foto-candidato" class="candidatos-contenedor" data-toggle="tooltip" data-placement="bottom" title="<?= $candidato->TEX_PERCAN ?>">
                         <div class="profile-header-container">
                             <div class="profile-header-img">
                                 <?= img($candidato->TEX_FOTO, '', ['class' => "img-responsive img-circle $size_grid"]) ?>
                                 <!-- badge -->
                                 <div class="rank-label-container">
                                     <span class="label label-default rank-label2 nom"><?= $candidato->TEX_NOMCAN ?></span>
                                     <span class="label label-default rank-label2 ape"><?= $candidato->TEX_APECAN ?></span>
                                 </div>
                             </div>
                         </div> 
                     </div>
                 </label>
             </div>
             <!--        </div>-->
         <?php endforeach; ?>
        <?php if ($instancia->BOL_VOTBLA && isset($voto_blanco)): ?>
             <div class="candidato-grid" style="display: inline-block">
                 <label class="voto-area">
                     <div id="foto-candidato-b" class="candidatos-contenedor">
                         <div class="profile-header-container">
                             <div class="profile-header-img">
                                 <?= img($voto_blanco->TEX_FOTO, '', ['class' => "img-responsive img-circle $size_grid"]) ?>
                                 <!-- badge -->
                                 <div class="rank-label-container">
                                     <span class="label label-default rank-label2">Voto en Blanco</span>
                                 </div>
                             </div>
                         </div> 
                     </div>
                 </label>
             </div>
         </div>
     <?php endif; ?>
</section>
<?php
 $data_view['loajs'] = '';
 $this->load->view('template/footer.php', $data_view);
?>
