* @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_once(dirname(__FILE__).'/../config.inc.php'); /** * Database file */ include ("../db.inc.php"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); /** * Operator functions */ include ("../functions/functions.operator.php"); /** * Input functions */ include ("../functions/functions.input.php"); if (isset($_GET['appointment_id']) && isset($_GET['case_id'])) { if (isset($_GET['delete'])) { $appointment_id = bigintval($_GET['appointment_id']); $case_id = bigintval($_GET['case_id']); $sql = "DELETE FROM appointment WHERE appointment_id = '$appointment_id'"; $db->Execute($sql); xhtml_head(T_("Now modify case outcome")); print "

" . T_("The appointment has been deleted. Now you must modify the case outcome") . "

"; print "

" . T_("Modify case outcome") . "

"; } else if (isset($_GET['start'])) { //Edit this appointment in the database } else { //Display an edit form xhtml_head(T_("Edit appointment")); } } else if (isset($_GET['new'])) { } else { $operator_id = get_operator_id(); xhtml_head(T_("Display Appointments"),true,array("../css/table.css")); print "

" . T_("Appointments") . "

" . T_("All appointments (with times displayed in your time zone)") . "

"; $sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',o.Time_zone_name) as start, CONVERT_TZ(a.end,'UTC',o.Time_zone_name) as end, r.firstName, r.lastName, IFNULL(ou.description,'" . T_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName, CONCAT('', c.case_id, '') as case_id, CONCAT('". T_("Delete") . "') as link FROM appointment as a JOIN (`case` as c, respondent as r, questionnaire as q, operator as o, operator as oo, call_attempt as cc) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and o.operator_id = '$operator_id' and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id) LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id) WHERE a.end >= CONVERT_TZ(NOW(),'System','UTC') ORDER BY a.start ASC"; $rs = $db->GetAll($sql); if (!empty($rs)) { translate_array($rs,array("outcome")); xhtml_table($rs,array("description","case_id","start","end","makerName","firstName","lastName","outcome","callerName","link"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End"),T_("Operator Name"),T_("Respondent Name"),T_("Surname"),T_("Current outcome"),T_("Operator who called"),T_("Delete"))); } else print "

" . T_("No appointments in the future") . "

"; } xhtml_foot(); ?>