if ((!$HTTP_GET_VARS['CatID']) && (!$HTTP_GET_VARS['StaffID']))
{
//this would be the default staff page what to display
echo '
Select a staff member or group from the right |
';
}
if ($HTTP_GET_VARS['CatID'])
{
echo '';
//get the group picture of category
$CatID = $HTTP_GET_VARS['CatID'];
if ( $validator->validateNumber($CatID,'Staff Category ID') )
{
$group = $connector->query('Select * from Staff_Cat where ID="'.$CatID.'" limit 0,1');
$g = $connector->fetchArray($group);
echo ' ';
if ($g['Image'])
{
echo ' | ';
}
echo ' | ';
}
else
{
echo "Can not display staff section: ".$validator->listErrors();
}
echo ' ';
}
if ($HTTP_GET_VARS['StaffID'])
{
echo '';
//get the group picture of category
$StaffID = $HTTP_GET_VARS['StaffID'];
if ( $validator->validateNumber($StaffID,'Staff ID') )
{
$staff = $connector->query('Select * from Staff where ID="'.$StaffID.'" limit 0,1');
$s = $connector->fetchArray($staff);
if ($s['Image'])
{
if ($s['Name'])
{
echo '
| ';
}
echo '
|
';
if ($s['Name'])
{
echo 'Name: | '.$s['Name'].' | ';
}
if ($s['Title'])
{
echo 'Title: | '.$s['Title'].' | ';
}
//if ($s['CatID'])
//{
// //select Category Name
// $staff_cat = $connector->query('Select * from Staff_Cat where ID="'.$s['CatID'].'" limit 0,1');
// $scat = $connector->fetchArray($staff_cat);
if ($s['Position'])
{
echo 'Position: | '.$s['Position'].' | ';
}
if ($s['Email'])
{
echo 'Email: | '.$s['Email'].' | ';
}
if ($s['Phone'])
{
echo 'Phone: | '.$s['Phone'].' | ';
}
if ($s['Education'])
{
echo 'Education: | '.$s['Education'].' | ';
}
echo ' |
|
';
if ($s['Bio'])
{
echo ' Bio: |
'.$s['Bio'].' | ';
}
echo '
| ';
}
else
{
echo '
';
if ($s['Name'])
{
echo 'Name: | '.$s['Name'].' | ';
}
if ($s['Title'])
{
echo 'Title: | '.$s['Title'].' | ';
}
// if ($s['CatID'])
// {
//select Category Name
// $staff_cat = $connector->query('Select * from Staff_Cat where ID="'.$s['CatID'].'" limit 0,1');
// $scat = $connector->fetchArray($staff_cat);
if ($s['Position'])
{
echo 'Position: | '.$s['Position'].' | ';
}
if ($s['Email'])
{
echo 'Email: | '.$s['Email'].' | ';
}
if ($s['Phone'])
{
echo 'Phone: | '.$s['Phone'].' | ';
}
if ($s['Education'])
{
echo 'Education: | '.$s['Education'].' | ';
}
if ($s['Bio'])
{
echo 'Bio: | '.$s['Bio'].' | ';
}
echo ' |
|
';
}
}
else
{
echo "Can not display staff section: ".$validator->listErrors();
}
echo ' ';
}
?>
|
$result = $connector->query('SELECT * from Staff_Cat where Site="2" and Active="1" order by Sort, Name');
// Get an array containing the results.
// Loop for each item in that array
?>
while ($row = $connector->fetchArray($result))
{
echo ''.$row['Name'].' | ';
$staffs = $connector->query('Select * from Staff where CatID="'.$row[ID].'" and Site="2" order by Sort');
while ($ss = $connector->fetchArray($staffs))
{
echo ''.$ss['Name'].' | ';
}
}
?>
|
|