title: Bootstrap 3.3.7 hidden-lg-up not working
body: <p>I'm trying to design a a mobile version of a game I've been working on. Apologies for the messy code, it's nothing serious. I've decided to use a hamburger-menu for the mobile version and want to hide it on desktop devices. For this I found "hidden-lg-up" in the bootstrap documentation but it doesn't seem to be working. I at least know that the bootstrap js is loaded because if I change the name I get an error in the browser console.</p>
  
  <p>The element I'm trying this with is the "hamburger-menu-toggle" and "hamburger-menu".</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;CEO Panel&lt;/title&gt;
      &lt;link rel="shortcut icon" href="favicon.png?v=1"/&gt;
      &lt;link rel="stylesheet" href="css/main.css"&gt;
  
      &lt;!-- JQUERY --&gt;
      &lt;script src="js/libs/jquery-3.1.0.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/libs/jquery-ui-1.12.0/jquery-ui.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- LIBS AND PLUGINS --&gt;
      &lt;script src="js/libs/jquery-mousewheel-3.1.13/jquery.mousewheel.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/libs/mapbox.js/jquery.mapbox.js"&gt;&lt;/script&gt;
      &lt;script src="js/libs/countdown/jquery.countdown.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/libs/jquery.ui.touch-punch.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- GAME JS --&gt;
      &lt;script src="js/game_logic/main.js"&gt;&lt;/script&gt;
      &lt;script src="js/game_logic/buttons.js"&gt;&lt;/script&gt;
  
      &lt;script src="js/libs/bootstrap-3.3.7-dist/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;main&gt;
        &lt;div id="map-wrapper"&gt;
          &lt;img id="map" src="res/los_santos_map.png" alt="Los Santos Map"&gt;
          &lt;div id="map-content"&gt;
            &lt;!--&lt;div class="map-marker owned" id="warehouse1"&gt;&lt;/div&gt;
            &lt;div class="map-marker for-sale" id="warehouse2"&gt;&lt;/div&gt;--&gt;
  
            &lt;?php
              $pdo = pdo();
              $username = $_SESSION['username'];
  
              foreach($pdo-&gt;query("SELECT * FROM warehouses") as $row){
                $warehouse_id = $row['id'];
                $statement = $pdo-&gt;prepare("SELECT * FROM warehouse_contracts WHERE warehouse_id LIKE '$warehouse_id' AND username LIKE '$username'");
                $statement-&gt;execute();
                $rowCount = $statement-&gt;rowCount();
  
                //find out the size of the warehouse
                if($row['slots'] &lt; 64){
                  $size = "small";
                }
                else if($row['slots'] &gt;= 64 &amp;&amp; $row['slots'] &lt; 256){
                  $size = "medium";
                }
                else{
                  $size = "large";
                }
  
                //find out if it's owned by the user
                if($rowCount&gt;0){
                  echo '&lt;div class="map-marker owned ' . $size . '" id="warehouse' . $row['id'] . '" style="top: ' . $row['y'] . 'px; left: ' . $row['x'] . 'px;"&gt;&lt;/div&gt;';
                }
                else{
                  echo '&lt;div class="map-marker for-sale ' . $size . '" id="warehouse' . $row['id'] . '" style="top: ' . $row['y'] . 'px; left: ' . $row['x'] . 'px;"&gt;&lt;/div&gt;';
                }
              }
            ?&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div style="background-image: url('res/radar-overlay.png'); width: 100%; height: 100%; position: fixed; background-size: cover; opacity: 0.2; pointer-events: none;"&gt;&lt;/div&gt;
  
        &lt;div id="HUD"&gt;
          &lt;div id="hamburger-menu-toggle" class="hidden-lg-up"&gt;
            &lt;div&gt;&lt;/div&gt;
            &lt;div&gt;&lt;/div&gt;
            &lt;div&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="hamburger-menu" class="hidden-lg-up"&gt;
  
          &lt;/div&gt;
  
          &lt;a href="index.php?page=logout"&gt;&lt;div id="logout" class="button"&gt;LOGOUT&lt;/div&gt;&lt;/a&gt;
  
          &lt;?php
            if(isset($_SESSION['admin']) &amp;&amp; $_SESSION['admin'] === "TRUE"){
              echo '
                &lt;div id="admin-stats"&gt;
                  &lt;h1&gt;map.x: &lt;span id="map_x"&gt;&lt;/span&gt;&lt;br&gt;map.y: &lt;span id="map_y"&gt;&lt;/span&gt;&lt;/h1&gt;
                  &lt;h1&gt;map.height: &lt;span id="map_height"&gt;&lt;/span&gt;&lt;br&gt;map.width: &lt;span id="map_width"&gt;&lt;/span&gt;&lt;br&gt;mouse.x: &lt;span id="mouse_x"&gt;&lt;/span&gt;&lt;br&gt;mouse.y: &lt;span id="mouse_y"&gt;&lt;/span&gt;&lt;/h1&gt;
                &lt;/div&gt;
              ';
            }
          ?&gt;
  
          &lt;h1 id="cash"&gt;
            &lt;?php
              $pdo = pdo();
              $username = $_SESSION['username'];
              $statement = $pdo-&gt;prepare("SELECT cash FROM users WHERE username LIKE '$username'");
              $statement-&gt;execute();
              $results = $statement-&gt;fetch();
  
              echo '$' . number_format($results['cash']);
            ?&gt;
          &lt;/h1&gt;
  
          &lt;div id="warehouse-toggle"&gt;
            &lt;div class="button toggle-selected"&gt;ALL&lt;/div&gt;
            &lt;div class="button toggle"&gt;OWNED&lt;/div&gt;
            &lt;div class="button toggle"&gt;SMALL&lt;/div&gt;
            &lt;div class="button toggle"&gt;MEDIUM&lt;/div&gt;
            &lt;div class="button toggle"&gt;LARGE&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div id="stock-actions"&gt;
            &lt;?php
              $pdo = pdo();
              $username = $_SESSION['username'];
              $statement = $pdo-&gt;prepare("SELECT * FROM shipments WHERE status LIKE 'active' AND username LIKE ?");
              $statement-&gt;bindParam(1, $username);
              $statement-&gt;execute();
              $row_count = $statement-&gt;rowCount();
  
              if($row_count == 0){
                echo '
                  &lt;div id="buy-stock-button" class="button"&gt;BUY&lt;/div&gt;
                ';
  
                $statement = $pdo-&gt;prepare("SELECT * FROM storage WHERE username LIKE ?");
                $statement-&gt;bindParam(1, $username);
                $statement-&gt;execute();
                $row_count = $statement-&gt;rowCount();
                if($row_count &gt; 0){
                  echo '
                    &lt;div id="sell-stock-button" class="button"&gt;SELL&lt;/div&gt;
                  ';
                }
                else{
                  echo '
                    &lt;div id="sell-stock-button" class="button disabled"&gt;SELL&lt;/div&gt;
                  ';
                }
              }
              else{
                echo '
                  &lt;div id="buy-stock-button" class="button disabled"&gt;BUY&lt;/div&gt;
                  &lt;div id="sell-stock-button" class="button disabled"&gt;SELL&lt;/div&gt;
                ';
              }
            ?&gt;
            &lt;div id="upgrades-button" class="button"&gt;UPGRADES&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div id="page-toggle"&gt;
            &lt;div class="button toggle"&gt;SUMMARY PAGE&lt;/div&gt;
            &lt;div class="button toggle-selected"&gt;WAREHOUSE MAP&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="dialog" id="owned-warehouse-dialog"&gt;
            &lt;div class="close-button"&gt;x&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="dialog" id="buy-warehouse-dialog"&gt;
            &lt;div class="close-button"&gt;x&lt;/div&gt;
  
            &lt;?php
              /*
              $pdo = pdo();
              $warehouse_id = $_GET['warehouse_id'];
              $statement = $pdo-&gt;prepare("SELECT * FROM warehouses WHERE id LIKE ?");
              $statement-&gt;bindParam(1, $warehouse_id);
              $statement-&gt;execute();
              $warehouse = $statement-&gt;fetch();
  
              echo '
                &lt;h1&gt;WAREHOUSE ' . $warehouse_id . '&lt;/h1&gt;
                &lt;p&gt;STATUS:&lt;span class="right-text"&gt;FOR SALE&lt;/span&gt;&lt;/p&gt;
                &lt;p&gt;WAREHOUSE SLOTS:&lt;span class="right-text"&gt;' . $warehouse['slots'] . '&lt;/span&gt;&lt;/p&gt;
                &lt;p&gt;COST:&lt;span class="right-text"&gt;' . $warehouse['price'] . '&lt;/span&gt;&lt;/p&gt;
  
                &lt;div class="submit-button"&gt;BUY&lt;/div&gt;
              ';
              */
            ?&gt;
          &lt;/div&gt;
  
          &lt;div class="dialog" id="buy-warehouse-dialog"&gt;&lt;/div&gt;
  
          &lt;div class="dialog" id="buy-stock-dialog"&gt;
            &lt;div class="close-button"&gt;x&lt;/div&gt;
  
            &lt;form action="index.php?action=buy_crates" method="post"&gt;
              &lt;h1&gt;BUY CARGO CRATES&lt;/h1&gt;
              &lt;p&gt;TYPE&lt;/p&gt;
              &lt;div class="selection-list"&gt;
                &lt;?php
                  $pdo = pdo();
                  foreach($pdo-&gt;query("SELECT * FROM crate_types") as $row){
                    echo '&lt;div class="button toggle"&gt;' . strtoupper($row['name']) . '&lt;/div&gt;';
                  }
                ?&gt;
                &lt;input class="hidden" name="type" type="text" required&gt;
              &lt;/div&gt;
              &lt;p&gt;QUANTITY&lt;/p&gt;
              &lt;div class="selection-list"&gt;
  
                &lt;?php
                  $pdo = pdo();
                  $username = $_SESSION['username'];
  
                  $statement = $pdo-&gt;prepare("SELECT SUM(slots) FROM warehouses INNER JOIN warehouse_contracts ON warehouses.id=warehouse_contracts.warehouse_id WHERE username LIKE '$username'");
                  $statement-&gt;execute();
                  $slots = $statement-&gt;fetch();
  
                  $statement = $pdo-&gt;prepare("SELECT SUM(quantity) FROM storage WHERE username LIKE ?");
                  $statement-&gt;bindParam(1, $username);
                  $statement-&gt;execute();
                  $crates = $statement-&gt;fetch();
  
                  $statement = $pdo-&gt;prepare("SELECT * FROM transport_upgrades WHERE username LIKE ? AND type LIKE 'storage'");
                  $statement-&gt;bindParam(1, $username);
                  $statement-&gt;execute();
                  $storage_upgrades = $statement-&gt;rowCount() + 1;
  
                  $available_slots = $slots['SUM(slots)'] - $crates['SUM(quantity)'];
  
                  if($available_slots &gt;= 1 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 1 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 1 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &gt;= 2 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 2 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 2 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &gt;= 4 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 4 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 4 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &gt;= 8 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 8 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 8 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &gt;= 16 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 16 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 16 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &gt;= 32 * pow(2, $storage_upgrades)){
                    echo '&lt;div class="button toggle"&gt;' . 32 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
                  else{
                    echo '&lt;div class="disabled"&gt;' . 32 * pow(2, $storage_upgrades) . '&lt;/div&gt;';
                  }
  
                  if($available_slots &lt; 1 * pow(2, $storage_upgrades)){
                    echo '
                      &lt;input class="hidden" name="quantity" type="text" required&gt;
                    &lt;/div&gt;
                    &lt;p&gt;RISK:&lt;span class="right-text" id="delivery-risk"&gt;0%&lt;/span&gt;&lt;/p&gt;
                    &lt;p&gt;PROFIT MARGIN:&lt;span class="right-text" id="delivery-profit"&gt;0%&lt;/span&gt;&lt;/p&gt;
                    &lt;p&gt;PRICE:&lt;span class="right-text" id="delivery-price"&gt;$0&lt;/span&gt;&lt;/p&gt;
                    &lt;input class="submit-button disabled" type="submit" value="BUY"&gt;
                  ';
                  }
                  else{
                    echo '
                      &lt;input class="hidden" name="quantity" type="text" required&gt;
                    &lt;/div&gt;
                    &lt;p&gt;RISK:&lt;span class="right-text" id="delivery-risk"&gt;0%&lt;/span&gt;&lt;/p&gt;
                    &lt;p&gt;PROFIT MARGIN:&lt;span class="right-text" id="delivery-profit"&gt;0%&lt;/span&gt;&lt;/p&gt;
                    &lt;p&gt;PRICE:&lt;span class="right-text" id="delivery-price"&gt;$0&lt;/span&gt;&lt;/p&gt;
                    &lt;input class="submit-button" type="submit" value="BUY"&gt;
                  ';
                  }
                ?&gt;
  
  
            &lt;/form&gt;
          &lt;/div&gt;
  
          &lt;div class="dialog" id="sell-stock-dialog"&gt;
            &lt;div class="close-button"&gt;x&lt;/div&gt;
            &lt;?php
              $pdo = pdo();
              $statement = $pdo-&gt;prepare("SELECT SUM((price*((profit/100)+1))*quantity), SUM(price*quantity), SUM(quantity), AVG(profit) FROM storage INNER JOIN crate_types ON storage.crate_type_id=crate_types.id WHERE username LIKE ?");
              $statement-&gt;bindParam(1, $username);
              $statement-&gt;execute();
              $rows = $statement-&gt;fetch();
              $quantity = $rows['SUM(quantity)'];
              $value = round($rows['SUM((price*((profit/100)+1))*quantity)'], 0);
              $original_cost = round($rows['SUM(price*quantity)'], 0);
              $profit_margin = round($rows['AVG(profit)'], 0);
  
              echo '
                  &lt;h1&gt;SELL CARGO CRATES&lt;/h1&gt;
                  &lt;p&gt;CRATES: &lt;span class="right-text"&gt;' . $quantity . '&lt;/span&gt;&lt;/p&gt;
                  &lt;p&gt;RISK: &lt;span class="right-text"&gt;&lt;/span&gt;&lt;/p&gt;
                  &lt;p&gt;PROFIT MARGIN: &lt;span class="right-text"&gt;' . $profit_margin . '%&lt;/span&gt;&lt;/p&gt;
                  &lt;p&gt;ORIGINAL COST: &lt;span class="right-text"&gt;$' . number_format($original_cost) .'&lt;/span&gt;&lt;/p&gt;
                  &lt;p&gt;PROFIT: &lt;span class="right-text"&gt;$' . number_format($value - $original_cost) . '&lt;/span&gt;&lt;/p&gt;
                  &lt;p&gt;TOTAL VALUE: &lt;span class="right-text"&gt;$' . number_format($value) .'&lt;/span&gt;&lt;/p&gt;
                  &lt;a href="index.php?action=sell_crates"&gt;&lt;div class="submit-button"&gt;SELL&lt;/div&gt;&lt;/a&gt;
              ';
            ?&gt;
          &lt;/div&gt;
  
          &lt;?php
            $pdo = pdo();
            $username = $_SESSION['username'];
            $statement = $pdo-&gt;prepare("SELECT * FROM shipments WHERE username LIKE '$username' AND status LIKE 'active' LIMIT 1");
            $statement-&gt;execute();
            $row_count = $statement-&gt;rowCount();
            $row1 = $statement-&gt;fetch();
  
            $statement = $pdo-&gt;prepare("SELECT * FROM shipments INNER JOIN crate_types ON shipments.crate_type_id=crate_types.id WHERE username LIKE '$username' AND status LIKE 'active' LIMIT 1");
            $statement-&gt;execute();
            $row2 = $statement-&gt;fetch();
  
            if($row_count &gt; 0){
              echo '&lt;div id="active-shipment"&gt;';
              if($row1['type'] === "purchase"){
                echo '
                  &lt;h1 id="countdown"&gt;&lt;/h1&gt;
                  &lt;p&gt;Incoming shipment of ' . $row2['quantity'] . ' crates of ' . $row2['name'] . '&lt;/p&gt;
                ';
              }
              else if($row1['type'] === "sale"){
                echo '
                  &lt;h1 id="countdown"&gt;&lt;/h1&gt;
                  &lt;p&gt;Outgoing shipment of ' . $row1['quantity'] . ' crates with a value of $' . number_format($row1['value']) . '&lt;/p&gt;
                ';
              }
              echo '
                &lt;/div&gt;
                &lt;script type="text/javascript"&gt;
                    $("#countdown").countdown("' . $row1['arrival'] . '", function(event) {
                      var arrival = {
                        days: event.strftime("%D"),
                        hours: event.strftime("%H"),
                        minutes: event.strftime("%M"),
                        seconds: event.strftime("%Ss")
                      };
  
                      if(arrival.days &lt;= 0){
                        arrival.days = "";
                      }
                      else{
                        arrival.days += "d";
                      }
  
                      if(arrival.hours &lt;= 0){
                        arrival.hours = "";
                      }
                      else{
                        arrival.hours += "h";
                      }
  
                      if(arrival.minutes &lt;= 0){
                        arrival.minutes = "";
                      }
                      else{
                        arrival.minutes += "m";
                      }
  
                        $(this).text(arrival.days + " " + arrival.hours + " " + arrival.minutes + " " + arrival.seconds);
  
                      if(new Date("' . $row1['arrival'] . '") &lt;= new Date()){
                        window.location.replace("index.php");
                      }
                      });
  
                    $("title").countdown("' . $row1['arrival'] . '", function(event){
                      var arrival = {
                        days: event.strftime("%D"),
                        hours: event.strftime("%H"),
                        minutes: event.strftime("%M"),
                        seconds: event.strftime("%Ss")
                      };
  
                      if(arrival.days &lt;= 0){
                        arrival.days = "";
                      }
                      else{
                        arrival.days += "d";
                      }
  
                      if(arrival.hours &lt;= 0){
                        arrival.hours = "";
                      }
                      else{
                        arrival.hours += "h";
                      }
  
                      if(arrival.minutes &lt;= 0){
                        arrival.minutes = "";
                      }
                      else{
                        arrival.minutes += "m";
                      }
  
                      $(this).text(arrival.days + " " + arrival.hours + " " + arrival.minutes + " " + arrival.seconds + " - CEO Panel");
                      });
                &lt;/script&gt;
              ';
            }
          ?&gt;
  
          &lt;div class="dialog" id="upgrades-dialog"&gt;
            &lt;div class="close-button"&gt;x&lt;/div&gt;
            &lt;h1&gt;UPGRADES&lt;/h1&gt;
  
            &lt;p&gt;TRANSPORT TRUCKS&lt;/p&gt;
            &lt;p style="font-size: 16px;"&gt;These trucks are used for &lt;strong&gt;purchases&lt;/strong&gt;.&lt;/p&gt;
            &lt;?php
              $upgrade_cost = calculate_upgrade_cost("trucks", "speed");
  
              $pdo = pdo();
              $statement = $pdo-&gt;prepare("SELECT cash FROM users WHERE username LIKE ?");
              $statement-&gt;bindParam(1, $_SESSION['username']);
              $statement-&gt;execute();
              $user = $statement-&gt;fetch();
  
              $statement = $pdo-&gt;prepare("SELECT * FROM transport_upgrades WHERE vehicle LIKE 'trucks' AND username LIKE ? AND type LIKE 'speed'");
              $statement-&gt;bindParam(1, $username);
              $statement-&gt;execute();
              $previous_upgrades = $statement-&gt;rowCount();
  
              $crate_delivery_time = explode('.', 1 * (3 * (1 - ($previous_upgrades * 0.03))));
  
              if(strpos((string)$crate_delivery_time[0], "-") !== false){
                $crate_delivery_time[0] = 0;
                $crate_delivery_time[1] = 0;
              }
  
              if(($crate_delivery_time[0] &lt;= 0 &amp;&amp; $crate_delivery_time[1] &lt;= 0) || $crate_delivery_time[0] &lt; 0){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;div class="upgrade-button-disabled"&gt;UPGRADE&lt;/div&gt;
                    &lt;div class="upgrade-cost"&gt;Limit for upgrades reached.&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
              else if($user['cash'] &lt; $upgrade_cost){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;div class="upgrade-button-disabled"&gt;UPGRADE&lt;/div&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text red-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
              else if($user['cash'] &gt;= $upgrade_cost){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;a href="index.php?action=upgrade&amp;vehicle=trucks&amp;type=speed"&gt;&lt;div class="upgrade-button"&gt;UPGRADE&lt;/div&gt;&lt;/a&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
  
              $upgrade_cost = calculate_upgrade_cost("trucks", "storage");
  
              $statement = $pdo-&gt;prepare("SELECT cash FROM users WHERE username LIKE ?");
              $statement-&gt;bindParam(1, $_SESSION['username']);
              $statement-&gt;execute();
              $user = $statement-&gt;fetch();
  
              if($user['cash'] &gt;= $upgrade_cost){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;STORAGE&lt;/p&gt;&lt;a href="index.php?action=upgrade&amp;vehicle=trucks&amp;type=storage"&gt;&lt;div class="upgrade-button"&gt;UPGRADE&lt;/div&gt;&lt;/a&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
              else{
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;STORAGE&lt;/p&gt;&lt;div class="upgrade-button-disabled"&gt;UPGRADE&lt;/div&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text red-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
            ?&gt;
            &lt;!--
            &lt;div class="upgrade"&gt;
              &lt;p&gt;STORAGE&lt;/p&gt;&lt;a href="index.php?action=upgrade&amp;vehicle=trucks&amp;type=storage"&gt;&lt;div class="upgrade-button"&gt;UPGRADE&lt;/div&gt;&lt;/a&gt;
            &lt;/div&gt;
            --&gt;
  
            &lt;br&gt;
            &lt;p&gt;TRANSPORT PLANES&lt;/p&gt;
            &lt;p style="font-size: 16px;"&gt;These planes are used for &lt;strong&gt;sales&lt;/strong&gt;.&lt;/p&gt;
            &lt;?php
              $upgrade_cost = calculate_upgrade_cost("planes", "speed");
  
              $pdo = pdo();
              $statement = $pdo-&gt;prepare("SELECT cash FROM users WHERE username LIKE ?");
              $statement-&gt;bindParam(1, $_SESSION['username']);
              $statement-&gt;execute();
              $user = $statement-&gt;fetch();
  
              $statement = $pdo-&gt;prepare("SELECT * FROM transport_upgrades WHERE vehicle LIKE 'planes' AND username LIKE ? AND type LIKE 'speed'");
              $statement-&gt;bindParam(1, $username);
              $statement-&gt;execute();
              $previous_upgrades = $statement-&gt;rowCount();
  
              $crate_delivery_time = explode('.', 1 * (3 * (1 - ($previous_upgrades * 0.03))));
  
              if(strpos((string)$crate_delivery_time[0], "-") !== false){
                $crate_delivery_time[0] = 0;
                $crate_delivery_time[1] = 0;
              }
  
              if(($crate_delivery_time[0] &lt;= 0 &amp;&amp; $crate_delivery_time[1] &lt;= 0) || $crate_delivery_time[0] &lt; 0){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;div class="upgrade-button-disabled"&gt;UPGRADE&lt;/div&gt;
                    &lt;div class="upgrade-cost"&gt;Limit for upgrades reached.&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
              else if($user['cash'] &lt; $upgrade_cost){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;div class="upgrade-button-disabled"&gt;UPGRADE&lt;/div&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text red-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
              else if($user['cash'] &gt;= $upgrade_cost){
                echo '
                  &lt;div class="upgrade"&gt;
                    &lt;p&gt;SPEED&lt;/p&gt;&lt;a href="index.php?action=upgrade&amp;vehicle=planes&amp;type=speed"&gt;&lt;div class="upgrade-button"&gt;UPGRADE&lt;/div&gt;&lt;/a&gt;
                    &lt;div class="upgrade-cost"&gt;COST &lt;span class="right-text"&gt;$' . number_format($upgrade_cost) . '&lt;/span&gt;&lt;/div&gt;
                  &lt;/div&gt;
                ';
              }
            ?&gt;
          &lt;/div&gt;
  
          &lt;div id="warehouse-space"&gt;
            &lt;div id="used-space"&gt;&lt;/div&gt;
            &lt;p&gt;Used warehouse space:
              &lt;?php
                $pdo = pdo();
                $username = $_SESSION['username'];
                $statement = $pdo-&gt;prepare("SELECT SUM(slots) FROM warehouses INNER JOIN warehouse_contracts ON warehouses.id=warehouse_contracts.warehouse_id WHERE username LIKE '$username'");
                $statement-&gt;execute();
                $row = $statement-&gt;fetch();
                $slots = $row['SUM(slots)'];
  
                $statement = $pdo-&gt;prepare("SELECT SUM(quantity) FROM storage WHERE username LIKE '$username'");
                $statement-&gt;execute();
                $row = $statement-&gt;fetch();
                $crates = $row['SUM(quantity)'];
  
                if($crates === 0 || !isset($crates)){
                  $crates = 0;
                }
  
                $percentage_used = round(($crates/$slots)*100, 1);
  
                echo $crates . '/' . $slots . ' (' . $percentage_used . '%)';
              ?&gt;
            &lt;/p&gt;
              &lt;?php
                echo '
                  &lt;script&gt;
                    $("#used-space").css("width", ' . $percentage_used . ' + "%");
                  &lt;/script&gt;
                ';
              ?&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div id="summary"&gt;&lt;/div&gt;
  
        &lt;?php
          if(isset($_SESSION['random_event']) &amp;&amp; $_SESSION['random_event']['recent'] === true){
            $robbers = array(
              "Hell's Angels",
              "The Lost",
              "some asian streetpunks",
              "a pair of irish virgins",
              "the russian mob",
              "some methheads",
              "a korean crew"
            );
  
            if($_SESSION['random_event']['shipment_type'] === "purchase"){
              echo '
                &lt;div class="alert-background"&gt;&lt;/div&gt;
                &lt;div class="alert"&gt;
                  &lt;img class="companion-speech" src="res/companion-speeches/random-event.png"&gt;
                  &lt;h1&gt;Oh no!&lt;/h1&gt;
                  &lt;p&gt;Boss, I\'ve got some bad news. Your recent shipment of &lt;strong&gt;' . $_SESSION['random_event']['ordered_quantity'] . '&lt;/strong&gt; crates was hijacked during transport by ' . $robbers[rand(0, count($robbers) - 1)] . '. They managed to get away with &lt;strong&gt;' . $_SESSION['random_event']['random_event_penalty'] . '&lt;/strong&gt; crates. Though, your crew did kill &lt;strong&gt;' . rand(1, 20) . '&lt;/strong&gt; of them before they took off with the product.&lt;/p&gt;
                  &lt;div class="ok-button"&gt;OK&lt;/div&gt;
                &lt;/div&gt;
              ';
            }
            unset($_SESSION['random_event']);
          }
        ?&gt;
      &lt;/main&gt;
      &lt;div id="loading"&gt;
        &lt;p&gt;Loading, please wait..&lt;/p&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>