MINI MINI MANI MO
<style>
.main {
width: 100%;
color: #000000 !important;
font-weight: bold;
column-count:3;
column-rule: 1px solid #bbb;
column-width: auto;
margin: 1px 1px 1px 1px !important;
font-size: 18px;
}
td, th {
padding: 3px 3px !important;
font-size: 50px;
text-align: left;
}
.row .col
{
padding: 0rem !important;
}
.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;
}
</style>
@extends('layoutPr')
@section('title')
Iniciar Asistencia
@endsection
@section('content')
<div class="container">
<div class="section">
<div class="card">
<div class="card-content">
<div id="votos" style="display: none;">
{{-- COUNT DE VOTACION --}}
{{-- @if(count($votacion)) --}}
<div class="row">
<p style="font-size: 18px;"><strong>Voto: @if(count($temaVotos)) {{$temaVotos[0]->votacion}} @endif</strong> </p>
</div>
<div id ="totalesVotos" class="row" >
<center>
<table style=" table-layout: fixed; width: 100%; align-items: left; padding: 0em;">
<tr>
<td style="background-color: #4CAF50; color: white; width:50px; word-wrap: break-word; font-weight: bold;" id="consenso1">FAVOR: {{$favor}}</td>
<td style="background-color: #FFC107; color: white; width:50px; word-wrap: break-word; font-weight: bold;" id="abstencion1">ABSTENCIÓN: {{$abstencion}} </td>
<td style="background-color: #DC3545; color: white; width:50px; word-wrap: break-word; font-weight: bold;" id="disenso1">CONTRA: {{$contra}} </td>
<td style="background-color: #DDDDDD; color: white; width:50px; word-wrap: break-word; font-weight: bold;" id="totalv1">TOTAL: {{$totalVotos}} </td>
</tr>
</table>
</center>
</div>
<div class="row">
{{-- <form class="col s3" style="background-color: #DDDDDD;">--}}
<form class="col s9" >
</form>
<form class="col s3" >
<h3><div id="countdown"></div></h3>
</form>
<input type='hidden' name='tiempo' id='tiempo' value=' @if(count($temaVotos)){{$temaVotos[0]->tiempoVotacion}}@endif'>
<form class="col s9">
</form>
</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:#E0A800;"; ?>
@elseif($voto->mensaje == 'SIN REGISTRO')
<?php $style = "background-color:#DDDDDD;"; ?>
@endif
<td style="{{$style}}">
<p style="color:black; font-size: 8px;">{{mb_strtoupper($voto->parlamentario->nombre)}} {{mb_strtoupper($voto->parlamentario->ap_pat)}} {{mb_strtoupper($voto->parlamentario->ap_mat)}}</p>
</td>
</tr>
@endforeach
</table>
</div>
{{-- @endif --}}
</div>
<div id="aistencia" style="display: none;">
<div class="row">
<form class="col s12">
<table id="tablatvotos">
<tr>
<td width="33%" style="text-align: right; color: black;"><h3>TIEMPO</h3></td>
<td width="33%">
<form class="col s3" style="background-color: #DDDDDD;">
<h3 style=" color: black;"><div id="countdownA"></div></h3>
</form>
<input type='hidden' name='tiempoA' id='tiempoA' value=' @if(count($asistencias)){{$asistencias[0]->tiempoVotacion}}@endif'></td>
<td style="background-color: #DDDDDD; color: black; width:50px; word-wrap: break-word; font-weight: bold; font-size: 20px;" id="totalAsistencias23" width="33%"><strong>TOTAL ASISTENCIAS:</strong> {{$totalAsistencias}}</td>
{{-- <td align="left"><button type='submit' class='btn btn-success' name='boton' style="background-color: #DDDDDD;"><strong></strong></button> </td> --}}
</tr>
</table>
</form>
</div>
<div class="row">
<form class="col s3">
<table style="display: none">
<tr>
<td><button type='submit' class='btn btn-success' name='boton' STYLE="background-color: #97194B;"><strong>Levantar mano </strong></button> </td>
<td><button type='submit' class='btn btn-success' name='boton' style="background-color: #97194B;"><strong>Bajar mano </strong></button> </td>
</tr>
</table>
</form>
<form class="col s4">
</form>
{{-- <form class="col s5">
<table>
<tr>
<td><a onclick="asistencia(1);" class='btn btn-success' style="background-color: #4CAF50;"><strong>ASISTENCIA </strong></a></td>
</tr>
</table>
</form> --}}
</div>
<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="{{$style}}">
<p style="color:black; font-size: 18px;">{{mb_strtoupper($asistencia->parlamentario->nombre)}} {{mb_strtoupper($asistencia->parlamentario->ap_pat)}} {{mb_strtoupper($asistencia->parlamentario->ap_mat)}}</p>
</td>
</tr>
@endforeach
</table>
</div>
{{-- @endif --}}
</div>
<div id="nada" style="display: none;">
<div class="row">
{{-- @if(!count($asistencias) and !count($votacion)) --}}
<form class="col S12">
<center><img src="{{asset('spid/images/logo/Tapiz.svg')}}" alt="materialize" width="100%" heigth="150%" style="border-radius:5px;"/></center>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="lugarABajar"></div>
@endsection
@push('scripts')
<script type="text/javascript">
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("actualizaTotalesVotos()",10000);
// $.ajaxSetup({ cache: false });
// });
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("actualizaListaVotacion()",10000);
// $.ajaxSetup({ cache: false });
// });
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("actualizaAs()",10000);
// $.ajaxSetup({ cache: false });
// });
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("actasistot()",10000);
// $.ajaxSetup({ cache: false });
// });
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("validaEventos()",10000);
// $.ajaxSetup({ cache: false });
// });
// $(document).ready(function() {
// function actualizar(){location.reload(true);}
// setInterval("oconse2()",10000);
// $.ajaxSetup({ cache: false });
// });
/* $(document).ready(function() {
function actualizar(){location.reload(true);}
setInterval("odise2()",10000);
$.ajaxSetup({ cache: false });
});
*/
//window.onload = validaEventos;
$(document).ready(function() {
function oconse2(){
$.ajax({
type: 'GET',
data :{},
url : "{{ url('levantaCon2') }}",
success: function (response) {
var json = $.parseJSON(response);
if(json[0].status=='vacio'){
$("#ocons2").empty();
}else{
$("#ocons2").empty();
$.each(json, function(i, item) {
$('#ocons2').append('<TR><td>'+item.nombre.toUpperCase() + ' '+item.ap_pat.toUpperCase()+ ' ' + item.ap_mat.toUpperCase() + ' / ' + ' '+ item.creado+'</td></TR>');
});
}
},error: function(xhr, status, error) {
}
});
}
function odise2(){
$.ajax({
type: 'GET',
data :{},
url : "{{ url('levantaDis2') }}",
success: function (response) {
var json = $.parseJSON(response);
if(json[0].status=='vacio'){
$("#odis2").empty();
}else{
$("#odis2").empty();
$.each(json, function(i, item) {
$('#odis2').append('<TR><td>'+item.nombre.toUpperCase() + ' '+item.ap_pat.toUpperCase()+ ' ' + item.ap_mat.toUpperCase() + ' / ' + ' '+ item.creado+'</td></TR>');
});
}
},error: function(xhr, status, error) {
}
});
}
function validaEventos(){
$.ajax({
type: 'GET',
data :{},
url : "{{ url('validaEventosActivos2') }}",
success: function (response) {
var json = $.parseJSON(response);
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"
oconse2();
}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";
actasistot();
actualizaAs();
}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";
actualizaListaVotacion();
actualizaTotalesVotos();
}
},error: function(xhr, status, error) {
}
});
}
function actasistot(){
$.ajax({
type: 'GET',
data :{},
url : "{{ url('actasistot') }}",
success: function (response) {
var json = $.parseJSON(response);
$('#totalAsistencias23').replaceWith(' <td style="background-color: #DDDDDD; color: black; width:50px; word-wrap: break-word; font-weight: bold; font-size: 20px;" id="totalAsistencias23"><p style="font-size: 18px;"> TOTAL ASISTENCIAS: ' + json[0].asistenciast + '</p></td>');
},error: function(xhr, status, error) {
}
});
}
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 = "background-color:#4CAF50;";
}else{
var style = "background-color:#DDDDDD;";
}
$('#tablaAsistencia23').append('<TR><td style="'+style+'"><p style="color:black; font-size: 18px; text-align: left;">'+item.name.toUpperCase() + ' '+item.ap_pat.toUpperCase()+ ' ' + item.ap_mat.toUpperCase()+'</p></td></TR>');
});
},error: function(xhr, status, error) {
}
});
}
function actualizaTotalesVotos(){
// totalesVotos
$.ajax({
type: 'GET',
data :{},
url : "{{ url('actualizaTotalesVotos') }}",
success: function (response) {
var json = $.parseJSON(response);
$('#consenso1').replaceWith(' <td style="background-color: #4CAF50; color: black; width:50px; word-wrap: break-word; font-weight: bold;" id="consenso1"><p style="font-size: 18px;"> FAVOR: ' + json[0].votacionFavor + '</p></td>');
$('#disenso1').replaceWith(' <td style="background-color: #DC3545; color: black; width:50px; word-wrap: break-word; font-weight: bold;" id="disenso1"><p style="font-size: 18px;"> CONTRA: ' + json[0].votacionContra + '</p></td>');
$('#abstencion1').replaceWith(' <td style="background-color: #FFC107; color: black; width:50px; word-wrap: break-word; font-weight: bold;" id="abstencion1"><p style="font-size: 18px;"> ABST: ' + json[0].votacionAbsten + '</p></td>');
$('#totalv1').replaceWith(' <td style="background-color: #DDDDDD; color: black; width:50px; word-wrap: break-word; font-weight: bold;" id="totalv1"><p style="font-size: 18px;"> TOTAL: ' + json[0].totalVotos + '</p></td>');
},error: function(xhr, status, error) {
}
});
}
function actualizaListaVotacion(){
$.ajax({
type: 'GET',
data :{},
url : "{{ url('actualizaListaVotacion') }}",
success: function (response) {
var json = $.parseJSON(response);
$("#tablaEstatusvotos").empty();
$.each(json, function(i, item) {
if(item.mensaje == 'FAVOR'){
var style = "background-color:#4CAF50;";
}else if(item.mensaje == 'CONTRA'){
var style = "background-color:#DC3545;";
}else if(item.mensaje == 'ABSTENCION'){
var style = "background-color:#FFC107;";
}else if(item.mensaje == 'SIN REGISTRO'){
var style = "background-color:#DDDDDD;";
}
$('#tablaEstatusvotos').append('<TR><td style="'+style+'"><p style="color:black; font-size: 18px; text-align: left;">'+item.name.toUpperCase() + ' '+item.ap_pat.toUpperCase()+ ' ' + item.ap_mat.toUpperCase()+'</p></td></TR>');
});
},error: function(xhr, status, error) {
}
});
}
setInterval(validaEventos,1000);
});
function favor(id){
var id = id;
$.ajax({
type: 'GET',
data :{id},
url : "{{ url('consensoU') }}",
success: function (response) {
location.reload();
},error: function(xhr, status, error) {
}
});
}
function contra(id){
var id = id;
$.ajax({
type: 'GET',
data :{id},
url : "{{ url('disensoU') }}",
success: function (response) {
location.reload();
},error: function(xhr, status, error) {
}
});
}
function abstencion(id){
var id = id;
$.ajax({
type: 'GET',
data :{id},
url : "{{ url('abstencionU') }}",
success: function (response) {
location.reload();
},error: function(xhr, status, error) {
}
});
}
function sinRegistro(id){
var id = id;
$.ajax({
type: 'GET',
data :{id},
url : "{{ url('sinRegistroU') }}",
success: function (response) {
location.reload();
},error: function(xhr, status, error) {
}
});
}
function asistencia(id){
var id = id;
$.ajax({
type: 'GET',
data :{id},
url : "{{ url('asistenciaU') }}",
success: function (response) {
location.reload();
},error: function(xhr, status, error) {
}
});
}
$(document).ready(function() {
var end1 = document.getElementById('tiempo').value;
var end = new Date(end1);
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemainingV() {
var now = new Date();
if(end < now){
var distance = 0;
}else{
var distance = end - now;
}
if (distance <= 0) {
clearInterval(timer);
document.getElementById('countdown').innerHTML = '00:00';
//document.getElementById('barraVotos').style.display="none";
return;
} else if (distance == "NaN") {
clearInterval(timer);
document.getElementById('countdown').innerHTML = '';
return;
}
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);
var endA = document.getElementById('tiempoA').value;
var endA = new Date(endA);
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemaining() {
var now = new Date();
if(endA < now){
var distance = 0;
}else{
var distance = endA - now;
}
if (distance <= 0) {
clearInterval(timer);
document.getElementById('countdownA').innerHTML = '00:00';
return;
} else if (distance == "NaN") {
clearInterval(timer);
document.getElementById('countdownA').innerHTML = '';
return;
}
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, 1000);
});
// $("html, body").animate({ scrollTop: $('#lugarABajar').offset().top }, 10000)
// ;
$("html, body").animate({ scrollTop: $('#lugarABajar').offset().top }, 10000,function(){
$('html, body').animate({ scrollTop: 0 }, 10000);
});
</script>
@endpush
OHA YOOOO