<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<style>
    body {background: #ffffff !important;}
    .footer {top: 205% !important;}
</style>
<?php $this->load->view('template/head.php'); ?>
<?php
 $this->load->view('template/header_admin.php');

?>
<section class="row contenedor-titulo">
   <h3 class="titulo"><?= $this->session->userdata('EMPRESA')?></h3> 
    <h3 class="titulo"><?= $titulo ?></h3> 
</section>


<?php 

foreach ($instancias as $key => $instancia) { ?>
    <section class="row contenedor">
    <legend>
    <div class="col-lg-12 col-md-12">
    <h4><?= $instancia['nombre_instancia'] ?></h4>
    </div>
    <div class="col-lg-10 col-md-10">
        <table id="todas_instancias_participantes" class="table table-bordered compact">
            <thead>
                <tr>
                    <th>Cédula</th>
                    <th>Participante</th>
                </tr>
            </thead>
            <tbody>
            <?php 
            $total_votos = 0;
            foreach ($instancia['instancia_datos'] as $key => $instancia_datos) {
                ?>
            <tr>
                    <td><?= $instancia_datos['cedula'] ?></td>
                    <td><?= $instancia_datos['participante'] ?></td>
                </tr>
                <?php }?>
            </tbody>
            <tfoot>
                <tr>
                <th>Total</th>
                <th><?= count($instancia['instancia_datos']) ?></th>

                </tr>  
            </tfoot>
        </table>
    </div> 
    </legend>   
</section>
<?php } ?>


<section class="row">
    <h3 class="text-center"><?= $titulo_graficos ?></h3>
    <div id="chartColumn"></div>
</section>
<section class="row" style="margin-top: 440px;">
    <div id="chartBarra"></div>
</section>
<section class="row" style="margin-top: 440px;">
    <div id="chartTorta"></div>
</section>

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