* @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2012 * @package queXS * @subpackage user * @link http://www.acspri.org.au/software queXS was writen for ACSPRI * @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 file */ require ("auth-admin.php"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); /** * Operator functions */ include("../functions/functions.operator.php"); xhtml_head(T_("Cases by outcome"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css")); print "
 " . T_("Go back") . " 
"; //List the cases by outcome $operator_id = get_operator_id(); if ($operator_id) { //get the outcome and the questionnaire $outcome_id = intval($_GET['outcome_id']); $questionnaire_id = intval($_GET['questionnaire_id']); $sql = "SELECT o.description, q.description as qd FROM `outcome` as o, questionnaire as q WHERE o.outcome_id = '$outcome_id' AND q.questionnaire_id = '$questionnaire_id'"; $rs = $db->GetRow($sql); if (!empty($rs)){ print "

" . T_("Project") . ": {$rs['qd']}

"; if($sample_import_id=intval($_GET['sample_import_id'])){ $sql = "SELECT si.description as sd FROM `sample_import` as si WHERE si.sample_import_id = '$sample_import_id' ;"; $sd = $db->GetRow($sql); print "

". T_("Sample:") ." " . T_($sd['sd']) . "

"; $sid = "AND s.import_id= '$sample_import_id'"; } else{$sid = " ";}; if($oper_id= intval($_GET['oper_id'])){ $sql = "SELECT CONCAT(op.firstname, op.lastname) as opname FROM `operator` as op WHERE op.operator_id = '$oper_id' ;"; $on = $db->GetRow($sql); print "

". T_("Operator") ." : " . T_($on['opname']) . "

oper_id = $oper_id "; $opn = "AND c.current_operator_id= '$oper_id'"; } else{$opn = " ";}; print "

". T_("Current outcome:") ." " . T_($rs['description']) . "

"; $sql = "SELECT CONCAT('', c.case_id, '') as case_id FROM `case` as c LEFT JOIN `sample` as s ON ( s.sample_id = c.sample_id ) WHERE c.questionnaire_id = '$questionnaire_id' AND c.current_outcome_id = '$outcome_id' $sid $opn LIMIT 500"; $rs = $db->GetAll($sql); print "
"; if (empty($rs)) print "

" . T_("No cases with this outcome") . "

"; else { xhtml_table($rs,array("case_id"),array(T_("Case ID"))); } } else print "

" . T_("Error with input") . "

"; } else print "

" . T_("No operator") . "

"; print "
"; xhtml_foot(); ?>