In the comparison of schedules I have in the registered database the opening and closing times of an establishment. I'm having a problem when comparing the time to see if the establishment is open or closed, it always appears to me as open when the time has passed.
<?php
$horario = strtotime(date('H:i'));
$result_horario_estado=mysql_query("select * from horarios where id_mae='".$row->id."'");
$row_horario_estado=mysql_fetch_array($result_horario_estado);
$abertura = strtotime($row_horario_estado['horario_abertura']);
$fechamento = strtotime($row_horario_estado['horario_fechamento']);
if($horario >= $abertura || $horario <= $fechamento) {
?>
<div style="margin:-3px 0px 5px 0px; width:257px; font-family:Arial, Helvetica, sans-serif; color:#0C3; font-size:13px;">Aberto</div>
<?php
} else {
?>
<div style="margin:-3px 0px 5px 0px; width:257px; font-family:Arial, Helvetica, sans-serif; color:#F00; font-size:13px;">Fechado Agora</div>
<?php
}
?>