Guest User

Untitled

a guest
Apr 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. $quantity = 1000;
  4.  
  5. $origPrice = 200;
  6.  
  7. $currPrice = 75;
  8.  
  9. $diffPrice = $currPrice - origPrice
  10.  
  11. $diffPricePercent = (($currPrice - $origPrice) * 100)/$origPrice
  12.  
  13. ?>
  14.  
  15. <table border="1" cellpadding="5" cellspacing="0">
  16.  
  17. <tr>
  18.  
  19. <td> Quantity </td>
  20.  
  21. <td> Cost Price </td>
  22.  
  23. <td> Current Price </td>
  24.  
  25. <td> Absolute Change in price </td>
  26.  
  27. </tr>
  28.  
  29. <tr>
  30.  
  31. <td>
  32.  
  33. <td><?php echo $quantity ?> </td>
  34.  
  35. <td> <?php echo $origPrice ?></td>
  36.  
  37. <td> <?php echo $currPrice ?></td>
  38.  
  39. <td> <?php echo $diffPrice ?></td>
  40.  
  41. <td> <?php echo $diffPricePercent ?> % </td>
  42.  
  43. </tr>
  44.  
  45. </table>
  46.  
  47. </body>
  48.  
  49. </html>
Add Comment
Please, Sign In to add comment