* @copyright Deakin University 2007,2008 * @package queXS * @subpackage client * @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_once(dirname(__FILE__).'/../db.inc.php'); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); /** * AAPOR calculation functions */ include ("../functions/functions.aapor.php"); /** * Client functions */ include ("../functions/functions.client.php"); $client_id = get_client_id(); xhtml_head(T_("Questionnaire Outcomes"),true,array("css/table.css")); if ($client_id) { $sql = "SELECT q.questionnaire_id,q.description FROM questionnaire as q, client_questionnaire as cq WHERE cq.questionnaire_id = q.questionnaire_id AND q.enabled = 1 AND cq.client_id = '$client_id'"; $qs = $db->GetAll($sql); if (empty($qs)) print "

" . T_("There are no questionnaires assigned to you") . "

"; else { foreach($qs as $q) { print "

{$q['description']}

"; $questionnaire_id = $q['questionnaire_id']; $sql = "SELECT o.calc, count( c.case_id ) FROM `case` AS c, `outcome` AS o WHERE c.questionnaire_id = '$questionnaire_id' AND c.current_outcome_id = o.outcome_id GROUP BY o.calc"; $a = $db->GetAssoc($sql); $a = aapor_clean($a); print ""; print ""; print ""; print ""; print ""; print "
" . T_("Outcome") . "" . T_("Rate") . "
" . T_("Response Rate 1") . "" . round(aapor_rr1($a),2) . "
" . T_("Refusal Rate 1") . "" . round(aapor_ref1($a),2) . "
" . T_("Cooperation Rate 1") . "" . round(aapor_coop1($a),2) . "
" . T_("Contact Rate 1") . "" . round(aapor_con1($a),2) . "
"; $sql = "SELECT o.description as des, o.outcome_id, count( c.case_id ) as count FROM `case` AS c, `outcome` AS o WHERE c.questionnaire_id = '$questionnaire_id' AND c.current_outcome_id = o.outcome_id GROUP BY o.outcome_id"; $rs = $db->GetAll($sql); if (!empty($rs)) { translate_array($rs,array("des")); xhtml_table($rs,array("des","count"),array(T_("Outcome"),T_("Count")),"tclass",array("des" => "Complete")); } else print "

" . T_("No outcomes recorded for this questionnaire") . "

"; } } } else print "

" . T_("You are not a valid client") . "

"; xhtml_foot(); ?>