* @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"); /** * XHTML functions */ include ("functions/functions.xhtml.php"); /** * Calendar functions */ include("functions/functions.calendar.php"); /** * Operator functions */ include("functions/functions.operator.php"); /** * Input functions */ include("functions/functions.input.php"); $js = array("js/window.js","js/showhide.js"); if (AUTO_LOGOUT_MINUTES !== false) { $js[] = "include/jquery/jquery-1.4.2.min.js"; $js[] = "js/childnap.js"; } xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent.css"),$js); //display the respondents as a drop down list for this call attempt // display in the operators time global $db; $db->StartTrans(); $operator_id = get_operator_id(); $call_attempt_id = get_call_attempt($operator_id,false); $case_id = get_case_id($operator_id); if (isset($_POST['submit'])) add_respondent($case_id,$_POST['firstName'],$_POST['lastName'],$_POST['Time_zone_name']); if (isset($_GET['respondent_id']) && $_GET['respondent_id'] == 0) { ?>
"/>
" . T_("Case id:") . " $case_id"; print "
" . T_("Respondent:") . "
"; if (isset($_GET['respondent_id']) && $_GET['respondent_id'] != 0) { $respondent_id = bigintval($_GET['respondent_id']); $sql = "UPDATE `call_attempt` SET respondent_id = '$respondent_id' WHERE call_attempt_id = '$call_attempt_id'"; $db->Execute($sql); } /* List respondents * */ $sql = "SELECT r.firstName, r.lastName, r.respondent_id,r.Time_zone_name,CASE WHEN c.respondent_id = r.respondent_id THEN 'selected=\'selected\'' ELSE '' END AS selected FROM respondent AS r LEFT JOIN call_attempt AS c ON ( c.call_attempt_id = '$call_attempt_id' ) WHERE r.case_id = '$case_id'"; $rs = $db->GetAll($sql); $timezone = ""; if (ALLOW_RESPONDENT_SELECTOR) { print "
"; } else { if (isset($rs[0])) print "
" . $rs[0]['firstName'] . " " . $rs[0]['lastName'] . "
"; } print "
$timezone
"; //display sample details //limit to those allowed by admin $sql = "SELECT sivr.var,sv.val FROM `sample_var` as sv, `sample_import_var_restrict` as sivr, `case` as c WHERE c.case_id = '$case_id' AND sv.sample_id = c.sample_id AND sivr.var_id = sv.var_id AND (sivr.restrict IS NULL OR sivr.restrict = 0)"; $rs = $db->GetAll($sql); print "
" . T_("Show details") . "
"; print "
"; if (!empty($rs)) { xhtml_table($rs,array("var","val"),array(T_("Var"),T_("Value"))); } print "
"; } xhtml_foot(); $db->CompleteTrans(); ?>