Location: PHPKode > projects > ACollab > include/html/departments.inc.php
<?php 
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2004  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* This program is distributed in the hope that it will be useful, but                  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                 */
/* See the GNU General Public License for more details.                                 */
/*                                                                                      */
/* You may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/

if (!defined('AC_INCLUDE_PATH')) { exit; }


if ($_GET['f']) {
	print_feedback($_GET['f']);
}

if ($_GET['col']) {
	$col = addslashes($_GET['col']);
} else {
	$col = 'title';
}

if ($_GET['order']) {
	$order = addslashes($_GET['order']);
} else {
	$order = 'asc';
}

${'highlight_'.$col} = ' u';

$departments = get_departments($col, $order);

if ($departments) {
	echo '<table cellspacing="0" cellpadding="2" border="0" bgcolor="white" width="99%" align="center" summary="" class="box2">';
	echo '<tr>';

	echo '<th scope="col" class="box" align="left"';
	echo '><small><a href="'.$_SERVER['PHP_SELF'].'?col=title'.SEP.'order=asc" class="nav'.$highlight_title.'" title="'._AC('title_asc').'" onfocus="this.className=\'highlight\'" onblur="this.className=\'nav'.$highlight_title.'\'">'._AC('title').'</a> ';
		if (($col == 'title') && ($order == 'asc')) {
			echo '<a href="'.$_SERVER['PHP_SELF'].'?col=title'.SEP.'order=desc"><img src="images/desc.gif" height="7" width="11" alt="'._AC('title_desc').'" border="0" class="img4" /></a>';
		} else if (($col == 'title') && ($order == 'desc')) {
			echo '<a href="'.$_SERVER['PHP_SELF'].'?col=title'.SEP.'order=asc"><img src="images/asc.gif" height="7" width="11" alt="'._AC('title_asc').'" border="0"  class="img4" /></a>';
		} else {
			echo '<img src="images/clr.gif" height="7" width="11" alt="" />';
		}
	echo '</small></th>';

	if (authenticate(USER_ADMIN, USER_RETURN_CHECK)) {
		echo '<th scope="col" class="box">&nbsp;</th>';
	}

	echo '</tr>';

	foreach ($departments as $row) {
		$counter++;
		$col = ($counter-1)%2;
		echo '<tr>';
		
		echo '<td class="row'.$col.'"><small>'.$row['title'].'</small></td>';

		if (authenticate(USER_ADMIN, USER_RETURN_CHECK)) {
			echo '<td class="row'.$col.'" align="right"><small><a href="admin/users.php?d='.$row['department_id'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AC('view_members').'</a> | <a href="admin/departments_edit.php?id='.$row['department_id'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AC('edit').'</a> | <a href="admin/departments_delete.php?id='.$row['department_id'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AC('delete').'</a></small></td>';
		}

		echo '</tr>';
	} 
	echo '</table>';
	echo '<p><small>'._AC('use_col_headings').'</small></p>';
} else {
	echo '<p>'._AC('no_departments_found').'</p>';
}
?>
Return current item: ACollab