Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Last active August 19, 2023 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogenesjup/ea7c7b125573d0af6b3a26449621aac4 to your computer and use it in GitHub Desktop.
Save diogenesjup/ea7c7b125573d0af6b3a26449621aac4 to your computer and use it in GitHub Desktop.
Widget de Apostas Flutuantes
<?php
/**
* ------------------------------------------------------------------------------------------------
*
*
* CARRINHO / RESUMO FLUTUANTE DAS APOSTAS
*
*
* ------------------------------------------------------------------------------------------------
*/
add_action("widget_apostas_plataforma", "widget_plataforma_fn" );
function widget_plataforma_fn(){
if(function_exists("desativar_widget_padrao_plataforma") || get_option("devToolsdisableWidgetApostas")=="Sim"):
return;
endif;
if(!is_page("autenticacao") &&
!is_page("carrinho") &&
!is_page("cart") &&
!is_page("checkout") &&
!is_page("finalizar-compra") &&
!is_page("confirmar-aposta") &&
get_option("formato_exibicao_odds")!="modelo 3 - modo placar" &&
get_option("formato_exibicao_odds")!="modelo 5 - desativado/modo games" &&
get_option("ocultar_widget_apostas_footer")!="Sim"): ?>
<article class="aposta">
<header class="aposta__header">
<aside>
<button class="aposta__header__btn active" type="button">
<d id="nomeDoTipoDeApostaWidget">Resumo das suas apostas</d> <span id="contadorTotalDeApostasWidget">0</span>
</button>
<!--<button class="aposta__header__btn" type="button">Múltipla</button>-->
</aside>
<button class="aposta__header__close" type="button"></button>
</header>
<section class="aposta__content">
<header class="aposta__content__header">
<button class="aposta__content__header__lucro" type="button">
CONFIRME SUA APOSTA EM ATÉ &nbsp;<span style="font-size:16px;" id="cronometroWidget">00:00</span>
</button>
<button class="aposta__content__header__concluido" type="button">Concluído</button>
</header>
<form id="formFinalizacaoAposta" method="post" action="<?php echo get_option("home") ?>/confirmar-aposta">
<input type="hidden" name="valorTotalFinalParaFormularioAposta" id="valorTotalFinalParaFormularioAposta" value="0" />
<input type="hidden" name="cambista_sem_login" id="cambista_sem_login" value="0" />
<input type="hidden" name="cambista_sem_login_url" id="cambista_sem_login_url" value="<?php echo get_option("home") ?>/confirmar-aposta/?vac=sim" />
<?php if(is_singular("gruposdeapostas")): ?>
<input type="hidden" name="liberacao_multipla" value="9" />
<?php endif; ?>
<!-- RESUMO DA APOSTA -->
<ul class="aposta__content__lista" id="conteudoApostaWidget">
</ul>
<!-- RESUMO DA APOSTA -->
<div style="padding:20px">
<input type="tel" placeholder="Valor para a aposta múltipla" id="valorApostaUsuarioWidgetMultipla" name="valor_aposta_multipla" onkeyup="aplicarSimuladorAposta(0,this.value,'multipla')" class="valor valor-aposta-multipla">
</div>
</form>
<section class="aposta__content__multipla">
<!--<input type="tel" value="" placeholder="Valor da sua aposta" class="valor" id="valorApostaWidget">-->
<!--<section>
<h5>Odds:</h5>
<h4><strong id="totalOddsWidget">0,00</strong></h4>
</section>-->
<!--<label for="multipla">
<input id="multipla" type="checkbox">
<span>Usar múltipla escolha</span>
<i class="fas fa-check"></i>
</label>-->
<section>
<h5>Ganho Potencial total:</h5>
<h4><strong id="calculadoraGanhoPotencialWidget">0,00</strong></h4>
</section>
<h6 class="aviso">Sua aposta só será válida, após a confirmação da mesma.</h6>
</section>
<footer class="aposta__content__footer">
<h5>Valor Total à ser pago:</h5>
<h4 id="valorTotalDescontoApostaWidget"><?php echo get_option("moeda_padrao"); if (FALSE === get_option('moeda_padrao')) echo "R$" ?> 0,00</h4>
</footer>
<footer class="limpar-todo-widget-carrinho">
<button type="button" id="limparTodoWidgetCarrinho" onclick="limparTodoWidgetCarrinho()">
Limpar todas as apostas <i class="fas fa-times"></i>
</button>
</footer>
<?php if(get_option("apostas_sem_login")=="sim"): ?>
<input type="text" id="codigoCambista" class="codigo-cambista" placeholder="Possuí código de cambista?" />
<?php endif; ?>
<button id="apostarButton" class="aposta__content__button" onclick="clienteIniciarAposta()" type="button">Apostar</button>
</section>
</article>
<?php
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment