I have the following listing:
HowwouldIdothatbyclickingtheexclamationicon,changetothecheckiconandviceversaandalsochangethestatusinthedatabase?ThePHP/MysqlcodeIknowhowtodo,butthejquerythatdoesnotbagmuch.SincethestatusiscomingfromtheDB,thecodelookslikethis:
$sql=mysqli_query($this->conexao,"SELECT * FROM documentos");
while($peListar = mysqli_fetch_object($sql)){
$statusDoc = ($peListar->StatusDocumentos == "A")?"<span style='color: red'><i class=\"fas fa-exclamation-circle fa-lg\" id=\"inativo\"></i></span>":"<span style='color: green'><i class=\"fas fa-check-circle fa-lg\" id=\"ativo\"></i></span>";
echo $statusDoc;
}