Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <?php
  2. extract($_REQUEST);
  3.  
  4. $startYear = 1;
  5. $endYear = ($endYear);
  6. $assetCost = ($assetCost);
  7. $startDep = ($startDep);
  8. $startDepUsage = ($startDep);
  9. $endDep = ($endDep);
  10. $calulate = 0;
  11.  
  12. print "<h1> Depreciation Asset Table </h1>";
  13. print "<h2> Depreciation Period From Year 1 To $endYear";
  14. print "<h2> Asset Cost: $assetCost";
  15. print "<h2> From $startDep% to $endDep%";
  16.  
  17.  
  18.  
  19.  
  20. function chkData($endYear, $assetCost, $startDep, $calulate) {
  21.  
  22. if (is_integer($endYear) == true)
  23. continue;
  24. else {
  25. print "Depreciation Value is not Integer";
  26. $calulate++;
  27. }
  28. if (is_decimal($assetCost) == true)
  29. continue;
  30. else {
  31. print "Asset cost is not numeric";
  32. $calulate++;
  33. }
  34.  
  35.  
  36.  
  37. if (is_decimal($startDep) == true)
  38. continue;
  39. else
  40. {
  41. print "Starting depreciation value is not numeric";
  42. $calulate++;
  43. }
  44.  
  45.  
  46.  
  47. if (is_decimal($endDep) == true)
  48. continue;
  49. else
  50. {
  51. print "Starting depreciation value is not numeric";
  52. $calulate++;
  53. }
  54.  
  55.  
  56. if ($calulate == 0)
  57. return true;
  58. else
  59. return false;
  60.  
  61.  
  62. }
  63.  
  64.  
  65.  
  66. if (chkData($endYear, $assetCost, $startDep, $calulate) == true)
  67. print "<table>" ;
  68. print "<th> Depreciation year %/ Year</th>";
  69. for ($i = $startDep; $i <= $endDep; $i += 5.5) {
  70. print "<th> $i </th>";
  71. }
  72. print "</table>"
  73.  
  74.  
  75.  
  76.  
  77.  
  78. ?>
  79.  
  80.  
  81.  
  82. <a href="csis3280F2018ScottMyronAs1.html" class="button">Back</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement