* @copyright Deakin University 2007,2008 * @package queXS * @subpackage admin * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * * */ /** * Configuration file */ include("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * Authentication file */ include ("auth-admin.php"); /** * XHTML functions */ include("../functions/functions.xhtml.php"); /** * Display functions */ include("../functions/functions.display.php"); /** * Input functions */ include("../functions/functions.input.php"); global $db; if (isset($_POST['dtime_zone'])) { set_setting('DEFAULT_TIME_ZONE', $_POST['dtime_zone']); } if (isset($_GET['time_zone'])) { //need to add sample to questionnaire $tz = $db->qstr($_GET['time_zone'],get_magic_quotes_gpc()); $sql = "INSERT INTO timezone_template(Time_zone_name) VALUES($tz)"; $db->Execute($sql); } if (isset($_GET['tz'])) { //need to remove rsid from questionnaire $tz = $db->qstr($_GET['tz'],get_magic_quotes_gpc()); $sql = "DELETE FROM timezone_template WHERE Time_zone_name = $tz"; $db->Execute($sql); } xhtml_head(T_("Set Timezones"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js")); //,"../include/bootstrap/css/bootstrap-theme.min.css" $dtz = get_setting("DEFAULT_TIME_ZONE"); $sql = "SELECT name as value, name as description, CASE WHEN name LIKE '$dtz' THEN 'selected=\'selected\'' ELSE '' END AS selected FROM mysql.time_zone_name"; $tzl = $db->GetAll($sql); if (empty($tzl) || !$tzl) { print "
" . T_("Your database does not have timezones installed, please see here for details") . " ...
" .T_("or") . "
" . T_("Check that you have granted relevant permissions on 'time_zone_...' tables in database named 'mysql'.") . "
"; } print "

" . T_("Default Timezone: ") . " $dtz

";//
?>
"/>
"; print "

" . T_("Timezone list") . "

"; $sql = "SELECT Time_zone_name, TIME_FORMAT(CONVERT_TZ(NOW(),@@session.time_zone,Time_zone_name),'". TIME_FORMAT ."') as time, CONCAT('

', TIME_FORMAT(TIMEDIFF( CONVERT_TZ(NOW(),'$dtz','$dtz'),CONVERT_TZ(NOW(), Time_zone_name,'$dtz')),' %H : %i'), '

') AS timediff, CONCAT('" . T_("Remove") . "') as link FROM timezone_template ORDER BY time ASC"; $qs = $db->GetAll($sql); xhtml_table($qs, array("Time_zone_name","timediff","time","link"), array(T_("Timezone name"),T_("Time diff to Default Time zone"),T_("Current time"),T_("Remove"))); print "
"; print "

" . T_("Add a Timezone:") . " 

"; ?>
"/>
"; xhtml_foot(); ?>