Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.  
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title></title>
  7.  
  8. <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
  9.  
  10. <script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
  11.  
  12.  
  13. <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
  14.  
  15.  
  16. </head>
  17. <body>
  18.  
  19. <form action="" method="post" name="addsale1">
  20.  
  21. <table align="center">
  22. <tr>
  23. <td align="right">DATE :</td>
  24. <td><input type="date" size="12" id="date" name="date" required="true"/></td></tr>
  25.  
  26. <tr><td align="right">PRODUCT :</td>
  27. <td><select name="product" required="true">
  28. <option name="nestle">Nestle</option>
  29. <option name="thane">Thane</option>
  30. <option name="footmedix">Footmedix</option>
  31. <option name="charmonix">Charmonix</option>
  32. <option name="secretextensions">Charmonix</option>
  33. <option name="neogyn">Neogyn</option>
  34. <option name="neaterfeeder">NeaterFeeder</option>
  35. <option name="neaterscooper">NeaterScooper</option>
  36. <option name="keronique">Keronique</option>
  37. </select>
  38. </td></tr>
  39. <tr><td align="right">AUTOSHIP :</td>
  40. <td><select name="autoship" required="true">
  41. <option value="autoshipyes">YES</option>
  42. <option value="autoshipno">NO</option>
  43. </select>
  44. </td></tr>
  45. <tr><td align="right">SALES AMT :</td>
  46. <td><input type="text" id="salesamt" name="salesamt" value='' required="true"></td></tr>
  47. <tr><td align="right">&nbsp;</td>
  48. <td><input type="hidden" name="nestlecommission" required="true" value="<?php echo $nestlecommission; ?>"><input type="hidden" name="regcommission" required="true" value="<?php echo $commission; ?>"></td></tr>
  49. <tr><td align="right">ORDER # :</td>
  50. <td><input type="text" name="order" required="true"></td></tr>
  51. <tr><td>&nbsp;</td><td><input type="submit" value="ADD SALE" name="addsale"></input></td></tr>
  52. </form>
  53. </table>
  54. <table cols="5" name="sales" border="1" align="center" width="75%" bordercolor="black">
  55. <tr>
  56. <th width="10%" bgcolor="#00FF00">DATE</th>
  57. <th width="10%" bgcolor="#FF4000">ORDER #</th>
  58. <th width="15%" bgcolor="#00FFFF">PRODUCT</th>
  59. <th width="10%" bgcolor="#FF00BF">AUTOSHIP</th>
  60. <th width="10%" bgcolor="#FF0000">SALES AMT</th>
  61. <th width="20%" bgcolor="#B404AE">COMMISSION</th>
  62. <th>COMM2</th>
  63. </tr>
  64. <br><br>
  65. <?php
  66. $file = file('test.txt');
  67. //now count the lines ..
  68. $lines = count($file);
  69. for ($i=0; $i<=$lines-1; $i++) {
  70. $part = explode(',', $file[$i]);
  71. echo "<tr align=center>
  72. <td width=10% bgcolor=#00FF00><b>$part[0]</b></td>
  73. <td width=15% bgcolor=#00FFFF><b>$part[1]</b></td>
  74. <td width=10% bgcolor=#FF00BF><b>$part[3]</b></td>
  75. <td width=10% bgcolor=#FF0000><b>$part[4]</b></td>
  76. <td width=20% bgcolor=#B404AE><b>$part[5]</b></td>
  77. <td width=10% bgcolor=#FF4000><b>$part[6]</b></td>
  78. <td width=10%><b>$part[7]</b></td>
  79. </tr>";
  80. }
  81. echo "</table>";
  82. ?>
  83. </body>
  84. </html>
  85.  
  86. <?php
  87. if(isset($_POST['date'])){
  88. $date = $_POST['date'];
  89. $nestlecommission1 = $_POST['nestlecommission'];
  90. $regcommission= $_POST['regcommission'];
  91. $product = $_POST['product'];
  92. $autoship = $_POST['autoship'];
  93. $salesamt = $_POST['salesamt'];
  94. $order = $_POST['order'];
  95.  
  96. //the data
  97. $data = "$date,$order,$product,,$autoship,$$salesamt,$$regcommission,$$nestlecommission1n";
  98.  
  99. //open the file and choose the mode
  100. $fh = fopen("test.txt", "a");
  101. fwrite($fh, $data);
  102.  
  103. //close the file
  104. fclose($fh);
  105. }
  106.  
  107.  
  108. $nestlecommission1=$nestlecommission;
  109.  
  110. $commission=$_POST["salesamt"]*$percent;
  111.  
  112.  
  113.  
  114. //What percentage they get according to checkboxes or dropdown
  115. $percent=0;
  116. if(isset($_POST["thane"])){
  117. $percent+=.02;
  118. }
  119.  
  120. if(isset($_POST["footmedix"])){
  121. $percent+=.01;
  122. }
  123.  
  124. if(isset($_POST["charmonix"])){
  125. $percent+=.01;
  126. }
  127.  
  128. if(isset($_POST["secretextensions"])){
  129. $percent+=.01;
  130. }
  131.  
  132. if(isset($_POST["neogyn"])){
  133. $percent+=.01;
  134. }
  135.  
  136. if(isset($_POST["neaterfeeder"])){
  137. $percent+=.01;
  138. }
  139.  
  140. if(isset($_POST["neaterscooper"])){
  141. $percent+=.01;
  142. }
  143.  
  144. if(isset($_POST["keronique"])){
  145. $percent+=.01;
  146. }
  147.  
  148. $nestlecommission=0;
  149.  
  150. if (isset($_POST["autona"])){
  151. $nestlecommission+=0;
  152. }
  153.  
  154. if(isset($_POST["autoshipyes"])){
  155. $nestlecommission+=1;
  156. }
  157.  
  158. if(isset($_POST["autoshipno"])){
  159. $nestlecommission+=1;
  160. }
  161.  
  162. if(isset($_POST["singlepayyes"])){
  163. $nestlecommission+=1;
  164. }
  165.  
  166. if(isset($_POST["singlepayno"])){
  167. $nestlecommission+=0;
  168. }
  169.  
  170. if(isset($_POST["shipthreeday"])){
  171. $nestlecommission+=.5;
  172. }
  173.  
  174. if(isset($_POST["shipovernight"])){
  175. $nestlecommission+=1;
  176. }
  177. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement