<html>
<head>
<title>PHPdir</title>
<?
include ('subhead.php');
?>
</head>
<body>
<table width="800" border="0">
<tr valign="top">
<td colspan="2">
<p class=Heading align="left">PHPdir</p>
<?
echo "<p class=SmallText align=\"left\"><a href=\"$app_path/index.php\">Address Book Home</a></p>
<p class=SmallText><a href=\"$adm_path/index.php\">Address Book Admin Home</a></p>";
?>
<p align="left"><b>Enter a name, department or extension</b> to search by
and select a category to narrow your results. You can also enter in the
first few letters of a name or department. Leaving the search field blank
will show all entries.</p>
<p><div align="left">
<table width="100%" border="0">
<tr>
<td width="50%">
<table border="1">
<?
echo "<form action=\"$adm_path/search.php\" method=\"POST\">";
?>
<tr>
<td>Search</td>
<td>
<select name=category>
<option value="lastname" selected>Last Name</option>
<option value="firstname">First Name</option>
<option value="title">Title</option>
<option value="phone">Phone</option>
</select>
</td>
<td>
<?
echo "<input type=\"text\" name=\"searchstring\" value\"$searchstring\" size=\"15\">
<input type=\"image\" src=\"$img_path/button_find.gif\" border=\"0\" alt=\"Find it!\">\n";
?>
</td>
</tr>
</form>
</table>
</td>
<td class=Highlight width="50%">
<div align="center"><b>Click here to add a new entry:</b><br>
<?
echo "<a href=\"$adm_path/add.php\"><img src=\"$img_path/button_addnew.gif\" border=\"0\"></a><br>
Or here to <a href=\"$adm_path/dept.php\">modify department entries</a>.";
?>
</div>
</td>
</tr>
</table>
</div></p>
<p align="left">Or you can click on one of the department links below to
get a listing of everyone in that department.<br></p>
</td>
</tr>
<tr>
<td valign="top" class="SmallText" width="25%">
<?
/* List departments in DB */
$link_list = mysql_connect($dbhost, $dbuser, $dbpass)
or die("Could not connect to the database");
mysql_select_db($dbname, $link_list)
or die("Could not select the database");
$result_list = mysql_query($select_dept_list);
while ( $a_row = mysql_fetch_array( $result_list ))
{
# print var_dump($a_row);
print "<a href=\"$adm_path/list.php?dept=$a_row[serial]\">
$a_row[department]</a><br>\n";
}
?>
</td>