Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <?php
  2. require_once("database.php");
  3.  
  4. $query = 'SELECT * FROM categories
  5. ORDER BY categoryID';
  6. $statement1= $db->prepare($query);
  7. $statement1->execute();
  8. $categories = $statement1->fetchAll();
  9. $statement1->closecursor();
  10. ?>
  11.  
  12. <!DOCTYPE html>
  13. <!--
  14. To change this license header, choose License Headers in Project Properties.
  15. To change this template file, choose Tools | Templates
  16. and open the template in the editor.
  17. -->
  18.  
  19. <html>
  20. <head>
  21. <title>My Guitar Shop :: Add Product Page</title>
  22. <link href="../css/webPageStyle.css" rel="stylesheet" type="text/css"/>
  23. <meta charset="UTF-8">
  24. <title></title>
  25. </head>
  26. <body>
  27. <header><h1>Product Manager</h1></header>
  28.  
  29. <section>
  30. <form action="add_product.php" method ="post" id="add_product_form">
  31. <label>Category</label>
  32. <select name="category_id">
  33. <?php foreach ($categories as $category): ?>
  34. <option value="<?php echo $category['categoryID']; ?> ">
  35. <?php echo $category['categoryName']; ?>
  36. </option>
  37. <?php endforeach; ?>
  38. </select>
  39. <br/>
  40.  
  41. <label>Code</label>
  42. <input type="text" name="code">
  43. <br/>
  44.  
  45. <label>Name</label>
  46. <input type="text" name="name">
  47. <br/>
  48.  
  49. <label>List Price</label>
  50. <input type="text" name="price">
  51. <label>
  52. <input type ="submit" value="Add Product">
  53. </label>
  54. <br/>
  55. </form>
  56. <a href="../index.php">View Product List</a>
  57. </section>
  58. </main>
  59. <footer>
  60. <p>&copy; <?php echo date("y"); ?>My Guitar Shop, Inc.</p>
  61. </footer>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement