* @copyright Deakin University 2007,2008 * @package queXS * @subpackage user * @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 */ require ("auth-interviewer.php"); /** * XHTML functions */ include ("functions/functions.xhtml.php"); /** * Operator functions */ include("functions/functions.operator.php"); $js = false; if (AUTO_LOGOUT_MINUTES !== false) $js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js"); xhtml_head(T_("Case Notes"),false,array("css/table.css","css/casenote.css"),$js, (isset($_GET['add'])) ? "onload=\"document.getElementById('note').focus();\"" : false); //List the case note history // display in the operators time if (isset($_GET['add'])) { ?>
StartTrans(); $operator_id = get_operator_id(); $case_id = get_case_id($operator_id); if ($case_id) { if (isset($_POST['note'])) { $note = $db->qstr($_POST['note']); $sql = "INSERT INTO `case_note` (case_note_id,case_id,operator_id,note,datetime) VALUES (NULL,'$case_id','$operator_id',$note,CONVERT_TZ(NOW(),'System','UTC'))"; $db->Execute($sql); } $sql = "SELECT DATE_FORMAT(CONVERT_TZ(c.datetime,'UTC',op.Time_zone_name),'".DATE_TIME_FORMAT."') as time, op.firstName, op.lastName, c.note as note FROM `case_note` as c JOIN (operator as op) on (c.operator_id = op.operator_id) WHERE c.case_id = '$case_id' ORDER BY c.datetime DESC"; $rs = $db->GetAll($sql); print ""; if (empty($rs)) print "" . T_("No notes") . "
"; else xhtml_table($rs,array("time","firstName","note"),array(T_("Date/Time"),T_("Operator"),T_("Note"))); } else print "" . T_("No case") . "
"; $db->CompleteTrans(); } xhtml_foot(); ?>