Advertisement
jjkeegan86

Raspberry Pints

Feb 5th, 2016
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.56 KB | None | 0 0
  1. <!-- index.php additions -->
  2.  
  3. //PHP Addition to the top of the top of index.php after the connect function   
  4. if($db){
  5.         // Connect to the database
  6.         db();
  7.     //Start of Addition
  8.         if(isset($_POST['amount']))
  9.          {
  10.            $amount=$_POST['amount'];
  11.            $tap=$_POST['tap'];
  12.            
  13.            $sql = "insert into pours (tapId,pinId, amountPoured, pulses) values (".$tap.",".$tap.",".$amount."/128,1)";
  14.             mysql_query($sql);
  15.         }  
  16.     //End of Addition
  17.         $config = array();
  18.  
  19. <!--section that defines your column display selections this is where to add the form -->
  20. <?php if(($config[ConfigNames::ShowAbvCol]) && ! ($config[ConfigNames::ShowAbvImg])){ ?>
  21.  
  22.  
  23. <!-- added after the abv section I also commented out the echo for calorie count -->
  24.     <h2><?php echo number_format($abv, 1, '.', ',')."%"; ?> ABV</h2>
  25. <!-- start of addition -->
  26. <h2>       
  27.  
  28. <form action="" method="post">
  29. <select class = "styled-select"  name = "amount">
  30.     <option value="11" <?php if(isset($_POST['amount']) && $tapNum == $i && $amount == "11"){echo "selected";} ?>>Goblet</option>
  31.     <option value="17" <?php if(isset($_POST['amount']) && $tapNum == $i && $amount == "17"){echo "selected";} ?>>Pint</option>                        
  32.     <option value="6"  <?php if(isset($_POST['amount']) && $tapNum== $i && $amount=="6"){echo "selected";} ?>>Taste</option>
  33.     <option value="40" <?php if(isset($_POST['amount']) && $tapNum == $i && $amount == "40"){echo "selected";} ?>>Growler</option>
  34. </select>                                  
  35. <br/>
  36. <input class="pour" type="submit" value ="Pour"/>
  37. <input type="hidden" name="tap" value="<?php echo $beer['id'];?>">
  38. <input type="hidden" name="tapNum" value="<?php echo $i;?>">
  39. <br/>
  40. </form>
  41. </h2>
  42. <!-- End of Addition -->       
  43. </td>
  44.  
  45.  
  46.  
  47.  
  48.  
  49. <!-- CSV Addtions Add near top of csv file you can change all the color values-->
  50. .pour{
  51.         width:66px;
  52.         height:44px;
  53.         margin-top:25px;
  54.         font-family: MAGNETO;
  55.     font-size:large;
  56.     font-weight:bold;
  57.         border: 4px outset rgba(121,68,27,1.00);
  58.         box-shadow: inset 300px 300px 600px rgba(120,60,20,1.00);
  59.         color: rgba(222,206,16,1.00);
  60.     background-color: rgba(121,68,27,1.00);
  61.  
  62.         border-radius: 8px;
  63.  
  64. }
  65. select {
  66.    background: transparent;
  67.    width: 95px;
  68.    padding: 5px;
  69.    font-family: MAGNETO;
  70.    border: 4px outset rgba(121,68,27,1.00);
  71.    margin-top:12px;
  72.    font-size: 16px;
  73.    color: rgba(222,206,16,1.00);
  74.    font-weight: bold;
  75.    line-height: 1;
  76.    border-radius: 8px;
  77.    background-color: rgba(121,68,27,1.00);
  78.    border: 4px outset rgba(121,68,27,1.00);
  79.    weight: 34px;
  80.    -webkit-appearance: none;
  81.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement