コード例 #1
0
$query = "SELECT SK.id, SK.board_name, SK.board_img_url, \n            DT.deck_name, DT.length, DT.description, DI.color as deckColor, \n            DB.deck_brand_name, DB.deck_brand_img_url,\n            TT.truck_name, TT.width, TB.truck_brand_name, TB.truck_brand_img_url,\n            WT.wheel_name, WT.diameter, WT.durometer, WI.color as wheelColor,\n            WB.wheel_brand_name, WB.wheel_brand_img_url\n    from sk8_skateboards SK\n    inner join sk8_deck_inv DI on SK.fk_deck_id = DI.id\n    inner join sk8_deck_type DT on DI.fk_deck_id = DT.id\n    inner join sk8_truck_inv TI on SK.fk_truck_id = TI.id\n    inner join sk8_truck_type TT on TI.fk_truck_id = TT.id\n    inner join sk8_wheel_inv WI on SK.fk_wheel_id = WI.id\n    inner join sk8_wheel_type WT on WI.fk_wheel_id = WT.id\n    inner join (select WT.id, B.brand_name as wheel_brand_name, B.brand_img_url as wheel_brand_img_url from sk8_brand B\n    inner join sk8_wheel_type WT on WT.fk_brand_id = B.id) WB on WT.id = WB.id\n    inner join (select TT.id, B.brand_name as truck_brand_name, B.brand_img_url as truck_brand_img_url from sk8_brand B\n    inner join sk8_truck_type TT on TT.fk_brand_id = B.id) TB on TT.id = TB.id\n    inner join (select DT.id, B.brand_name as deck_brand_name, B.brand_img_url as deck_brand_img_url from sk8_brand B\n    inner join sk8_deck_type DT on DT.fk_brand_id = B.id) DB on DT.id = DB.id;";
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
    $id = $row['id'];
    $row['id'] = -1;
    $row['fkid'] = -1;
    echo "<a name=\"{$id}\"> </a>";
    echo "<div class=\"panel panel-default\">";
    echo "<div class=\"panel-heading\">{$row['board_name']}";
    echo " <span class=\"inventorycontrols\" >\n\n      <form action=\"updateimg.php\" method=\"post\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Change Image\">\n      <input type=\"hidden\" name=\"id\" value=\"{$id}\"></input>\n      <input type=\"hidden\" name=\"table\" value=\"skateboards\"></input>\n      <button type=\"submit\">\n        <span class=\"glyphicon glyphicon-pencil\" > </span>\n        </button>\n      </form> \n      \n      <form action=\"disasmble.php\" method=\"post\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Disasemble Skateboard\">\n      <input type=\"hidden\" name=\"id\" value=\"{$id}\"></input>\n      <button type=\"submit\">\n        <span class=\"glyphicon glyphicon-wrench\" > </span>\n        </button>\n      </form>\n\n    </span>";
    echo "</div> <!-- heading -->";
    echo "<div class=\"panel-body\">";
    echo "<img class=\"boardimage\" src=\"{$row['board_img_url']}\"></img>";
    echo "<div class=\"container-fluid\"> <div class=\"row\">";
    echo "<div class=\"col-md-4\">";
    makeDeckInv($row, 'skateboardPanel');
    echo "</div>";
    #col
    echo "<div class=\"col-md-4\">";
    makeTruckInv($row, 'skateboardPanel');
    echo "</div>";
    #col
    echo "<div class=\"col-md-4\">";
    makeWheelInv($row, 'skateboardPanel');
    echo "</div>";
    #col
    echo "</div></div>";
    #fluid #Row
    echo "</div>";
    #body
    ## panel footer, for rider display and controls
コード例 #2
0




<div class="container-fluid">
  <div class="row" id="inventory_container">
    <div class="col-md-4">
      <h3 class="inventory_heading">Decks</h3>


<?php 
#generate decks
$result = $mysqli->query($deckQuery);
while ($row = $result->fetch_assoc()) {
    makeDeckInv($row, 'buildPanel deckbuild');
}
?>
</div>
<div class="container-fluid">
  <div class="row" id="inventory_container">
    <div class="col-md-4">
      <h3 class="inventory_heading">Trucks</h3>

<?php 
#generate trucks
$result = $mysqli->query($truckQuery);
while ($row = $result->fetch_assoc()) {
    makeTruckInv($row, 'buildPanel truckbuild');
}
?>
コード例 #3
0
      <div class="form-group">
        <label>Color:</label>
        <input type="text" class="form-control" name="color">
      </div><br>
      <input type="hidden" name="table" value="deck">
      <button type="submit" class="btn btn-default"> <span class="glyphicon glyphicon-plus"></span> Add Deck</button>
    </form>
  </div>
</div>

<?php 
#generate decks
$query = "SELECT D.id, D.color as deckColor, DT.deck_name, DT.length, DT.description, B.brand_name as deck_brand_name, B.brand_img_url as deck_brand_img_url, D.fk_deck_id as fkid FROM sk8_deck_inv D\n  INNER JOIN sk8_deck_type DT on D.fk_deck_id = DT.id \n  INNER JOIN sk8_brand B on DT.fk_brand_id = B.id";
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
    makeDeckInv($row, 'inventoryPanel');
}
?>
</div>
<div class="container-fluid">
  <div class="row" id="inventory_container">
    <div class="col-md-4">
      <h3 class="inventory_heading">Trucks</h3>
<!--create new truck-->
<div class="panel panel-default addPanel">
  <div class="panel-heading" onclick="toggleinputs('truck')">Add New Trucks
  <div id="truckleft"><span class="glyphicon glyphicon-chevron-left"></span></div>
  <div hidden id="truckdown"><span class="glyphicon glyphicon-chevron-down"></span></div>
  </div>
  <div class="panel-body" hidden id="truckform">
    <form class="form-inline" action="addinv.php" method="POST">