* @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 * * * @todo Make timezone a drop down list * */ /** * Configuration file */ include ("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); global $db; $a = false; if (isset($_POST['operator'])) { $operator = $db->qstr($_POST['operator'],get_magic_quotes_gpc()); $firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); $lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); $time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); $extension = $db->qstr($_POST['extension'],get_magic_quotes_gpc()); $extensionp = $db->qstr($_POST['extensionp'],get_magic_quotes_gpc()); $supervisor = 0; $temporary = 0; $refusal = 0; $voip = 0; if (isset($_POST['supervisor']) && $_POST['supervisor'] == "on") $supervisor = 1; if (isset($_POST['refusal']) && $_POST['refusal'] == "on") $refusal = 1; if (isset($_POST['temporary']) && $_POST['temporary'] == "on") $temporary = 1; if (isset($_POST['voip']) && $_POST['voip'] == "on") $voip = 1; if (!empty($_POST['operator'])) { $sql = "INSERT INTO operator (`operator_id` ,`username` ,`firstName` ,`lastName`, `extension`,`extension_password`, `Time_zone_name`,`voip`) VALUES (NULL , $operator, $firstname , $lastname, $extension, $extensionp, $time_zone_name, $voip);"; if ($db->Execute($sql)) { $a = "Added: $operator"; $oid = $db->Insert_ID(); if ($temporary) { $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) VALUES ('$oid','1')"); $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) VALUES ('$oid','5')"); //and appointment } if ($supervisor) $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) VALUES ('$oid','2')"); if ($refusal) $db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id) VALUES ('$oid','3')"); }else { $a = "Could not add $operator. There may already be an operator of this name"; } } } xhtml_head(T_("Add an operator")); if ($a) { ?>

.

" />