2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added referral function (requires addition to database)

This commit is contained in:
root
2013-09-11 15:02:59 +10:00
parent d23409f110
commit 98f246dd03
6 changed files with 280 additions and 8 deletions

View File

@@ -225,9 +225,11 @@ if (isset($_POST['update']) && isset($_GET['modify']))
$rws = 0;
$rs = 0;
$respsc = 0;
$referral = 0;
if (isset($_POST['ras'])) $ras = 1;
if (isset($_POST['rws'])) $rws = 1;
if (isset($_POST['respsc'])) $respsc = 1;
if (isset($_POST['referral'])) $referral = 1;
$name = $db->qstr(html_entity_decode($_POST['description']));
if (isset($_POST['rs_intro']))
@@ -242,7 +244,7 @@ if (isset($_POST['update']) && isset($_GET['modify']))
$rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],true));
$sql = "UPDATE questionnaire
SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', self_complete = $respsc
SET description = $name, info = $info, rs_project_end = $rs_project_end, restrict_appointments_shifts = '$ras', restrict_work_shifts = '$rws', self_complete = $respsc, referral = $referral
WHERE questionnaire_id = '$questionnaire_id'";
$db->Execute($sql);
@@ -302,7 +304,7 @@ if (isset($_GET['modify']))
$rs = $db->GetRow($sql);
$testing = $rws = $ras = $rsc = "checked=\"checked\"";
$referral = $testing = $rws = $ras = $rsc = "checked=\"checked\"";
$rscd = "";
$aio = $qbq = $gat = "";
@@ -314,6 +316,7 @@ if (isset($_GET['modify']))
if ($rs['restrict_appointments_shifts'] != 1) $ras = "";
if ($rs['restrict_work_shifts'] != 1) $rws = "";
if ($rs['testing'] != 1) $testing = "";
if ($rs['referral'] != 1) $referral = "";
if ($rs['self_complete'] == 0)
{
$rsc = "";
@@ -329,6 +332,7 @@ if (isset($_GET['modify']))
<p><?php echo T_("Restrict appointments to shifts?"); ?> <input name="ras" type="checkbox" <?php echo $ras; ?>/></p>
<p><?php echo T_("Restrict work to shifts?"); ?> <input name="rws" type="checkbox" <?php echo $rws; ?>/></p>
<p><?php echo T_("Questionnaire for testing only?"); ?> <input name="testing" type="checkbox" disabled="true" <?php echo $testing; ?>/></p>
<p><?php echo T_("Allow operators to generate referrals?"); ?> <input name="referral" type="checkbox" <?php echo $referral; ?>/></p>
<p><?php echo T_("Allow for respondent self completion via email invitation?"); ?> <input name="respsc" type="checkbox" <?php echo $rsc ?> onchange="if(this.checked==true) show(this,'limesc'); else hide(this,'limesc');" /></p>
<div id='limesc' <?php echo $rscd; ?>>
<p><?php echo T_("Questionnaire display mode for respondent");?>: <select name="lime_mode"><option <?php echo $aio;?> value="survey"><?php echo T_("All in one"); ?></option><option <?php echo $qbq; ?> value="question"><?php echo T_("Question by question"); ?></option><option <?php echo $gat; ?> value="group"><?php echo T_("Group at a time"); ?></option></select></p>