Hey! I’m trying to use some data on a PHP table to display different buttons on my website, but I’m facing some issues when trying to do this. Here is my HTML code and some screenshots:
<td><button class="btn btn-<?php if($array->usr_status == Pendente){ echo "warning";}else if($array->usr_status == Ativo){echo "success";}else{echo "danger";}; ?>"><i class="fas fa-<?php if($array->usr_status == Pendente){ echo "circle-question";}else if($array->usr_status == Ativo){echo "circle-check";}else{echo "circle-xmark";}; ?>"></i></button></td>
I’d like that these buttons under Status column display different colors and icons for different values on the column marked with red on the PHP table.
Basically, it should be red with a xmark if the value is “Negado”; green with a checkmark if the value is “Ativo” and yellow with a question mark if the value is “Pendente”. I really don’t know what I’m missing in the code. (I’m a newbie, don’t judge me hahahaha)
Thanks in advance