<?

$address = getenv("REMOTE_ADDR");

if (($address == "100.100.100.175") || ($address == "100.100.100.78")
|| ($address == "100.100.100.83") || ($address == "100.100.100.22")
|| ($address == "100.100.100.16") || ($address == "100.100.100.55")
|| ($address == "100.100.100.38") || ($address == "100.100.100.17")) {
}else{
header("Location:http://100.100.100.222");
exit;
}

$db_name = "techproj";
$table_name = "projlist";

$connection = mysql_connect("localhost","dbuser","2al2")
or die(mysql_error());

$db = mysql_select_db($db_name,$connection) or die(mysql_error());

$sql = "SELECT
projid,request,dtneed,projdesc,tech,dtcomp,dtreq,dtacpt
from $table_name order by projid";

$result = mysql_query($sql,$connection) or die(mysql_error());

while ($row = mysql_fetch_array($result)) {

$projid = $row['projid'];
$dtreq = $row['dtreq'];
$request = $row['request'];
$dtneed = $row['dtneed'];
$projdesc = $row['projdesc'];
$tech = $row['tech'];
$dtacpt = $row['dtacpt'];
$dtcomp = $row['dtcomp'];

if ($dtneed == "0000-00-00") {
$dtneed = "[unknown]";
}
if ($dtcomp == "0000-00-00") {
$dtcomp = "unfinished";
}

$display_block .= "
<P><strong>PROJECT ID: $projid</strong><br>
Requested by: $request, Date requested: $dtreq, Date needed: $dtneed<br>
Technician: $tech, Date started: $dtacpt,<strong> Date completed: 
$dtcomp</strong><br>
Project Description:<br>
<FONT COLOR=\"#007700\">$projdesc</FONT></P>
";
}
?>

<HTML>
<HEAD>
<TITLE>PROJECT LIST</TITLE>
</HEAD>
<BODY>
<H1>COMPLETE PROJECT LIST</H1>

<? echo "$display_block"; ?>

<P><a href = "projupd.php">Update Project</a></P>
<P><a href = "techlog.php">Add a Project</a></P>
<P><a href = "oops.php">oops!</a></P>
<P><a href = "techlog2.php">Active Project List</a><P>
</BODY>
</HTML>

















