<?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 */
/****************************************************************************************/
// $Id: file_types.php 235 2004-06-07 19:55:47Z boonhau $
define('AC_INCLUDE_PATH', '../include/');
require(AC_INCLUDE_PATH.'vitals.inc.php');
authenticate(USER_ADMIN);
$_SECTION[0][0] = _AC('administration');
$_SECTION[0][1] = 'admin/';
$_SECTION[1][0] = _AC('file_types');
$_SECTION[1][1] = 'admin/file_types.php';
require(AC_INCLUDE_PATH.'admin/header.inc.php');
echo '<p align="center"><a href="admin/file_types_create.php" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">ยป '._AC('create_file_type').'</a></p>';
if ($_GET['f']) {
print_feedback($_GET['f']);
}
if ($_GET['col']) {
$col = addslashes($_GET['col']);
} else {
$col = 'extension';
}
if ($_GET['order']) {
$order = addslashes($_GET['order']);
} else {
$order = 'desc';
}
${'highlight_'.$col} = ' u';
$sql = "SELECT * FROM ".TABLE_PREFIX."file_types ORDER BY $col $order";
$result = mysql_query($sql, $db);
if ($row = mysql_fetch_array($result)) {
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"><small><a href="'.$_SERVER['PHP_SELF'].'?col=extension'.SEP.'order=asc" class="nav'.$highlight_extension.'" title="'._AC('extension_asc').'" onfocus="this.className=\'highlight\'" onblur="this.className=\'nav'.$highlight_extension.'\'">'._AC('extension').'</a> ';
if (($col == 'extension') && ($order == 'asc')) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?col=extension'.SEP.'order=desc"><img src="images/desc.gif" height="7" width="11" alt="'._AC('extension_desc').'" border="0" /></a>';
} else if (($col == 'extension') && ($order == 'desc')) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?col=extension'.SEP.'order=asc"><img src="images/asc.gif" height="7" width="11" alt="'._AC('extension_asc').'" border="0" /></a>';
} else {
echo '<img src="images/clr.gif" height="7" width="11" alt="" />';
}
echo '</small></th>';
echo '<th scope="col" class="box" align="left"><small><a href="'.$_SERVER['PHP_SELF'].'?col=description'.SEP.'order=asc" class="nav'.$highlight_description.'" title="'._AC('description_asc').'" onfocus="this.className=\'highlight\'" onblur="this.className=\'nav'.$highlight_description.'\'">'._AC('description').'</a> ';
if (($col == 'description') && ($order == 'asc')) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?col=description'.SEP.'order=desc"><img src="images/desc.gif" height="7" width="11" alt="'._AC('description_desc').'" border="0" /></a>';
} else if (($col == 'description') && ($order == 'desc')) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?col=description'.SEP.'order=asc"><img src="images/asc.gif" height="7" width="11" alt="'._AC('description_asc').'" border="0" /></a>';
} else {
echo '<img src="images/clr.gif" height="7" width="11" alt="" />';
}
echo '</small></th>';
echo '<th scope="col" class="box"> </th>';
echo '</tr>';
do {
$counter++;
$col = ($counter-1)%2;
echo '<tr>';
echo '<td class="row'.$col.'"><small>'.$row['extension'].'</small></td>';
echo '<td class="row'.$col.'"><small>'.$row['description'].'</small></td>';
echo '<td class="row'.$col.'" align="right"><small><a href="admin/file_types_edit.php?id='.$row['extension'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AC('edit').'</a> | <a href="admin/file_types_delete.php?id='.$row['extension'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'._AC('delete').'</a></small></td>';
echo '</tr>';
} while ($row = mysql_fetch_array($result));
echo '</table>';
echo '<p><small>'._AC('use_col_headings').'</small></p>';
} else {
echo '<p>'._AC('no_file_types_found').'</p>';
}
require(AC_INCLUDE_PATH.'admin/footer.inc.php');
?>