<?php
include ("globalvars.php");
//Global Functions
function gentop($title) {
$date = date("F d, Y");
$filename = "./pagetop.html";
$filename2 = "./pagetop2.html";
$fp = fopen ($filename, "r");
$pagetop = fread ($fp, filesize ($filename));
$pagetop = ereg_replace("<title>title</title>", "<title>$title</title>", $pagetop);
echo "$pagetop";
fclose ($fp);
echo"
<!-------------------------------Search TD------------------------------------------------>
<td bgcolor=\"#ffffff\" align=\"center\">
<center>
<form action=\"issue.php\" method=\"get\">
<font size=\"2\" color=\"#000000\">
<b>Your Issues </b>
<select name=\"CON\" onChange=\"submit();\">
<option></option>
<option value=\"\">EVERYONE</option>";
global $connection;
$db = mysql_select_db("radTracker", $connection) or die ("Couldn't connect to DB Radtracker");
$sql_command = "SELECT DISTINCT Contact FROM issue ORDER BY Contact";
$sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
while ($row = mysql_fetch_array($sql_result)) {
$contact = $row["Contact"];
echo "<option value=\"$contact\">$contact</option>";
}
echo "
</select>
</font>
</form>
</center>
</td>";
echo "
<!-------------------------------Topics TD----------------------------------------------->
<td bgcolor=\"#ffffff\" align=\"center\">
<center>
<form action=\"issue.php\" method=\"get\">
<font size=\"2\"><b>Topics </b>
<select name=\"CAT\"onChange='submit()'>
<option></option>
<option value=\"\">All Topics</option>";
$sql_command2 = "SELECT Category FROM category ORDER BY Category";
$sql_result2 = mysql_query($sql_command2,$connection) or die (mysql_error());
while ($row = mysql_fetch_array($sql_result2)) {
$category = $row["Category"];
echo "<option value=\"$category\">$category</option>";
}
echo "</select>";
$fp = fopen ($filename2, "r");
$pagetop2 = fread ($fp, filesize ($filename2));
$pagetop2 = ereg_replace("mydateis", "$date", $pagetop2);
echo "$pagetop2";
}
function genbottom() {
$filename = "./pagebottom.html";
$fp = fopen ($filename, "r");
$pagebottom = fread ($fp, filesize ($filename));
global $connection;
mysql_close($connection);
echo "$pagebottom";
}
?>