* @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"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); global $db; $year="2008"; $woy="1"; if (isset($_POST['day'])) { $db->StartTrans(); $sql = "DELETE FROM shift_template WHERE 1"; $db->Execute($sql); foreach($_POST['day'] as $key => $val) { if (!empty($val)) { $val = intval($val); $key = intval($key); $start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); $end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); $sql = "INSERT INTO shift_template (day_of_week,start,end) VALUES ('$val',$start,$end)"; $db->Execute($sql); } } $db->CompleteTrans(); } xhtml_head(T_("Modify shift template"),true,array("../css/shifts.css"),array("../js/addrow-v2.js")); /** * Display warning if timezone data not installed * */ $sql = "SELECT CONVERT_TZ(NOW(),'Australia/Victoria','UTC') as t"; $rs = $db->GetRow($sql); if (empty($rs) || !$rs || empty($rs['t'])) print "
"; print "