Hello all, I'm fairly new to using PHP, and for my assignment I've coded it all but I'm trying to go the extra step, and code something that if the item amount = 0 it doesn't print it out on the order form
The items are $LAPTOP $MONITOR $KEYBOARD $PRINTER
I'm trying to figure out how to get it that if one of them or all of them or a few of them are equal to 0, how can I get it to not print them on the order form
I tried using if and else if and && but it was not working for me
for instance i was taking a space before laptop and doing
if($LAPTOP==0){
print"";
else{
then have the code I had to print if the person ordered a laptop.
How do I get this to work if I have more than one item quantity as 0? or a select few as 0, or 3 of them as 0?
here is original code//
print "<br> <font size=10>Thank You $NAME</font <br>";
print"<br><br>";
print "We appreciate your business with us! Your Customer ID is: $CUST_ID<br>";
print"<br>";
print "Your order # is: $ORDER_ID. Order placed on "; print strftime('%c'); print " entails the following purchase: <br>";
print"<br>";
print "Number of Laptops: $LAPTOP Cost of laptop $750.23. <b>Total cost of laptops:</b> \$$LaptopCost<br>";
print"<br>";
print "Number of Monitors: $MONITOR Cost of monitor $275.84 <b>Total cost of monitors:</b> \$$MonitorCost<br>";
print"<br>";
print "Number of Keyboards: $KEYBOARD Cost of keyboard $80.11. <b>Total cost of keyboards:</b> \$$KeyboardCost<br>";
print"<br>";
print "Number of Printers Ordered: $PRINTER |Cost of printer $125.28.| <b>Total cost of printers:</b> \$$PrinterCost<br>";
print"<br>";
print "Shipping & Handling - $DELIVERY: \$$DeliveryCharge<br>";
print"<br>";
print "Final Amount: \$$AMOUNT <br>";