Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="ajax.js"> </script>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <style>
- tbody:nth-child(odd){border:solid steelblue 1px;}
- table{background-color:gold;display:inline-block;}
- tr:nth-child(odd){background-color:steelblue;}
- .sortable tr:nth-child(even){background-color:red;}
- table{margin-left:5px;}
- td{color:black;padding:2px;height:25%;max-height:15px;}
- .input{max-width:99px;}
- #description{width:300px;}
- #sidebar{display:inline-block;float:left;}
- button{height:24px;width:145px;}
- #addshop{margin-left:5px;width:154px;height:30px;background-color:steelblue;color:black;box-shadow:inset 1px 0px 5px #000000;text-align:center;border-radius:5px;text-shadow:0px 1px .5px rgba(204, 204, 204, .46);font: 25.3333px Arial;cursor:default;}
- #addshop:hover{background-color:gold;transition:all .1s;}
- #addshop:hover:active{background-color:gold;transition:all .1s;box-shadow:1px 0px 5px #000000;}
- #content{margin-left:5px;}
- </style>
- <script>
- function addItem(){};
- function addShop(sname){
- var shops = document.getElementByID("buttonbar").innerHTML;
- var newshop = shops + "<tr><td><button>"+sname+"</button></td></tr>";
- };
- </script>
- </head>
- <body>
- <div id="sidebar">
- <table>
- <div id="buttonbar">
- <tr><td><button onclick="updateTable('football')">Italian Sausage</button></td></tr>
- <tr><td><button onclick="updateTable('soccer')">Backyard Barbeque</button></td></tr>
- <tr><td><button onclick="updateTable('concert')">Champion Bar & Grill</button></td></tr>
- <tr><td><button onclick="updateTable('event')">Market Fresh Deli</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Smokehouse Grill</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Stadium Pizza</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Tailgate Grill</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Tenders & Wings</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Berkshire Sausage</button></td></tr>
- <tr><td><button onclick="updateTable('football')">East Boards</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Center Boards</button></td></tr>
- <tr><td><button onclick="updateTable('football')">West Boards</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Pavilion</button></td></tr>
- <tr><td><button onclick="updateTable('football')">Optum</button></td></tr>
- </div>
- </table>
- <div id="addshop">
- ADD NEW
- </div>
- <div id="debugbox" style="float:left;"></div>
- </div>
- <?php
- function pickTable($n){
- $name = $n;
- return $name;
- }
- $servername = "localhost";
- $username = "warp";
- $password = "morowind1";
- $dbname = "gillette";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "";
- $table = "football";
- $standType = "1";
- echo "<div id='content' style='display:inline-block;margin-left:5px;'>content placeholder";
- $sql = "SELECT id, name, description, price, item_type, stand_type FROM ". $table . " WHERE stand_type > 0";
- $result = $conn->query($sql);
- echo "<script src='ajax.js'> </script>";
- if ($result->num_rows > 0) {
- // output data of each row
- echo "<form><table id='tableData'>";
- $i = 0;
- while($row = $result->fetch_assoc()) {
- $i = $i+1;
- $description = str_replace("'", "'", $row["description"]);
- $name = str_replace("'", "'", $row["name"]);
- echo " <tr id='row".$i."'><td id='itemid'>". $i. " </td>
- <td>Name: <input class='input' id='iname".$i."' type='text' name='iname' value='". $name. "'></input> </td>
- <td>-Price: <input class='input' id='price".$i."' type='text' name='price' value='" . $row["price"] . "'></input> </td>
- <td>-Description: <input class='input' id='description".$i."' type='text' name='description' value='" . $description . "'></input></td>
- <td>-type: <input class='input' id='type".$i."' type='text' name='type' value='" . $row["item_type"] . "'></input></td>
- <td>-stand: <input class='input' id='stand".$i."' type='text' name='stand' value='" . $row["stand_type"] . "'></input></td><td><input type='button' value='delete' onclick='delRow()'></td></tr>";
- }
- echo "</table></div><br><input style='margin-left:5px;' type='button' onclick='acceptFunction()' value='submit'><input style='margin-left:5px;' type='button' value='add' onclick='newRow()'></form>";
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement