session_start();
if (!session_is_registered("LLC"))
{
// if session check fails, invoke error handler
header("Location: ../loginform.php");
exit();
}
$user = $_SESSION['UNAME'];
$Department = isset($_GET['dpt']) ? $_GET['dpt'] : "";
include("../include/dbconfig.php");
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
mysql_select_db($db_name);
?>
Print Labels
$i=0;
$query = "SELECT FirstName, LastName, Department from SR_instructor";
if ($Department != ''){$query .= " where Department='$Department'";}
else {$query .= " order by Department";}
$result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
while($row = mysql_fetch_row($result))
{
if ($i==0)
{
print <<
END;
$i=1;
$width=260;
}
else if ($i==1)
{
$i=2;
$width=258;
}
else if ($i==2)
{
$i=0;
$width=240;
}
print << $row[2]
$row[0] $row[1]
END;
if ($i==0)
{
print <<
END;
}
}
print <<
END;
?>