Public paste
Undefined
By: Guest | Date: Sep 19 2008 11:12 | Format: PHP | Expires: never | Size: 862 B | Hits: 1273

  1. <html>
  2. <head>
  3. <title>Opdracht 2</title>
  4. </head>
  5.  
  6. <body>
  7. <TABLE BORDER="1">
  8. <TR> <TH>Product</TH> <TH>Aantal</TH> <TH>Prijs per stuk</TH> <TH>Prijs per orderregel</TH></TR>
  9. <?php
  10. $ordernr = 521;
  11. { echo ( "<b>Ordernr:</b> ".$ordernr."<br><br>"); }
  12. $product = array("Shrimp chips", "Little red New York beef", "Cow boy steak", "Mexican fries");
  13. $prijsperstuk = array(19.75, 27.30, 20.70, 5.10); // Prijs excl 6% BTW
  14. $aantal = array(3, 6, 3, 8);
  15.  
  16.  
  17. for($i=0; $i<=3; $i++)
  18. {
  19.     $prijsper = $aantal[$i] * $prijsperstuk[$i];
  20. echo ("<TR> <TD>" .$product[$i]. "</TD> <TD>" .$aantal[$i]. "</TD> <TD>" .$prijsperstuk[$i]. "</TD> <TD>" .$prijsper. "</TD></TR>n");
  21. }
  22. ?>
  23. </TABLE><br>
  24. <?php
  25. $totaal = 325.95;
  26. $metbtw = $totaal * 1.06;
  27. { echo ("<b>Totaal:</b> €".$totaal." <i>(excl btw)</i>, €".$metbtw." <i>(incl btw)</i>n"); }
  28. ?>
  29. </body>
  30. </html>