Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
- <script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
- <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
- </head>
- <body>
- <form action="" method="post" name="addsale1">
- <table align="center">
- <tr>
- <td align="right">DATE :</td>
- <td><input type="date" size="12" id="date" name="date" required="true"/></td></tr>
- <tr><td align="right">PRODUCT :</td>
- <td><select name="product" required="true">
- <option name="nestle">Nestle</option>
- <option name="thane">Thane</option>
- <option name="footmedix">Footmedix</option>
- <option name="charmonix">Charmonix</option>
- <option name="secretextensions">Charmonix</option>
- <option name="neogyn">Neogyn</option>
- <option name="neaterfeeder">NeaterFeeder</option>
- <option name="neaterscooper">NeaterScooper</option>
- <option name="keronique">Keronique</option>
- </select>
- </td></tr>
- <tr><td align="right">AUTOSHIP :</td>
- <td><select name="autoship" required="true">
- <option value="autoshipyes">YES</option>
- <option value="autoshipno">NO</option>
- </select>
- </td></tr>
- <tr><td align="right">SALES AMT :</td>
- <td><input type="text" id="salesamt" name="salesamt" value='' required="true"></td></tr>
- <tr><td align="right"> </td>
- <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>
- <tr><td align="right">ORDER # :</td>
- <td><input type="text" name="order" required="true"></td></tr>
- <tr><td> </td><td><input type="submit" value="ADD SALE" name="addsale"></input></td></tr>
- </form>
- </table>
- <table cols="5" name="sales" border="1" align="center" width="75%" bordercolor="black">
- <tr>
- <th width="10%" bgcolor="#00FF00">DATE</th>
- <th width="10%" bgcolor="#FF4000">ORDER #</th>
- <th width="15%" bgcolor="#00FFFF">PRODUCT</th>
- <th width="10%" bgcolor="#FF00BF">AUTOSHIP</th>
- <th width="10%" bgcolor="#FF0000">SALES AMT</th>
- <th width="20%" bgcolor="#B404AE">COMMISSION</th>
- <th>COMM2</th>
- </tr>
- <br><br>
- <?php
- $file = file('test.txt');
- //now count the lines ..
- $lines = count($file);
- for ($i=0; $i<=$lines-1; $i++) {
- $part = explode(',', $file[$i]);
- echo "<tr align=center>
- <td width=10% bgcolor=#00FF00><b>$part[0]</b></td>
- <td width=15% bgcolor=#00FFFF><b>$part[1]</b></td>
- <td width=10% bgcolor=#FF00BF><b>$part[3]</b></td>
- <td width=10% bgcolor=#FF0000><b>$part[4]</b></td>
- <td width=20% bgcolor=#B404AE><b>$part[5]</b></td>
- <td width=10% bgcolor=#FF4000><b>$part[6]</b></td>
- <td width=10%><b>$part[7]</b></td>
- </tr>";
- }
- echo "</table>";
- ?>
- </body>
- </html>
- <?php
- if(isset($_POST['date'])){
- $date = $_POST['date'];
- $nestlecommission1 = $_POST['nestlecommission'];
- $regcommission= $_POST['regcommission'];
- $product = $_POST['product'];
- $autoship = $_POST['autoship'];
- $salesamt = $_POST['salesamt'];
- $order = $_POST['order'];
- //the data
- $data = "$date,$order,$product,,$autoship,$$salesamt,$$regcommission,$$nestlecommission1n";
- //open the file and choose the mode
- $fh = fopen("test.txt", "a");
- fwrite($fh, $data);
- //close the file
- fclose($fh);
- }
- $nestlecommission1=$nestlecommission;
- $commission=$_POST["salesamt"]*$percent;
- //What percentage they get according to checkboxes or dropdown
- $percent=0;
- if(isset($_POST["thane"])){
- $percent+=.02;
- }
- if(isset($_POST["footmedix"])){
- $percent+=.01;
- }
- if(isset($_POST["charmonix"])){
- $percent+=.01;
- }
- if(isset($_POST["secretextensions"])){
- $percent+=.01;
- }
- if(isset($_POST["neogyn"])){
- $percent+=.01;
- }
- if(isset($_POST["neaterfeeder"])){
- $percent+=.01;
- }
- if(isset($_POST["neaterscooper"])){
- $percent+=.01;
- }
- if(isset($_POST["keronique"])){
- $percent+=.01;
- }
- $nestlecommission=0;
- if (isset($_POST["autona"])){
- $nestlecommission+=0;
- }
- if(isset($_POST["autoshipyes"])){
- $nestlecommission+=1;
- }
- if(isset($_POST["autoshipno"])){
- $nestlecommission+=1;
- }
- if(isset($_POST["singlepayyes"])){
- $nestlecommission+=1;
- }
- if(isset($_POST["singlepayno"])){
- $nestlecommission+=0;
- }
- if(isset($_POST["shipthreeday"])){
- $nestlecommission+=.5;
- }
- if(isset($_POST["shipovernight"])){
- $nestlecommission+=1;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement