Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: PHP  |  size: 2.01 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php session_start(); ?>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  4. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  6.  
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  9.  
  10. <title>View Appointment Request</title>
  11. <link href="css2.css" type="text/css" rel="stylesheet"/>
  12.  
  13. </head>
  14.  
  15. <body>
  16. <div id= "content">
  17. <div id="header">
  18. <div id="txtright">    
  19. <?php
  20. echo "You are logged in as:STAFF" . "\n";
  21. echo '<a href="logout.php">Log out</a>';
  22. ?>
  23. </div>
  24. <h1>&nbsp;Beauty Shop</h1>
  25. </div>
  26.  
  27. <div id="navBar">
  28. <ul>
  29. <li><a href="staffhome.php">Home</a></li>
  30. <li><a href="staffaddcustomer.php">Add Customer</a></li>
  31. <li><a href="viewrequest.php">View Customer Requests</a></li>
  32. </ul>
  33. </div>
  34.  
  35. <div id="main">
  36. <div id="breadcrumb">
  37. <p>    
  38. <a href="staffhome.php">Home</a>>
  39. <a href="viewrequest.php">View Appointment Requests</a>
  40. </p>
  41. </div>
  42.  
  43. <div id="center">
  44. <h1>View Appointment Requests</h1>
  45.  
  46. <div id="txtright">
  47. <a href="calendar2.php"> View Calendar</a>
  48. </div> 
  49.  
  50. <br/>  
  51. <br/>
  52.  
  53. <?php
  54. $conn=pg_connect("host=db.dcs.aber.ac.uk dbname=cs39930_11_12
  55. user=sis9 password=dollar20");
  56.  
  57. if (!$conn)
  58. {
  59. die ('Could not connect: ' . pg_error());
  60. }
  61.  
  62. $res = pg_query($conn, "SELECT * FROM request");
  63.  
  64. echo "<table border='1'>
  65.  
  66. <tr>
  67. <th>RequestID</th>
  68. <th>Treatment</th>
  69. <th>Date</th>
  70. <th>Time </th>
  71. <th>Name</th>
  72. <th>Email Address</th>
  73. <th>Contact Number</th>
  74. <th>Contact Date</th>
  75. <th>Contact Time</th>
  76. </tr>";
  77.  
  78. while($a = pg_fetch_row($res))
  79. {
  80. echo "<tr>";
  81. $j=0;
  82. while($j<(pg_num_fields($res)))
  83. {
  84. echo "<td>" . $a[$j] . "</td>";
  85. $j++;
  86. }
  87. $value=$a[$j];
  88. $id = $a[0];
  89. echo "<td><a href=\"delete.php/?requestid=$id\">Delete</a></td>";
  90.  
  91. }
  92. echo "</table>";
  93. echo "</form>";
  94. pg_close($conn);
  95. ?>
  96. </div>
  97.  
  98. <br/>
  99. <hr/>
  100.  
  101. <div id="footer">
  102. <h3>Date last modified </h3>
  103. <?php
  104. echo "Last modified: " . date ("F d Y H:i:s.", getlastmod());
  105. ?>
  106. <br/>
  107. </div>
  108. </div>
  109.  
  110. </div>
  111. </body>
  112. </html>