Guest User

Untitled

a guest
Apr 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. <?php
  2. require_once('homePageFunctions.php');
  3. echo makeHeader("Northumbria Book Company (NBC)", "index.css", "
  4. Northumbria Book Company");
  5. echo makeMenu(array("index.php" => "Home", "display.php" => "Display All Books", "search.php" => "Search", "admin.php" => "Administrator", "credits.php" => "Credits"));
  6. echo startMainContent();
  7. ?>
  8. <h2>Search Page</h2>
  9. <!-- Creates the form for the add page -->
  10. <form action="searchISBN.php" method="get">
  11. <p> Search by Book ISBN</p>
  12. <div>Book ISBN: <input type="number" name="bookISBN" /></div>
  13. <input type="submit" name="submit" value="Search"/>
  14. </form>
  15.  
  16. <form action="searchREST.php" method="get">
  17. <p>Search Using These Instead</p>
  18. <div>Book Title: <input type="text" name="bookTitle" /></div>
  19. <div>Book Year: <input type="text" name="bookYear" /></div>
  20. <div>Publisher Name:
  21. <select name="pubID"> <!-- Dynamically creates a select list using the data from the database. -->
  22. <?php
  23. include 'database_conn.php';
  24. $sql ='select distinct nbc_book.pubID, pubName
  25. from nbc_book
  26. inner join nbc_publisher
  27. on nbc_book.pubID = nbc_publisher.pubID';
  28. $queryresult = mysql_query($sql) or die (mysql_error());
  29. while ($row = mysql_fetch_assoc($queryresult))
  30. {
  31. $PubID = $row['pubID'];
  32. $PubName = $row['pubName'];
  33. echo "<option value=\"$PubID\"> $PubName </option>\n";
  34. }
  35. ?>
  36. </select>
  37. </div>
  38. <div>Category Desc:
  39. <select name="catID"> <!-- Dynamically creates a select list using the data from the database. -->
  40. <?php
  41. include 'database_conn.php';
  42. $sql = 'select distinct nbc_book.catID, catDesc
  43. from nbc_book
  44. inner join nbc_category
  45. on nbc_book.catID = nbc_category.catID';
  46. $queryresult = mysql_query($sql) or die (mysql_error());
  47. while ($row = mysql_fetch_assoc($queryresult))
  48. {
  49. $CatID = $row['catID'];
  50. $CatDesc = $row['catDesc'];
  51. echo "<option value=\"$CatID\"> $CatDesc </option>\n";
  52. }
  53. ?>
  54. </select>
  55. </div>
  56. <div class ="price">
  57. <ul class="checkbox">
  58. Book Price: <input type="text" name="bookPrice" />
  59. <input type="radio" name="bookPriceRadio" value="under">Under
  60. <input type="radio" name="bookPriceRadio" value="exact">Exactly
  61. <input type="radio" name="bookPriceRadio" value="over">Over
  62. </ul>
  63. </div>
  64. <input type="submit" name="submit" value="Search"/>
  65. </form>
  66. <?php
  67. echo endMain();
  68. echo makeFooter("Copyright 2009");
  69. ?>
Add Comment
Please, Sign In to add comment