Hello friends, let me explain, I make a query to obtain the scores when a user in 4 stages must acquire a number greater than 69 points, the idea is to show an image according to the score greater or less than 69 points.
If the user does not achieve 69 points in the first stage, an image is displayed
$comp='<img src="img/icons/alert_graduate.gif" alt="">';
This same image should continue to be shown if even in the fourth stage this user did not manage to obtain a score greater than 69 points
when the user achieves this score, it does not matter his stage, the image is shown
$comp='<img src="img/icons/graduate.png" alt="">';
code:
if ($etapa1 > 69) {
$comp='<img src="img/icons/graduate.png" alt="">';
} elseif ($etapa2 > $etapa1) {
$comp='<img src="img/icons/graduate.png" alt="">';
} elseif ($etapa3 > $etapa1) {
$comp='<img src="img/icons/graduate.png" alt="">';
} elseif ($etapa4 > $etapa1) {
$comp='<img src="img/icons/graduate.png" alt="">';
} else{
$comp='<img src="img/icons/alert_graduate.gif" alt="">';
}
I put two codes, in one it is evaluated if it is greater than or equal to 69, in another, only if it is greater than 69. If the user graduates with 69 or more points, you should use the first one, but if he graduates with 70 or more points, you should use the second.
Ver Demo del Código