Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML. 1.0 Strict//EN" "http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <meta http-equiv="content-type"
- <content="text/html; charset=iso-8859-1" />
- <link rel="stylesheet" type="text/css" href="bootstrap-3.3.6-dist/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="bootstrap-social-gh-pages/assets/css/font-awesome.css">
- <link rel="stylesheet" type="text/css" href="MyCSS.css">
- </head>
- <body>
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="col-sm-12">
- <div class="jumbotron">
- <h1 align="center">Products</h1>
- <p align="center">We the best products around Christiansburg, Va!</p>
- <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
- </div>
- </div>
- </div>
- </div>
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="col-sm-12">
- <ul class="nav nav-tabs">
- <li class="active"><a href="index.php">Home</a></li>
- <li><a href="productsPage.php">Products</a></li>
- <li><a href="#">Cart</a></li>
- </ul>
- </nav>
- </div>
- </div>
- </div>
- <!--body content-->
- <div class="col-sm-12">
- <!--create the table in php-->
- <?php
- include('connectDB.php');
- $TableName = "products";
- $Products = array();
- $sql =" SELECT ProductName, Cost, ProductDescription FROM $TableName";
- $result = $conn->query($sql);
- if ($result->num_rows > 0)
- {
- while($Row = $result->fetch_assoc())
- $Products[] = $Row;
- }
- echo "<table border='1' width='100%'>\n";
- echo "<tr>\n";
- echo "<th style='background-color:grey'>Product Image</th>\n";
- echo "<th style='background-color:grey'>Product Name</th>\n";
- echo "<th style='background-color:grey'>ProductID</th>\n";
- echo "<th style='background-color:grey'>Product Description</th>\n";
- echo "<th style='background-color:grey'>Quantity On_Hand</th>\n";
- echo "<tr>\n";
- foreach ($Products as $Products) {
- if(!in_array($Products['products'])) {
- echo "<tr>\n";
- echo "<td>" .htmlentities($Opportunity['ProductName']). "</td>\n";
- echo "<td>" .htmlentities($Opportunity['ProductID']). "</td>\n";
- echo "<td>" .htmlentities($Opportunity['Cost']). "</td>\n";
- echo "<td>" .htmlentities($Opportunity['ProductDescription']). "</td>\n";
- echo "<td>" .htmlentities($Opportunity['QuantityOn_Hand']). "</td>\n";
- }
- echo "</table>";
- }
- $conn->close();
- ?>
- </div>
- <!--end body content-->
- </div>
- </div>
- <script src="jquery-1.10.2.min.js"></script>
- <script src="bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement