107 lines
3.0 KiB
PHP
107 lines
3.0 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
|
|
// Start the template and output buffering
|
|
startTemplate();
|
|
$templatePageTitle = getLanguageText('TEXT-STAFF-LIST');
|
|
$headerArgs = "";
|
|
|
|
|
|
$school_name = $school_record['school_name'];
|
|
|
|
?>
|
|
<br>
|
|
<table width='650' cellpadding='5' cellspacing='2' border='0'>
|
|
<tr>
|
|
<td align='center'>
|
|
<?php
|
|
// Get staff and staff categories
|
|
$query = "select s.*,category_title,sc.sequence " .
|
|
"from people as s, staff_categories as sc " .
|
|
"where s.school_num = $base_school_num " .
|
|
"and s.staff_category = sc.record_num " .
|
|
"order by sc.sequence,s.last_name,s.first_name";
|
|
$staff = db_query($query);
|
|
|
|
$prev_category = "";
|
|
|
|
while ($row = db_fetch_array($staff)) {
|
|
extract($row);
|
|
|
|
if ($prev_category != $category_title) {
|
|
if ($prev_category != "") {
|
|
?>
|
|
</table>
|
|
<br>
|
|
<?php
|
|
}
|
|
|
|
$prev_category = $category_title;
|
|
$count = 0;
|
|
?>
|
|
<table width='650' class='content-table'>
|
|
<tr>
|
|
<td align='left' colspan='2' width='100%' class='heading'><?php echo($category_title) ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
$bgclass = "data-even";
|
|
if (($count % 2) == 0) $bgclass = "data-odd";
|
|
$count++;
|
|
|
|
if ($school_record['staff_titles'] == 'Y') $name = "$title $first_name $last_name";
|
|
else $name = "$first_name $last_name";
|
|
|
|
// Check for classes this staff person is involved in
|
|
$query = "select * from classes " .
|
|
"where school_num = $base_school_num " .
|
|
"and (teacher1 = $record_num " .
|
|
"or teacher2 = $record_num " .
|
|
"or teacher3 = $record_num " .
|
|
"or teacher4 = $record_num " .
|
|
"or teacher5 = $record_num)";
|
|
$cresults = db_query($query);
|
|
|
|
$class_info = "";
|
|
if (db_num_rows($cresults) > 0) {
|
|
$ccount = 0;
|
|
while ($row = db_fetch_array($cresults)) {
|
|
if ($ccount > 0) $class_info .= " / ";
|
|
$class_info .= getClassInfo($row['record_num'],"external",0);
|
|
$ccount++;
|
|
}
|
|
}
|
|
?>
|
|
<tr>
|
|
<td align='left' width='50%' class='<?php echo($bgclass) ?>'> <?php echo($name) ?></td>
|
|
<td align='left' width='50%' class='<?php echo($bgclass) ?>'> <?php echo($class_info) ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>
|
|
<table>
|
|
<tr>
|
|
<td align='center'><a href='staff-list.print.php' class='btn btn--primary btn--xsmall'><span><?php displayLanguageText('TEXT-PRINTABLE-LIST'); ?></span></a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<?php include "get.adobe.php"; ?>
|
|
<?php
|
|
endTemplate();
|
|
?>
|