Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <!--Author:
  2.     Date:
  3.     File:   processOrder.php
  4.     Purpose:Chapter 6 Exercise
  5.  
  6. -->
  7.  
  8. <html>
  9. <head>
  10.     <title>SaveTheWorld Software</title>
  11.     <link rel ="stylesheet" type="text/css" href="sample.css" />
  12. </head>
  13. <body>
  14.  
  15.     <h1>SaveTheWorld: Process Order</h1>
  16.  
  17.     <?php
  18.         $orderFile = fopen("order.txt","r");
  19.         $order = fgets($orderFile);
  20.         fclose($orderFile);
  21.  
  22.         list ($os, $numCopies) = split(":", $order);
  23.  
  24.         $subtotal = $numCopies * 35.00;
  25.         $tax = $subtotal * 0.07;
  26.         $shippingHandling = $numCopies * 1.25;
  27.         $total = $subtotal + $tax + $shippingHandling;
  28.  
  29.         print("<p><strong>SaveThe World Software INVOICE:</strong></p>");
  30.         print("<p>Operating System: $os<br />");
  31.         print("Number of Copies Ordered: $numCopies<br />");
  32.         print("Sub-total: $".number_format($subtotal, 2)."<br />");
  33.         print("Sales tax: $".number_format($tax, 2)."<br />");
  34.         print("Shipping and handling: $".number_format($shippingHandling, 2)."</p><hr />");
  35.         print("<p><strong>TOTAL DUE: $".number_format($total, 2)."</strong></p><hr />");
  36.  
  37.     ?>
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement