
Untitled
By: a guest on
Apr 17th, 2012 | syntax:
PHP | size: 2.01 KB | hits: 18 | expires: Never
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>View Appointment Request</title>
<link href="css2.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div id= "content">
<div id="header">
<div id="txtright">
<?php
echo "You are logged in as:STAFF" . "\n";
echo '<a href="logout.php">Log out</a>';
?>
</div>
<h1> Beauty Shop</h1>
</div>
<div id="navBar">
<ul>
<li><a href="staffhome.php">Home</a></li>
<li><a href="staffaddcustomer.php">Add Customer</a></li>
<li><a href="viewrequest.php">View Customer Requests</a></li>
</ul>
</div>
<div id="main">
<div id="breadcrumb">
<p>
<a href="staffhome.php">Home</a>>
<a href="viewrequest.php">View Appointment Requests</a>
</p>
</div>
<div id="center">
<h1>View Appointment Requests</h1>
<div id="txtright">
<a href="calendar2.php"> View Calendar</a>
</div>
<br/>
<br/>
<?php
$conn=pg_connect("host=db.dcs.aber.ac.uk dbname=cs39930_11_12
user=sis9 password=dollar20");
if (!$conn)
{
die ('Could not connect: ' . pg_error());
}
$res = pg_query($conn, "SELECT * FROM request");
echo "<table border='1'>
<tr>
<th>RequestID</th>
<th>Treatment</th>
<th>Date</th>
<th>Time </th>
<th>Name</th>
<th>Email Address</th>
<th>Contact Number</th>
<th>Contact Date</th>
<th>Contact Time</th>
</tr>";
while($a = pg_fetch_row($res))
{
echo "<tr>";
$j=0;
while($j<(pg_num_fields($res)))
{
echo "<td>" . $a[$j] . "</td>";
$j++;
}
$value=$a[$j];
$id = $a[0];
echo "<td><a href=\"delete.php/?requestid=$id\">Delete</a></td>";
}
echo "</table>";
echo "</form>";
pg_close($conn);
?>
</div>
<br/>
<hr/>
<div id="footer">
<h3>Date last modified </h3>
<?php
echo "Last modified: " . date ("F d Y H:i:s.", getlastmod());
?>
<br/>
</div>
</div>
</div>
</body>
</html>