.pagecell {background-color: #CCCC99; border: 1px solid #000000;');
print ('text-decoration: none;}');
print ('
| ');
}
function printBottom(){
print (' |
');
}
//login function, check userid and password against db and set useid cookie if valid, else goto unauthorizedPage
function login($userid, $password){
//check the passed variables against the users table and set cookie if they pass
///link handle
$link = pg_connect('dbname=kapitalm user=kapitalm password=sheibooc');
$query = "SELECT userhandle, password, firstname FROM ilmusers";
$result = pg_query($query);
$matchFlag = 0;
while ($row = pg_fetch_array($result)){
if (($row[userhandle] == $userid) and ($row[password] == $password)){
print ("");
adminPage($userid);
pg_close($link);
$matchFlag=1;
break;
}//end if
}//end while
if ($matchFlag==0){
unauthorizedPage();
}
}//end function
//go to the admin page for the user, requires only th userid cookie
function adminPage($userid){
printTop();
//variable for admin
$adminid = "kapitalm";
//if the admin logged in then display all features, otherwise restict it to...
//link handle
$link = pg_connect('dbname=kapitalm user=kapitalm password=sheibooc');
$query = "SELECT firstname FROM ilmusers WHERE userhandle='$userid'";
$result = pg_query($query);
$row = pg_fetch_array($result);
$userFirstName = $row[firstname];
pg_close($link);
if($userid == $adminid){
print ('