public function showMain($message = '') { $returnStr = $this->showNurseHeader(Language::messageSMSTitle()); $returnStr .= '<div id="wrap">'; if (isVisionTestNurse(new User($_SESSION['URID']))) { $primkey = gen_password(10); $returnStr .= "<form method=post>"; $returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC($primkey, Config::directLoginKey())) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_LANGUAGE . ' value="' . '1' . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_URID . ' value="' . addslashes($_SESSION['URID']) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_MODE . ' value="' . MODE_CAPI . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_SUID . ' value="' . '5' . '">'; $returnStr .= '<button type="submit" id="startsurveybtn" class="btn btn-default navbar-btn" style="width:200px">Start the vision test</button>'; $returnStr .= "</form>"; } else { $returnStr .= $this->showNavBar(); $returnStr .= '<div class="container"><p>'; $returnStr .= $message; if (isFieldNurse(new User($_SESSION['URID']))) { $respondents = new Respondents(); $respondents = $respondents->getRespondentsByUrid($_SESSION['URID']); $returnStr .= '<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example"> <thead> <tr> <th>' . Language::labelNurseHouseholdID() . '</th><th>' . Language::labelNurseName() . '</th><th>' . Language::labelNurseDwellingID() . '</th><th>' . Language::labelNurseVillage() . '</th></tr>'; foreach ($respondents as $respondent) { $returnStr .= '<tr>'; $refpage = 'nurse.respondent.fieldnurse'; $returnStr .= '<td>' . setSessionParamsHref(array('page' => $refpage . '.info', 'primkey' => $respondent->getPrimkey()), $respondent->getPrimkey()) . '</td>'; $returnStr .= '<td>' . $respondent->getName() . '</td><td>' . $respondent->getAddress1() . '</td><td>' . $respondent->getCity() . '</td></tr>'; } $returnStr .= '</table>'; } else { //lab or lab nurse mode //respondents mode! $returnStr .= '<h4>' . Language::labelNurseScanBarcode() . '</h4>'; $returnStr .= '<form id="searchform" role="search" autocomplete=off>'; $returnStr .= setSessionParamsPost(array("page" => "nurse.respondents.search")); $returnStr .= '<div class="input-group" style="width:300px"> <input name="search" type="text" class="form-control" id="search"> <span class="input-group-btn"> <button id="searchbutton" class="btn btn-default" type="submit">' . Language::labelSearch() . '</button> </span> </div><!-- /input-group -->'; $returnStr .= '<script>$("#search").focus();</script>'; $returnStr .= '</form>'; //$returnStr .= $this->showSearch(); if (isLabNurse(new User($_SESSION['URID']))) { $returnStr .= '<br/><hr>'; $returnStr .= '<b>' . Language::labelNurseFieldDBS() . '</b><br/><br/>'; global $db; $query = 'select count(*) as cnt from ' . Config::dbSurveyData() . '_lab where fielddbsstatus = 1'; $result = $db->selectQuery($query); if ($result != null) { $row = $db->getRow($result); if ($row['cnt'] > 0) { $returnStr .= $this->displayInfo(Language::labelNurseToShip($row["cnt"])); $returnStr .= '<a href="' . setSessionParams(array('page' => 'nurse.fielddbs.shiptolab')) . '" target="#">' . Language::labelNurseShipToLab() . '</a>'; $returnStr .= ' | '; $returnStr .= '<a href="' . setSessionParams(array('page' => 'nurse.fielddbs.shiptolab.marked')) . '">' . Language::labelNurseMarkShipped() . '</a>'; } else { $returnStr .= $this->displayInfo('There are currently no field DBS cards that need to be send to the lab'); } } $returnStr .= '<hr><b>' . Language::labelNurseLabName() . '</b><br/><br/>'; $returnStr .= '<a href="' . setSessionParams(array('page' => 'nurse.labblood.overview')) . '" target="#">' . Language::labelNurseLabBloodOverview() . '</a><br/>'; $returnStr .= '<a href="' . setSessionParams(array('page' => 'nurse.labdbs.overview')) . '" target="#">' . Language::labelNurseLabDBSOverview() . '</a><br/>'; //$returnStr .= ' | '; //$returnStr .= '<a href="' . setSessionParams(array('page' => 'nurse.fielddbs.shiptolab.marked')) . '">' . 'Mark these DBS cards as "shipped"' . '</a>'; } if (!isLabNurse(new User($_SESSION['URID']))) { //TEST $returnStr .= '<hr><b>' . Language::labelNurseTestLab() . '</b><br/><br/>'; $primkey = gen_password(10); $returnStr .= "<form method=post>"; $returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC($primkey, Config::directLoginKey())) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_LANGUAGE . ' value="' . '1' . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_URID . ' value="' . addslashes($_SESSION['URID']) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_MODE . ' value="' . MODE_CAPI . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_SUID . ' value="' . '3' . '">'; $returnStr .= '<button type="submit" id="startsurveybtn" class="btn btn-default navbar-btn" style="width:200px">' . Language::labelNurseStartSurvey() . '</button>'; $returnStr .= "</form>"; $primkey = gen_password(10); $returnStr .= "<form method=post>"; $returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC($primkey, Config::directLoginKey())) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_LANGUAGE . ' value="' . '1' . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_URID . ' value="' . addslashes($_SESSION['URID']) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_MODE . ' value="' . MODE_CAPI . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_SUID . ' value="' . '5' . '">'; $returnStr .= '<button type="submit" id="startsurveybtn" class="btn btn-default navbar-btn" style="width:200px">' . Language::labelNurseStartVision() . '</button>'; $returnStr .= "</form>"; $primkey = gen_password(10); $returnStr .= "<form method=post>"; $returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC($primkey, Config::directLoginKey())) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_LANGUAGE . ' value="' . '1' . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_URID . ' value="' . addslashes($_SESSION['URID']) . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_MODE . ' value="' . MODE_CAPI . '">'; $returnStr .= '<input type=hidden name=' . POST_PARAM_SUID . ' value="' . '6' . '">'; $returnStr .= '<button type="submit" id="startsurveybtn" class="btn btn-default navbar-btn" style="width:200px">' . Language::labelNurseAntropometrics() . '</button>'; $returnStr .= "</form>"; } } } //END TEST $returnStr .= '</p></div> </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(false); return $returnStr; }
function getPage() { global $logActions; if (getFromSessionParams('page') != null) { $_SESSION['LASTPAGE'] = getFromSessionParams('page'); } //echo '<br/><br/><br/>' . getFromSessionParams('page'); if (isVisionTestNurse(new User($_SESSION['URID']))) { return $this->mainPage(); //vision test: only return main page } $logActions->addAction(getFromSessionParams('primkey'), $this->user->getUrid(), getFromSessionParams('page')); if (startsWith(getFromSessionParams('page'), 'interviewer.sendreceive')) { $interviewer = new Interviewer($this->user); return $interviewer->getPage(); } else { if (isset($_SESSION['LASTPAGE'])) { switch ($_SESSION['LASTPAGE']) { case 'nurse.respondents.search': return $this->showSearchRes(); break; case 'nurse.interviewer.respondent.info': return $this->showRespondentInfo(getFromSessionParams('primkey')); break; case 'nurse.respondent.info': return $this->showRespondentInfo(getFromSessionParams('primkey')); break; case 'nurse.respondent.consent': return $this->showRespondentConsent(getFromSessionParams('primkey')); break; case 'nurse.respondent.consent.res': return $this->showRespondentConsentRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.labbarcode': return $this->showRespondentLabBarcode(getFromSessionParams('primkey')); break; case 'nurse.respondent.labbarcode.res': return $this->showRespondentLabBarcodeRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.barcode': return $this->showRespondentBarcode(getFromSessionParams('primkey')); break; case 'nurse.respondent.barcode.res': return $this->showRespondentBarcodeRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.picture': return $this->showRespondentTakePicture(getFromSessionParams('primkey')); break; case 'nurse.respondent.smallbarcodes.print': return $this->showRespondentLabSmallBarcodes(getFromSessionParams('primkey')); break; case 'nurse.respondent.trackingsheet.print': return $this->showRespondentPrintTrackingSheet(getFromSessionParams('primkey')); break; case 'nurse.respondent.labbarcode.print': return $this->showRespondentReprintLabBarcode(getFromSessionParams('primkey')); break; case 'nurse.respondent.uploadfiles': return $this->showRespondentUploadFiles(getFromSessionParams('primkey')); break; case 'nurse.respondent.download': return $this->showRespondentDownloadFile(getFromSessionParams('id')); break; case 'nurse.respondent.fielddbs.received': return $this->showRespondentFieldDBSReceived(getFromSessionParams('primkey')); break; case 'nurse.respondent.fielddbs.received.fromlab': return $this->showRespondentFieldDBSReceivedFromLab(getFromSessionParams('primkey')); break; case 'nurse.respondent.blood.received.fromlab': return $this->showRespondentBloodReceivedFromLab(getFromSessionParams('primkey')); break; case 'nurse.fielddbs.shiptolab': return $this->showRespondentFieldDBSShipToLab(); break; case 'nurse.fielddbs.shiptolab.marked': return $this->showRespondentFieldDBSShipToLabMark(); break; case 'nurse.backfromsms': return $this->showRespondentBackFromSms(getFromSessionParams('primkey'), getFromSessionParams('suid')); break; case 'nurse.surveycompleted': return $this->showSurveyCompleted(getFromSessionParams('primkey'), getFromSessionParams('suid')); break; case 'nurse.respondent.blood.storage': return $this->showRespondentBloodStorage(getFromSessionParams('primkey')); break; case 'nurse.respondent.blood.storage.res': return $this->showRespondentBloodStorageRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.dbs.storage': return $this->showRespondentDBSStorage(getFromSessionParams('primkey')); break; case 'nurse.respondent.dbs.storage.res': return $this->showRespondentDBSStorageRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.requestform': return $this->showRespondentLabRequest(getFromSessionParams('primkey')); break; case 'nurse.respondent.requestform.res': return $this->showRespondentLabRequestRes(getFromSessionParams('primkey')); break; case 'nurse.labblood.overview': return $this->showLabBloodOverview(); break; case 'nurse.labblood.overview.res': return $this->showLabBloodOverviewRes(); break; case 'nurse.labdbs.overview': return $this->showLabDbsOverview(); break; case 'nurse.labdbs.overview.res': return $this->showLabDbsOverviewRes(); break; case 'nurse.respondent.fielddbsoverview.edit': return $this->ShowFieldDBSChangeDates(getFromSessionParams('primkey')); break; case 'nurse.respondent.labblood.tolab': return $this->ShowRespondentBloodSendToLab(getFromSessionParams('primkey')); break; case 'nurse.respondent.cd4results': return $this->ShowRespondentCD4(getFromSessionParams('primkey')); break; case 'nurse.respondent.cd4results.res': return $this->ShowRespondentCD4Res(getFromSessionParams('primkey')); break; case 'nurse.respondent.assigntofieldnurse': return $this->ShowRespondentFieldNurseAssign(getFromSessionParams('primkey')); break; case 'nurse.respondent.assigntofieldnurse.res': return $this->ShowRespondentFieldNurseAssignRes(getFromSessionParams('primkey')); break; case 'nurse.respondent.fieldnurse.info': return $this->ShowRespondentFieldNurseInfo(getFromSessionParams('primkey')); break; case 'nurse.sendreceive.upload': return $this->showSendReceiveUploadData(); break; case 'nurse.followup': return $this->showFollowup(); break; case 'nurse.followup.info': return $this->ShowFollowupInfo(getFromSessionParams('primkey')); break; default: return $this->mainPage(); } } else { $logActions->addAction(getFromSessionParams('primkey'), $this->user->getUrid(), getFromSessionParams('nurse.home')); return $this->mainPage(); } } }