mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Added in-page Lime statistics block, Bootstrapted interface
This commit is contained in:
@@ -41,7 +41,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
|
|||||||
/**
|
/**
|
||||||
* Authentication
|
* Authentication
|
||||||
*/
|
*/
|
||||||
include ("auth-client.php");
|
require ("auth-client.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,11 +62,11 @@ include ("../functions/functions.client.php");
|
|||||||
|
|
||||||
$client_id = get_client_id();
|
$client_id = get_client_id();
|
||||||
|
|
||||||
xhtml_head(T_("Questionnaire Outcomes"),true,array("css/table.css"));
|
xhtml_head(T_("Questionnaire Outcomes"),true,array("../include/bootstrap/css/bootstrap.min.css", "../css/custom.css"));
|
||||||
|
|
||||||
if ($client_id)
|
if ($client_id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT q.questionnaire_id,q.description
|
$sql = "SELECT q.questionnaire_id,q.description,q.lime_sid
|
||||||
FROM questionnaire as q, client_questionnaire as cq
|
FROM questionnaire as q, client_questionnaire as cq
|
||||||
WHERE cq.questionnaire_id = q.questionnaire_id
|
WHERE cq.questionnaire_id = q.questionnaire_id
|
||||||
AND q.enabled = 1
|
AND q.enabled = 1
|
||||||
@@ -75,14 +75,17 @@ if ($client_id)
|
|||||||
$qs = $db->GetAll($sql);
|
$qs = $db->GetAll($sql);
|
||||||
|
|
||||||
if (empty($qs))
|
if (empty($qs))
|
||||||
print "<p>" . T_("There are no questionnaires assigned to you") . "</p>";
|
print "<p class='alert alert-info'>" . T_("There are no questionnaires assigned to you") . "</p>";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print "<div class='col-lg-2'>";
|
||||||
|
|
||||||
foreach($qs as $q)
|
foreach($qs as $q)
|
||||||
{
|
{
|
||||||
print "<h2>{$q['description']}</h2>";
|
print "<div class=' '><h2>{$q['description']}</h2>";
|
||||||
|
|
||||||
$questionnaire_id = $q['questionnaire_id'];
|
$questionnaire_id = $q['questionnaire_id'];
|
||||||
|
$qsid=$q['lime_sid'];
|
||||||
|
|
||||||
$sql = "SELECT o.calc, count( c.case_id )
|
$sql = "SELECT o.calc, count( c.case_id )
|
||||||
FROM `case` AS c, `outcome` AS o
|
FROM `case` AS c, `outcome` AS o
|
||||||
@@ -91,15 +94,15 @@ if ($client_id)
|
|||||||
GROUP BY o.calc";
|
GROUP BY o.calc";
|
||||||
|
|
||||||
$a = $db->GetAssoc($sql);
|
$a = $db->GetAssoc($sql);
|
||||||
|
|
||||||
$a = aapor_clean($a);
|
$a = aapor_clean($a);
|
||||||
|
|
||||||
|
print "<table class='table-hover table-condensed tclass'><thead class=\"highlight\"><tr><th>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr></thead>";
|
||||||
print "<table><tr><th>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr>";
|
|
||||||
print "<tr><td>" . T_("Response Rate 1") . "</td><td>" . round(aapor_rr1($a),2) . "</td></tr>";
|
print "<tr><td>" . T_("Response Rate 1") . "</td><td>" . round(aapor_rr1($a),2) . "</td></tr>";
|
||||||
print "<tr><td>" . T_("Refusal Rate 1") . "</td><td>" . round(aapor_ref1($a),2) . "</td></tr>";
|
print "<tr><td>" . T_("Refusal Rate 1") . "</td><td>" . round(aapor_ref1($a),2) . "</td></tr>";
|
||||||
print "<tr><td>" . T_("Cooperation Rate 1") . "</td><td>" . round(aapor_coop1($a),2) . "</td></tr>";
|
print "<tr><td>" . T_("Cooperation Rate 1") . "</td><td>" . round(aapor_coop1($a),2) . "</td></tr>";
|
||||||
print "<tr><td>" . T_("Contact Rate 1") . "</td><td>" . round(aapor_con1($a),2) . "</td></tr>";
|
print "<tr><td>" . T_("Contact Rate 1") . "</td><td>" . round(aapor_con1($a),2) . "</td></tr>";
|
||||||
print "</table>";
|
print "</table></br>";
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT o.description as des, o.outcome_id, count( c.case_id ) as count
|
$sql = "SELECT o.description as des, o.outcome_id, count( c.case_id ) as count
|
||||||
@@ -115,20 +118,24 @@ if ($client_id)
|
|||||||
translate_array($rs,array("des"));
|
translate_array($rs,array("des"));
|
||||||
xhtml_table($rs,array("des","count"),array(T_("Outcome"),T_("Count")),"tclass",array("des" => "Complete"));
|
xhtml_table($rs,array("des","count"),array(T_("Outcome"),T_("Count")),"tclass",array("des" => "Complete"));
|
||||||
}
|
}
|
||||||
else
|
else print "<p class='alert alert-info'>" . T_("No outcomes recorded for this questionnaire") . "</p>";
|
||||||
print "<p>" . T_("No outcomes recorded for this questionnaire") . "</p>";
|
|
||||||
|
print "</br><a href=\"?page=".LIME_URL."admin/admin.php\" class=\"btn btn-default btn-block btn-lime\">" . T_("Lime results") . "</a></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$page =''; if (isset($_GET['page'])) $page = $_GET['page'] . "?action=browse&sid=$qsid";
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-10" id=" " style="height:820px;">
|
||||||
|
<?php xhtml_object($page,' ',"full"); ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
print "<p>" . T_("You are not a valid client") . "</p>";
|
print "<p class='alert alert-danger'>" . T_("You are not a valid client") . "</p>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xhtml_foot();
|
xhtml_foot();
|
||||||
|
|
||||||
|
|||||||
@@ -74,4 +74,8 @@ text-shadow: 1px 2px 1px #ababab;
|
|||||||
.h1, .h2, .h3, h1, h2, h3 {
|
.h1, .h2, .h3, h1, h2, h3 {
|
||||||
margin-bottom: 0.4em;
|
margin-bottom: 0.4em;
|
||||||
margin-top: 0.25em;
|
margin-top: 0.25em;
|
||||||
|
}
|
||||||
|
.full {
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user