MINI MINI MANI MO

Path : /var/www/html/sistemas/spid/resources/views/sistemaVotos/
File Upload :
Current File : /var/www/html/sistemas/spid/resources/views/sistemaVotos/sistemaPlenoV.blade.php

<style>
    html, body {
        height: 100%;
        overflow: hidden;
    }
    td, th {
        padding: 3px 3px !important;
    }
     #loadingBack {
         display:none;
         position: fixed;
         left: 0;
         top: 0;
         width: 100%;
         height: 100%;
         background-color:#88898c90;
         z-index: 1;
         text-align: center;
         padding-top: 300px;
         padding-left: 22px;
     }

    #centrado {
        text-align: center !important;

    }

    #jutificado {
        text-align: justify !important;
    }

    .grid-container {
        display: grid;
    }

    .grid-container--fill {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .grid-container--fill--a {
        grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    }

    .grid-container--fill--buton {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }

    .grid-container--fit {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .grid-container--fill--imagen {
        grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
        align-content: center !important;

    }

    .grid-element-buton {
        /*color: #fff;*/
        /*border: 1px solid #fff;*/
        padding: 5px;
    }

    .grid-element-imagen {
        padding: 0px;
    }

    .grid-element {
        /*background-color: #DDDDDD;*/

        /*border: 1px solid #fff;*/

    }


    #row {
        margin: auto;
    }

    .btn-favor {
        background-color: #257025!important;
        color: white;
        font-weight: 800;
    }

    .btn-contra {
        background-color: #BB163F!important;
        color: white;
        font-weight: 800;
    }

    .btn-abs {
        background-color: #E8D231!important;
        color: white;
        font-weight: 800;
    }

    .btn-sr {
        background-color: #DDDDDD!important;
        color: black;
        font-weight: 800;
    }

    body {
        /*font-family: Arial, Helvetica, sans-serif  !important;*/
    /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
        font-size: 2rem!important;
        font-family: "Roboto", sans-serif!important;
        font-weight: 900!important;
        font-style:normal!important;
    }
    #textovoto{
    /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
        font-size: 2rem!important;
        font-family: "Roboto", sans-serif!important;
        font-weight: 900!important;
        font-style:normal!important;
        text-align: center;
    }

    #tituloVoto{
        font-size: 2rem!important;
        font-family: "Roboto", sans-serif!important;
        font-weight: 900!important;
        font-style:normal!important;
        text-align: justify-all;
    }

    @media screen and (max-width: 768px) and (min-width: 320px) {
        .grid-container--fill--buton {
            grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        }
        body {
            /*font-family: Arial, Helvetica, sans-serif  !important;*/
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 2rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
        }
        .grid-container--fill {
            grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        }
        #tituloVoto{
            font-size: 1.5rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: justify-all;
        }
        #textovoto{
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 1.3rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: center;
        }
    }
    @media screen and (max-width: 768px) and (min-width: 320px) and (orientation: portrait) {
        .grid-container--fill--buton {
            grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        }
        body {
            /*font-family: Arial, Helvetica, sans-serif  !important;*/
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 2rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
        }
        .grid-container--fill {
            grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        }
        #tituloVoto{
            font-size: 1rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: justify-all;
        }
        #textovoto{
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 1.3rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: center;
        }
    }
    @media screen and (max-width: 1024px) and (min-width: 768px) and (orientation: landscape) {
        .grid-container--fill--buton {
            grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        }
        body {
            /*font-family: Arial, Helvetica, sans-serif  !important;*/
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 2rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
        }
        .grid-container--fill {
            grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        }
        #tituloVoto{
            font-size: 2rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: justify-all;
        }
        #textovoto{
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 1.7rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: center;
        }
    }
    @media screen and (min-width: 1366px) and (max-width: 1920px) {
        .grid-container--fill--buton {
            grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
        }
        .grid-container--fill {
            grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        }

        body {
            /*font-family: Arial, Helvetica, sans-serif  !important;*/
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 2rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
        }
        #textovoto{
        /* @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); */
            font-size: 1.5rem!important;
            font-family: "Roboto", sans-serif!important;
            font-weight: 900!important;
            font-style:normal!important;
            text-align: center;
        }
    }
    .container
    {
        padding: 0rem !important;
    }
    .card
    {
        margin: 0rem 0 0rem 0 !important;
    }
    .card
    {
        margin: .0rem 0 0rem 0 !important;
    }
    .section
    {
        padding: .0rem 0 !important;
    }
    .section
    {
        padding-top: 0rem !important;
        padding-bottom: 0rem !important;
    }
    span{
        position:relative;
    }
    span::before{
        position:absolute;
        content: '';
        height:1rem;
        width:100%;
        /*background-color:yellow !important;*/
        z-index:-1;
    }
    html, body {
        height: 100%;
        margin: 0;
    }
    .full-height {
        min-height: 100vh;
    }

    #nada {
        background-color: white;
        min-height: 100vh;
        width: 100%;
    }

    .card-content.modo-blanco {
        background-color: white !important;
    }
/*proyectaC*/
    .main {
        /*max-height: calc(100vh - 220px);*/
        /*overflow: hidden;*/
        width: 100%;
        color: #000000 !important;
        column-count:3;
        column-rule: 1px solid #bbb;
        column-width: auto;
        margin: 1px   1px   1px   1px !important;
    @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
        font-size:  10px!important;
        font-family: "Roboto", sans-serif!important;
        font-weight: 700!important;
        font-style:normal!important;
    }
    td, th {
        padding: 1px 1px !important;
        font-size: 27px!important;
        text-align: left;
    }
</style>
<meta name="csrf-token" content="{{ csrf_token() }}">
@extends('layoutPr')
@section('title')
    SPID
@endsection
{{--@section('content')--}}
    <div class="container" style="background-color: black!important;">
        <div class="section" style="background-color: black!important;">
            <div class="card" style="background-color: black!important;">
                <div class="card-content full-height" style="background-color: #0b0b0b;">
                    <div class="container">
                        <div id="votos"  style="display: none;">
                            <div id ="totalesVotos" class="row" >
                                <span style="color: white;font-size: 30px; line-height: 1; text-stroke: 1px red!important; font-weight: bold;" id="temaVoto">Voto: </span><br><br>
                                <center>
                                    <table style=" table-layout: fixed; width: 100%; align-items: left;">
                                        <tr>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="consenso1">
                                                <span style="color: #4CAF50; font-size: 32px; line-height: 1;" >FAVOR: {{$favor}} </span>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="disenso1">
                                                <span style="color: #DC3545; font-size: 32px; line-height: 1;" >CONTRA: {{$contra}}</span>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="abstencion1">
                                                <span style="color: #e9af00;font-size: 32px; line-height: 1; text-stroke: 1px red!important;" >ABSTENCIÓN: {{$abstencion}} </span>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="totalv1">
                                                <span style="font-size: 32px; line-height: 1;" >TOTAL: {{$totalVotos}} </span>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:18px; word-wrap: break-word; font-weight: bold; text-align: center; padding: 0px 0px!important;">
                                                <div style="text-align: center !important; padding-top: 0px!important;" >
                                                    <h3><span style="color: black; font-size: 20px !important; line-height: 1;" id="countdown"></span></h3>
                                                    <input type='hidden' name='tiempo' id='tiempo' value=' @if(count($temaVotos)){{$temaVotos[0]->tiempoVotacion}}@endif'>
                                                </div>
                                            </td>
                                        </tr>

                                        <tr id="barraVotos" >
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 10px 10px!important;">
                                                <button type="button" class="btn btn-favor" onclick="favor();">Favor</button>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;">
                                                <button type="button" class="btn btn-contra"  onclick="contra();">Contra</button>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;">
                                                <button type="button" class="btn btn-abs" onclick="abstencion();">Abst.</button>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;">
                                                <button type="button" class="btn btn-sr" onclick="sinRegistro();">S/R</button>
                                            </td>
                                            <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;"></td>
                                        </tr>
                                    </table>
                                </center><br>
                            </div>
                            <div class="main">
                                <table width='100%' border="0" id="tablaEstatusvotos">
                                    @foreach($votacion as $voto)
                                        <tr>
                                            @if($voto->mensaje == 'FAVOR')
                                                <?php $style = "background-color:#4CAF50;"; ?>
                                            @elseif($voto->mensaje == 'CONTRA')
                                                <?php $style = "background-color:#DC3545;"; ?>
                                            @elseif($voto->mensaje == 'ABSTENCION')
                                                <?php $style = "background-color:#e9af00;"; ?>
                                            @elseif($voto->mensaje == 'SIN REGISTRO')
                                                <?php $style = "background-color:#DDDDDD;"; ?>
                                            @endif
                                            <td style="display: flex; align-items: center;">
                                                <span style="display: inline-block; width: 18px; height: 18px; background-color: {{ $style }}; border-radius: 50%; margin-right: 5px;"></span>
                                                <span style="color: {{ $style }}; font-size: 24px;">
                                                {{ mb_strtoupper($voto->parlamentario->nombre) }} {{ mb_strtoupper($voto->parlamentario->ap_pat) }} {{ mb_strtoupper($voto->parlamentario->ap_mat) }}
                                            </span>
                                            </td>
                                        </tr>
                                    @endforeach
                                </table>
                            </div>
                        </div>
                        <div id="aistencia" style="display: none;">
                            <div class="row">
                                <table id="tablatvotos" style=" table-layout: fixed; width: 100%; align-items: left;">
                                    <tr>
                                        <td style="background-color: #DDDDDD; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;">
                                            <span style="color: darkred; text-stroke: 1px red!important;" >
                                                <h3>
                                                    <span style="color: black; font-size: 20px !important;text-align: center !important; padding-top: 1px; line-height: 1;" id="countdownA"></span>
                                                    <input type='hidden' name='tiempoA' id='tiempoA' value=' @if(count($asistencias)){{$asistencias[0]->tiempoVotacion}}@endif'>
                                                </h3>
                                            </span>
                                        </td>
                                        <td style="background-color: #DDDDDD; color: white; width:18px; word-wrap: break-word; font-weight: bold; text-align: center;padding: 0px 0px!important;" id="totalAsistencias23">
                                            <span style="color: black; font-size: 20px; font-weight: bold; text-align: center; line-height: 1;" >TOTAL ASISTENCIAS:   {{$totalAsistencias}}</span>
                                        </td>
                                    </tr>
                                    <tr id="barraAsistencia">
                                        <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 10px 10px!important;"></td>
                                        <td style="background-color: #dddddd; color: white; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 10px 10px!important;">
                                            <a onclick="asistencia();" class='btn' style="background-color: #4CAF50; text-align: left"><strong>ASISTENCIA </strong></a>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <br><br>
                            <div class="row">
                                <div class="main">
                                    <table width='100%' border="0" id="tablaAsistencia23">
                                        @foreach($asistencias as $asistencia)
                                            <tr>
                                                @if($asistencia->mensaje == 'ASISTENCIA')
                                                    <?php $style = "background-color:#4CAF50;"; ?>
                                                @elseif($asistencia->mensaje == 'PENDIENTE')
                                                    <?php $style = "background-color:#DDDDDD;"; ?>
                                                @endif
                                                <td style="display: flex; align-items: center;">
                                                    <span style="display: inline-block; width: 18px; height: 18px; background-color: {{ $style }}; border-radius: 50%; margin-right: 5px;"></span>
                                                    <span style="color: {{ $style }}; font-size: 24px;">
                                                        {{ mb_strtoupper($asistencia->parlamentario->nombre) }} {{ mb_strtoupper($asistencia->parlamentario->ap_pat) }} {{ mb_strtoupper($asistencia->parlamentario->ap_mat) }}
                                                    </span>
                                                </td>
                                            </tr>
                                        @endforeach
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div id="nada" style="display: none;">
                            <div class="row">
                                <div class="height-30vh">
                                    <center>
                                        <img src="{{asset('spid/images/logo/congreso_blanco.png')}}"
                                             alt="Imagen ajustada"
                                             style="width:370px; height:auto;">
                                    </center><br><br>
                                </div>
                            </div>
                            <div>
                                <div class="grid-container grid-container--fill--imagen">
                                    <div class="grid-element-imagen" id="centrado">
                                        <a href="{{route('getActasPleno')}}">
                                            <img src="{{asset('spid/images/logo/acta_2.png')}}"
                                                 srcset="{{asset('spid/images/logo/CACTA.png')}} 480w, {{asset('spid/images/logo/acta_2.png')}} 768w, {{asset('spid/images/logo/acta_2.png')}} 1024w"
                                                 sizes="(max-width: 480px) 100vw, (max-width: 768px) 80vw, 80vw"
                                                 alt="Imagen ajustada">
                                        </a>
                                    </div>
                                    <div class="grid-element-imagen" id="centrado">
                                        <a href="{{route('getAsuntosPleno')}}">
                                            <img src="{{asset('spid/images/logo/asuntos_orden_2.png')}}"
                                                 srcset="{{asset('spid/images/logo/CASUNTOS.png')}} 480w, {{asset('spid/images/logo/asuntos_orden_2.png')}} 768w, {{asset('spid/images/logo/asuntos_orden_2.png')}} 1024w"
                                                 sizes="(max-width: 480px) 100vw, (max-width: 768px) 80vw, 80vw"
                                                 alt="Imagen ajustada">
                                        </a>
                                    </div>
                                    <div class="grid-element-imagen" id="centrado">
                                        <a href="{{route('getOrdenPleno')}}">
                                            <img src="{{asset('spid/images/logo/orden_2.png')}}"
                                                 srcset="{{asset('spid/images/logo/CORDEN.png')}} 480w, {{asset('spid/images/logo/orden_2.png')}} 768w, {{asset('spid/images/logo/orden_2.png')}} 1024w"
                                                 sizes="(max-width: 480px) 100vw, (max-width: 768px) 80vw, 80vw"
                                                 alt="Imagen ajustada">
                                        </a>
                                    </div>
                                    <div class="grid-element-imagen" id="centrado">
                                        <a href="{{route('getMarco')}}">
                                            <img src="{{asset('spid/images/logo/marco_2.png')}}"
                                                 srcset="{{asset('spid/images/logo/CMARCO.png')}} 480w, {{asset('spid/images/logo/marco_2.png')}} 768w, {{asset('spid/images/logo/marco_2.png')}} 1024w"
                                                 sizes="(max-width: 480px) 100vw, (max-width: 768px) 80vw, 80vw"
                                                 alt="Imagen ajustada">
                                        </a>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col s10" ></div>
                                <div class="col s2">
                                    <img src="{{asset('spid/images/logo/spid.png')}}"
                                         srcset="{{asset('spid/images/logo/spid.png')}} 480w, {{asset('spid/images/logo/spid.png')}} 768w, {{asset('spid/images/logo/spid.png')}} 1024w"
                                         sizes="(max-width: 480px) 50vw, (max-width: 768px) 50vw, 50vw"
                                         alt="Imagen ajustada">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col s12">
                                <center>
                                    <select class ="form-control browser-default" id="readersDropDown" name="readersDropDown" style="display: none;">
                                    </select><br>
                                    <div id="imagediv" style="width: 330px;height: 330px;overflow: hidden;border: 1px solid rgba(51, 122, 183, 0.39); display: none;"></div>
                                    <div id="content-capture" style="display : none;"></div>
                                    <input type="hidden" id="tipoBoton" name="tipoBoton">
                                </center>
                            </div>
                        </div>
                        <div id="loadingBack">
                            <p><img src="{{asset('spid/images/logo/logo_62.png')}}" /></p>
                            <div class="preloader-wrapper big active">
                                <div class="spinner-layer spinner-red-only">
                                    <div class="circle-clipper left">
                                        <div class="circle"></div>
                                    </div><div class="gap-patch">
                                        <div class="circle"></div>
                                    </div><div class="circle-clipper right">
                                        <div class="circle"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{{--@endsection--}}
@push('scripts')
    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

    <script src="{{'spid/js/scripts/fingerprint.sdk.min.js'}}"></script>
    <script src="{{'spid/js/scripts/es6-shim.js'}}"></script>
    <script src="{{'spid/js/scripts/websdk.client.bundle.min.js'}}"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script type="text/javascript">
        var _second = 1000;
        var _minute = _second * 60;
        var _hour = _minute * 60;
        var _day = _hour * 24;
        var timer;



        $(document).ready(function() {

            // sessionStorage.setItem('vista', 'curul');
            function validaEventos() {
                var vista = sessionStorage.getItem('vista');
                console.log('vista '+vista)
                $.ajax({
                    type: 'GET',
                    data: {},
                    url: "{{ url('validaEventosPleno') }}",
                    success: function (response) {
                        console.log('tiempo de response: '+response)
                        var json = $.parseJSON(response);
                        if (json[0].evento == '0') {
                            document.getElementById("nada").style = "display: block";
                            document.getElementById("votos").style = "display: none";
                            document.getElementById("aistencia").style = "display: none";
                            document.querySelector(".card-content").classList.add("modo-blanco");
                        } else {
                            if (json[0].asistencias == '0' && json[0].votacion == '0') {
                                document.getElementById("votos").style = "display: none";
                                document.getElementById("aistencia").style = "display: none";
                                document.getElementById("nada").style = "display: block";

                                document.querySelector(".card-content").classList.add("modo-blanco");
                                if (vista!= null && vista != 'curul'){
                                    // window.location.href = window.location.origin + '/'+vista;
                                }
                            } else if (json[0].asistencias > '0' && json[0].votacion == '0') {
                                document.getElementById("nada").style = "display: none";
                                document.getElementById("votos").style = "display: none";
                                document.getElementById("aistencia").style = "display: block";
                                document.querySelector(".card-content").classList.remove("modo-blanco");
                                actualizaAs();
                                actasistot();
                            } else if (json[0].votacion > '0' && json[0].asistencias == '0') {
                                document.getElementById("nada").style = "display: none";
                                document.getElementById("aistencia").style = "display: none";
                                document.getElementById("votos").style = "display: block";
                                document.querySelector(".card-content").classList.remove("modo-blanco");
                                actualizaTema();
                                actualizaTotalesVotos();
                                actualizaListaVotacion();
                            }
                        }
                    }, error: function (xhr, status, error) {
                    }
                });
            }setInterval(validaEventos,1000);
            validaEventos();
            setInterval(validaEventos, 1000);
        });

        function actualizaTema(){
            $.ajax({
                type: 'GET',
                data: {},
                url: "{{ url('getTema') }}",
                success: function (response) {
                    $('#temaVoto').html(' Voto: ' + response);
                },
            });
        }

        function actualizaListaVotacion(){
            $.ajax({
                type: 'GET',
                data :{},
                url :   "{{ url('actualizaListaVotacion') }}",
                success: function (response) {
                    var json = $.parseJSON(response);

                    $("#tablaEstatusvotos").empty();
                    $.each(json, function(i, item) {
                        var style = "";
                        if(item.mensaje == 'FAVOR'){
                            style = "#4CAF50";
                        }else if(item.mensaje == 'CONTRA'){
                            style = "#DC3545";
                        }else if(item.mensaje == 'ABSTENCION'){
                            style = "#e9af00";
                        }else if(item.mensaje == 'SIN REGISTRO'){
                            style = "#DDDDDD";
                        }

                        $('#tablaEstatusvotos').append('<tr><td style="display: flex; align-items: center;">' +
                            '<span style="display: inline-block; width: 10.5px; height: 10.5px; background-color:' + style + '; border-radius: 90%; margin-right: 5px;"></span>' +
                            '<span style="color:'+style+'; font-size: 24px; line-height: 0.89; text-align: left;"><p style="color:'+style+'; font-size: 24px; line-height: 1; text-align: left;">' +
                            item.name.toUpperCase() + ' ' + item.ap_pat.toUpperCase() + ' ' + item.ap_mat.toUpperCase() +
                            '</p></span></td></tr>');
                    });
                },error: function(xhr, status, error) {
                }
            });
            setInterval(validaEventos,1000);
        };

        function actualizaAs(){

            $.ajax({
                type: 'GET',
                data :{},
                url :   "{{ url('actualizaAsistencias') }}",
                success: function (response) {
                    var json = $.parseJSON(response);

                    $("#tablaAsistencia23").empty();
                    $.each(json, function(i, item) {
                        if(item.mensaje == 'ASISTENCIA'){
                            var style = "#4CAF50;";
                        }else{
                            var style = "#DDDDDD;";
                        }
                        $('#tablaAsistencia23').append('<tr>' +
                            '<td style="display: flex; align-items: center;">' +
                            '<span style="display: inline-block; width: 10.5px; height: 10.5px; background-color:'+style+'; border-radius: 90%; margin-right: 5px;"></span>' +
                            '<span style="color:'+style+'; font-size: 24px; line-height: 0.9; text-align: left;"><p style="color:'+style+'; font-size: 24px; line-height: 1; text-align: left;">'+
                                item.name.toUpperCase() + ' ' +item.ap_pat.toUpperCase()+  ' ' + item.ap_mat.toUpperCase()
                            +'</p></span>' +
                            '</td>' +
                            '</tr>');

                    });
                },error: function(xhr, status, error) {
                }
            });
        }

        function actasistot(){
                $.ajax({
                    type: 'GET',
                    data :{},
                    url :   "{{ url('totalAsisPleno') }}",
                    success: function (response) {
                        var json = $.parseJSON(response);
                        document.getElementById("totalAsistencias23").innerHTML= '';
                        $('#tiempoA').val('');

                        // document.getElementById("totalAsistencias23").innerHTML= json[0].asistenciast;

                        $('#totalAsistencias23').replaceWith(' <td style="background-color: #DDDDDD; color: black; width:50px; word-wrap: break-word; font-weight: bold; font-size: 20px;" id="totalAsistencias23" xmlns="http://www.w3.org/1999/html">' +
                            '<span style="color: black;font-weight: bold; text-align: center; font-size: 20px " > TOTAL ASISTENCIAS: ' + json[0].asistenciast + '</span>' +
                            '</td>');

                        $('#tiempoA').val(json[0].tiempo);
                        showRemaining();
                    },error: function(xhr, status, error) {
                    }
                });
            }

        function actualizaTotalesVotos(){
                $.ajax({
                    type: 'GET',
                    data :{},
                    url :   "{{ url('actualizaTotalesVotos') }}",
                    success: function (response) {
                        var json = $.parseJSON(response);
                        $('#consenso1').replaceWith(' <td style="background-color: #dddddd; color: black; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="consenso1">' +
                            '<span style="display: inline-block; width: 15px; height: 15px; background-color:#4CAF50; border-radius: 90%; margin-right: 5px;"></span>' +
                            '<span style="font-size: 20px; line-height: 1;" >FAVOR: '+ json[0].votacionFavor + ' </span>' +
                            '</td>');
                        $('#disenso1').replaceWith(' <td style="background-color: #dddddd; color: black; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="disenso1">' +
                            '<span style="display: inline-block; width: 15px; height: 15px; background-color:#DC3545; border-radius: 90%; margin-right: 5px;"></span>' +
                            '<span style="font-size: 20; line-height: 1;" > CONTRA: ' + json[0].votacionContra + '</span>' +
                            '</td>');
                        $('#abstencion1').replaceWith(' <td style="background-color: #dddddd; color: black; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="abstencion1">' +
                            '<span style="display: inline-block; width: 15px; height: 15px; background-color:#e9af00; border-radius: 90%; margin-right: 5px;"></span>' +
                            '<span style="font-size: 20; line-height: 1;" > ABSTENCIÓN: ' + json[0].votacionAbsten + '</span>' +
                            '</td>');
                        $('#totalv1').replaceWith(' <td style="background-color: #dddddd; color: black; width:50px; word-wrap: break-word; font-weight: bold; text-align: center!important; padding: 0px 0px!important;" id="totalv1">' +
                            '<span style="font-size: 20; line-height: 1;" > TOTAL: ' + json[0].totalVotos + '</span></td>');

                        $('#tiempo').val(json[0].tiempo);
                        showRemainingV();
                    },error: function(xhr, status, error) {
                    }
                });
            }

        function favor(){
            $("#tipoBoton").val('favor');
            activarSensor();
            Swal.fire({
                title: "¡Atención!",
                text: "Escanear huella",
                icon: 'warning',
                showConfirmButton: false,
                timer:1000,
            });
        }

        function contra(){
            $("#tipoBoton").val('contra');
            activarSensor();
            Swal.fire({
                title: "¡Atención!",
                text: "Escanear huella",
                icon: 'warning',
                showConfirmButton: false,
                timer:1000,
            });
        }

        function abstencion(){
            $("#tipoBoton").val('abstencion');
            activarSensor();
            Swal.fire({
                title: "¡Atención!",
                text: "Escanear huella",
                icon: 'warning',
                showConfirmButton: false,
                timer:1000,
            });
        }

        function sinRegistro(){
            $("#tipoBoton").val('sinregistro');
            activarSensor();
            Swal.fire({
                title: "¡Atención!",
                text: "Escanear huella",
                icon: 'warning',
                showConfirmButton: false,
                timer:1000,
            });
        }

        function asistencia(){
            $("#tipoBoton").val('asistencia');
            activarSensor();
            Swal.fire({
                title: "¡Atención!",
                text: "Escanear huella",
                icon: 'warning',
                showConfirmButton: false,
                timer:1000,
            });
        }

        $(document).ready(function() {
            showRemainingV();
            showRemaining();
        });

            function showRemainingV() {
                var endA = document.getElementById('tiempo').value;
                var endA = new Date(endA);
                var now = new Date();

                if(endA < now){
                    var distance = 0;
                }else{
                    var distance = endA - now;
                }
                const fila = document.getElementById('barraVotos');
                if (distance <= 0)  {
                    clearInterval(timer);
                    document.getElementById('countdown').innerHTML = '00:00';
                    fila.style.display = 'none';
                    return;
                } else if (distance == "NaN") {
                    clearInterval(timer);
                    document.getElementById('countdown').innerHTML = '';
                    fila.style.display = 'none';
                    return;
                }else{
                    fila.style.display = 'table-row';
                }

                var minutes = Math.floor((distance % _hour) / _minute);
                var seconds = Math.floor((distance % _minute) / _second);
                if (seconds < 10) {
                    seconds = '0' + seconds;
                }
                document.getElementById('countdown').innerHTML = minutes + ':';
                document.getElementById('countdown').innerHTML += seconds;

            }timer = setInterval(showRemainingV, 1000);

            function showRemaining() {
                var endA = document.getElementById('tiempoA').value;
                var endA = new Date(endA);
                var now = new Date();

                if(endA < now){
                    var distance = 0;
                }else{
                    var distance = endA - now;
                }
                const fila = document.getElementById('barraAsistencia');
                if (distance <= 0)  {
                    clearInterval(timer);
                    // document.getElementById('countdownA').innerHTML = '00:00';
                    document.getElementById('countdownA').innerHTML = '00:00';
                    fila.style.display = 'none';
                    return;
                } else if (distance == "NaN") {
                    clearInterval(timer);
                    document.getElementById('countdownA').innerHTML = '';
                    fila.style.display = 'none';
                    return;
                }else{
                    fila.style.display = 'table-row';
                }

                var minutes = Math.floor((distance % _hour) / _minute);
                var seconds = Math.floor((distance % _minute) / _second);
                if (seconds < 10) {
                    seconds = '0' + seconds;
                }
                document.getElementById('countdownA').innerHTML = minutes + ':';
                document.getElementById('countdownA').innerHTML += seconds;
            }timer = setInterval(showRemaining, 900);

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });

        var test = null;

        var state = document.getElementById('content-capture');
        var myVal = ""; // Drop down selected value of reader
        var disabled = true;
        var startEnroll = false;

        var currentFormat = Fingerprint.SampleFormat.PngImage;
        var deviceTechn = {
            0: "Unknown",
            1: "Optical",
            2: "Capacitive",
            3: "Thermal",
            4: "Pressure"
        }

        var deviceModality = {
            0: "Unknown",
            1: "Swipe",
            2: "Area",
            3: "AreaMultifinger"
        }

        var deviceUidType = {
            0: "Persistent",
            1: "Volatile"
        }


        var FingerprintSdkTest = (function () {
            function FingerprintSdkTest() {
                var _instance = this;
                this.operationToRestart = null;
                this.acquisitionStarted = false;
                this.sdk = new Fingerprint.WebApi;


                this.sdk.onDeviceConnected = function (e) {
                    console.log('Escanear huella');
                };
                this.sdk.onDeviceDisconnected = function (e) {
                    console.log('Lector desconectaado');
                };
                this.sdk.onCommunicationFailed = function (e) {
                    console.log('Fallo la cominicación');
                };
                this.sdk.onSamplesAcquired = function (s) {
                    // Sample acquired event triggers this function
                    sampleAcquired(s);
                };
                this.sdk.onQualityReported = function (e) {
                    // Quality of sample aquired - Function triggered on every sample acquired
                    // document.getElementById("qualityInputBox").value = Fingerprint.QualityCode[(e.quality)];
                }

            }

            FingerprintSdkTest.prototype.startCapture = function () {
                if (this.acquisitionStarted) // Monitoring if already started capturing
                    return;
                var _instance = this;
                showMessage("");
                this.operationToRestart = this.startCapture;
                this.sdk.startAcquisition(currentFormat, myVal).then(function () {
                    _instance.acquisitionStarted = true;
                }, function (error) {
                    showMessage(error.message);
                });

            }

            FingerprintSdkTest.prototype.stopCapture = function () {
                if (!this.acquisitionStarted) //Monitor if already stopped capturing
                    return;
                var _instance = this;
                showMessage("");
                this.sdk.stopAcquisition().then(function () {
                    _instance.acquisitionStarted = false;

                    //Disabling stop once stoped
                    disableEnableStartStop();

                }, function (error) {
                    showMessage(error.message);
                });
            };

            // FingerprintSdkTest.prototype.getInfo = function () {
            FingerprintSdkTest.prototype.getInfo = function () {
                var _instance = this;
                return this.sdk.enumerateDevices();
            };

            FingerprintSdkTest.prototype.getDeviceInfoWithID = function (uid) {
                var _instance = this;
                return  this.sdk.getDeviceInfo(uid);
            };
            return FingerprintSdkTest;
        })();

        $(document).ready(function() {
            localStorage.clear();
            test = new FingerprintSdkTest();
            var allReaders = test.getInfo();
            allReaders.then(function (sucessObj) {
                var readersDropDownElement = document.getElementById("readersDropDown");
                readersDropDownElement.innerHTML ="";
                var option = document.createElement("option");
                option.selected = "selected";
                option.value =  sucessObj[0];
                option.text =  sucessObj[0];
                readersDropDownElement.add(option);
            });
        });

        function activarSensor(){
            var readersDropDownElement = document.getElementById("readersDropDown");
            myVal = readersDropDownElement.options[readersDropDownElement.selectedIndex].value;
            test.startCapture();
        }

        function showMessage(message){
            var _instance = this;
            var statusWindow = document.getElementById("status");
            x = state.querySelectorAll("#status");
            if(x.length != 0){
                x[0].innerHTML = message;
            }
        }

        function sampleAcquired(s){
            localStorage.setItem("imageSrc", "");
            var samples = JSON.parse(s.samples);
            localStorage.setItem("imageSrc", "data:image/png;base64," + Fingerprint.b64UrlTo64(samples[0]));
            if(state == document.getElementById("content-capture")){
                var vDiv = document.getElementById('imagediv');
                vDiv.innerHTML = "";
                var image = document.createElement("img");
                image.id = "image";
                image.className = "img-thumbnail";
                image.src = localStorage.getItem("imageSrc");
                vDiv.appendChild(image);

                let img = localStorage.getItem("imageSrc");

                $.ajax({
                    url: "/comprobarHuellaPleno",
                    type: 'POST',
                    data: {
                        'imagen' : img
                    },
                    beforeSend: function() {
                        showLoading()
                    },
                    success: function (response) {
                        hideLoading()
                        if (response != 0) {
                            var idDip = response;
                            var tipoBoton = $("#tipoBoton").val();
                            $.ajax({
                                url: "{{ url('accionHuella') }}",
                                type: 'GET',
                                data: {
                                    'idDip' : idDip,
                                    'tipoBoton' : tipoBoton,
                                },
                                success: function (response) {
                                    console.log('respuesta'+response.return)
                                    if (response.return == 1){
                                        Swal.fire({
                                            title: "¡Atención!",
                                            text: "Asistecia registrada "+response.dip,
                                            icon: 'success',
                                            showConfirmButton: false,
                                            timer:2000,
                                        }).then(function (){
                                            showRemaining();
                                            actasistot();
                                        })
                                    }else if (response.return == 2){
                                        Swal.fire({
                                            text: "Voto registrado "+response.dip,
                                            icon: "success",
                                            showConfirmButton: false,
                                            timer:2000,
                                        }).then(function (){
                                            actualizaTotalesVotos();
                                            showRemainingV();
                                        })
                                    }else if (response.return == 0){
                                        Swal.fire({
                                            title: "¡Atención!",
                                            text: "Huella no reconocida, intente nuevamente",
                                            icon: 'warning',
                                            showConfirmButton: false,
                                            timer:2000,
                                        });
                                    }
                                }
                            });
                        }else{
                            Swal.fire({
                                title: "¡Atención!",
                                text: "Huella no reconocida, intente nuevamente",
                                icon: 'warning',
                                showConfirmButton: false,
                                timer:2000,
                            });
                        }

                    }
                });
            }
        }

        function showLoading() {
            $("#loadingBack").show();
        }

        function hideLoading() {
            $("#loadingBack").hide();
        }
    </script>
@endpush

OHA YOOOO