I have a grid with a list of cleanups to do. Initially all buttons are green with the text "Start Cleaning". When I start cleaning, this button changes to blue and the text changes to "Continue Cleaning".
Perfect, this is already working. I would like, as long as there was an open cleaning, that the other buttons would be disabled, and would be enabled again only after the open cleaning has been completed.
The idea is not to allow the user to start cleaning without finishing the one that is open. Here is the snippet of my code that is inside a foreach:
<tr style="background-color:<?php echo $corFundoSujoAgendado?>;color: <?php echo $corQuartoSujoAgendado; ?>">
<td><center><?php echo $quartos["quarto"]; ?></center></td>
<td><center><?php echo date("d/m/Y H:i",strtotime($quartos["solicitado_em"])); ?></center></td>
<td>
<center>
<?php if (count($limpezaEmAbertoPorIDLimpeza) > 0) {?>
<a class='ui button fluid blue iniciarLimpeza' href="javascript:exibirLimpezaParaIniciar(<?php echo $idLimpezaQuartoSujoAgendado; ?>);" ><span class="iniciar">Continuar limpeza</span>
 
</a>
<?php } else { ?>
<a class='ui button fluid green iniciarLimpeza' href="javascript:exibirLimpezaParaIniciar(<?php echo $idLimpezaQuartoSujoAgendado; ?>);" ><span class="iniciar">Iniciar Limpeza</span>
 
</a>
<?php } ?>
</center>
</td>