I need to check if the numbers in $qt1, $qt2 and $qt3 are negative and if any of them are negative not run the rest of the code, if they are 0 or positive then run the rest of the code. I need to write more stuff so I can post the question so sorry if I am making you read this for nothing, but I just need what I had asked for, I searched online and couldn´t find anything to help me. My level of codding is really basic so please try and not make something super complex. And thank you for anyone how is willing to help.
<?php
$qt1 = 2;<br>
$prec1 = 10; <br>
$qt2 = 2;<br>
$prec2 =5 ;<br>
$qt3 = 3;<br>
$prec3 =12 ;<br>
$descpromo = "abr20";<br>
$total = $qt1 * $prec1 + $qt2 * $prec2 + $qt3 * $prec3;
If (($qt1 + $qt2 + $qt3) >0 ){
IF ($total < 40) {
$portes = 5;}
ELSE
{ <br>if ($total < 50) {
$portes = 2.5;}
<br>else { $portes = 0;}
}
if ($descpromo = "abr20") {
<br>$totalpromo = $total * 0.20; }
else
{ $totalpromo = 0; }
$totalfinal = $total - $totalpromo;
print ("Dados Da Encomenda:"). "<br>"."<br>";
echo ("Bola de futbol ⚽: ");
print round($qt1, 2);
echo "<br>"."<br>";
echo ("Bola de beisebol ⚾: ");
print round($qt2, 2);
echo "<br>"."<br>";
echo ("Bola de Basket : ");
print round($qt3, 2);
echo "<br>"."<br>";
echo ("Encomenda: ");
print ($total);
echo (" €");
echo "<br>"."<br>";
echo ("Valor dos portes: ");
print ($portes);
echo (" €");
echo "<br>"."<br>";
echo (" Valor sem Iva: ");
print round($total/1.30,2);
echo "<br>"."<br>";
echo (" Valor do Iva: ");
print round ($total - ($total/1.30), 2);
echo (" €");
}
else{
echo "<br>";
print (" Tem que possuir pelo menos 1 item na sua encomenda");
}
echo "<br>"."<br>";
if ($totalfinal < 50) {
print (" A encomenda será entregue dentro de 10 dias uteis");}
else{
echo"<br>";
print (" A encomenda será entregue dentro de 3 dias uteis");
echo "<br>";
}
?>