3
I’m setting up a system (kind of emergency) for the church, for live broadcasting, because of social isolation. On the page where I am incorporating live, on the church website, I want that if the person enters within the official day and time of worship, and the video does not start, appear to him a div
with a "click here" to re-start the page.
If it’s other days and times, where it’s not live, let another div
, with a "click here" to go to the recorded cults page.
So, in short, when the person enters, php will take day and time, and check with the days and times of the variables. If you hit one, the div 1
, If it doesn’t hit, the div 2
.
The idea I have, but I want to run while I can barely crawl, then it became difficult. Here’s the code I thought, but it didn’t work:
<?php
$dataatual = ('w');
$horaatual = ('H:i:s');
$horade = '19:59:59';
$horaate = '21:00:01';
$horade1 = '08:59:59';
$horaate1 = '10:00:01';
$horade2 = '19:29:59';
$domingo = '0';
$quarta = '3';
$quinta = '4';
if (($dataatual = $domingo and ($horaatual >= $horade1 and $horaatual <= $horaate1))) or (($dataatual = $domingo and ($horaatual >= $horade2 and $horaatual <= $horaate))) or (($dataatual = $quarta and $horaatual >= $horade and $horaatual <= $horaate))) or (($dataatual = $quinta and $horaatual >= $horade and $horaatual <= $horaate))) { ?>
<div class="conteudo">
<h3>Olá, estamos ao vivo. Caso não esteja visualizando o vídeo, Clique <a href="https://www.ibnagv.com.br/cultos-ao-vivo/">AQUI </a>para atualizar sua página.</h3>
</div><?php } ?>
else { ?>
<div class="conteudo1">
<h3>Olá, no momento não estamos ao vivo. Mas você pode assistir nossos cultos gravados, clicando <a href="https://www.ibnagv.com.br/cultos-gravados/">AQUI </a>ou acessando o Menu Mídias / Cultos Gravados. Obrigado. </h3></div>
<?php } ?>
It worked perfectly. Thank you very much!
– Ibna GV
if I can mark the answer as correct I would be grateful :)
– montedo-dev