1. <html>
  2.  
  3.  
  4. <form method="POST" action="leke.php">
  5. Clean item prize: <input type="text" maxlength="12" size="12" name="clean" /><br />
  6. <br />
  7. Prize per scroll: <input type="text" maxlength="12" size="12" name="scrollsingle" /><br
  8.  
  9. />
  10. <br />
  11. Input the value on the item with 0 slots left.<br />
  12. Item (+0) prize: <input type="text" maxlength="12" size="12" name="val0" value="<?php
  13.  
  14. echo $val0; ?>"/><br />
  15. Item (+1) prize: <input type="text" maxlength="12" size="12" name="val1" /><br />
  16. Item (+2) prize: <input type="text" maxlength="12" size="12" name="val2" /><br />
  17. Item (+3) prize: <input type="text" maxlength="12" size="12" name="val3" /><br />
  18. Item (+4) prize: <input type="text" maxlength="12" size="12" name="val4" /><br />
  19. Item (+5) prize: <input type="text" maxlength="12" size="12" name="val5" /><br />
  20. <input type="submit" value="Calculate!" /><br />
  21. </form>
  22.  
  23. <?php
  24.  
  25. $slot5prob60n0 = 0.01;
  26. $slot5prob60n1 = 0.077;
  27. $slot5prob60n2 = 0.23;
  28. $slot5prob60n3 = 0.346;
  29. $slot5prob60n4 = 0.259;
  30. $slot5prob60n5 = 0.078;
  31.  
  32. if ($_REQUEST['clean'] && $_REQUEST['scrollsingle'] && $_REQUEST['val0'] &&
  33.  
  34. $_REQUEST['val1'] && $_REQUEST['val2'] && $_REQUEST['val3'] && $_REQUEST['val4'] &&
  35.  
  36. $_REQUEST['val5'])
  37. {
  38. $clean = htmlentities(strip_tags(
  39. stripslashes($_REQUEST['clean'])));
  40. $scrollsingle = htmlentities(strip_tags(
  41. stripslashes($_REQUEST['scrollsingle'])));
  42. $val0 = htmlentities(strip_tags(
  43. stripslashes($_REQUEST['val0'])));
  44. $val1 = htmlentities(strip_tags(
  45. stripslashes($_REQUEST['val1'])));
  46. $val2 = htmlentities(strip_tags(
  47. stripslashes($_REQUEST['val2'])));
  48. $val3 = htmlentities(strip_tags(
  49. stripslashes($_REQUEST['val3'])));
  50. $val4 = htmlentities(strip_tags(
  51. stripslashes($_REQUEST['val4'])));
  52. $val5 = htmlentities(strip_tags(
  53. stripslashes($_REQUEST['val5'])));
  54.  
  55. $xval0 = "$val0" * "$slot5prob60n0";
  56. $xval1 = "$val1" * "$slot5prob60n1";
  57. $xval2 = "$val2" * "$slot5prob60n2";
  58. $xval3 = "$val3" * "$slot5prob60n3";
  59. $xval4 = "$val4" * "$slot5prob60n4";
  60. $xval5 = "$val5" * "$slot5prob60n5";
  61.  
  62. $totalin = "$xval0" + "$xval1" + "$xval2" + "$xval3" + "$xval4" + "$xval5";
  63. $scroll = "$scrollsingle" * "5";
  64. $totalout = "$clean" + "$scroll";
  65. $vekst = ("$totalin" / "$totalout" * "100") - "100";
  66. $bonus = ("$totalin" - "$totalout") * "10";
  67.  
  68. }
  69. else
  70. {
  71. echo "ERROR: You left a field blank.";
  72. }
  73. ?>
  74.  
  75.  
  76. <br />
  77. <?php echo "$totalin";?>
  78. <br />
  79. ----------<br />
  80. <?php echo "$totalout";?>
  81. <br /><br />
  82. <?php
  83. if ("$totalin" > "$totalout")
  84. {
  85. echo "This is a good deal!";
  86. }
  87. if ("$totalin" < "$totalout")
  88. {
  89. echo "This is not a good deal.";
  90. }
  91. ?>
  92. <br />
  93. Total growth: <?php
  94. echo round("$vekst", 1);
  95. ?> %.
  96. <br />
  97. If you scrolled 10 items, you would most likely
  98. <?php
  99. if ("$totalin" > "$totalout")
  100. {
  101. number_format("$bonus");
  102. }
  103. if ("$totalin" < "$totalout")
  104. {
  105. number_format("$bonus");
  106. }
  107. echo number_format("$bonus");
  108. ?> mesos.
  109. </html>