I am trying to create a program that calculates discounts since I have the code but I do not understand how to do it in the form of a table k
exit this way try to use tags tr
and td
but the variables do not detect them.
Prod 1 500 100
Prod 2 300 100
Prod 3 200 100
Subtotal
DESCUENTO XX XX
TOTAL XX XX
This is my code:
<?php
echo"<tr>"
$a=500;
$b=300;
$x=200;
$desc=0.1;
$desc2=0.05;
$subtotal=$desc * $a;
$subtotall=$desc2 * $b;
</tr>";
</table";
$total;
if($a>500)
{
echo "Se te desconto el 10%";
echo "El subtotal es " .$subtotal;
echo "el total es".($a- $subtotal );
}
if($b<500)
{
echo "Se te desconto el 5%";
echo "el subtotal es " .($subtotall);
echo "el total es " .($b - $subtotall);
}
?>