Пример #1
0
 You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ------------------------------------------------------------------------
*/
require_once "../constants.php";
require_once "../functions.php";
require_once "../dbConfig.php";
require_once "../config.php";
require_once "../globals.php";
require_once "../user.php";
if (loadvar('r') != '') {
    getSessionParamsPost(loadvar('r'));
}
// include language
$_SESSION['SYSTEM_ENTRY'] = USCIC_SMS;
$l = getSMSLanguage();
if (file_exists("language/language" . getSMSLanguagePostFix($l) . ".php")) {
    require_once 'language_' . getSMSLanguagePostFix($l) . '.php';
} else {
    require_once 'language_en.php';
    // fall back on english language  file
}
$_SESSION['SYSTEM_ENTRY'] = USCIC_SURVEY;
// switch back to survey
class JumpBack
{
    function __construct()
    {
    }
    function getStates($suid, $prim, $stateid)
    {
Пример #2
0
        $returnStr .= $this->showBottomBar();
        $returnStr .= $this->showFooter(false);
        return $returnStr;
    }
    /*
      function showMainHouseholds($households, $message){

      //"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]

      $returnStr = $this->displayHeaderForTable(Language::messageSMSTitle(), $message);

      $returnStr .= '<div id="wrap">';
      $returnStr .= $this->showNavBar();
      $returnStr .= '<div class="container"><p>';

      $returnStr .= '<ol class="breadcrumb">';
      $returnStr .= '<li class="active">Home</li>';
      $returnStr .= '</ol>';

      //CONTENT
      $returnStr .= $message;

      if (sizeof($households) > 0) {
      $returnStr .= Language::messageSelectRespondent();
      $returnStr .= $this->showHouseholdsTable($households);
      }
      else {    $content .= '<tr><td colspan=3><b>HH members</b></td></tr>';

      $respondents = $household->getRespondents();
      foreach($respondents as $respondent){
      $content .= '<tr><td colspan=3>' . $respondent->getFirstname() . '</td></tr>';
      }

      $returnStr .= $this->displayWarning(Language::messageNoRespondentsAssigned(), "outcomehelp"); // '<div class="alert alert-warning" id="outcomehelp">' . Language::errorNoRespondentsAssigned() . '</div>';
      }

      //END CONTENT
      $returnStr .= '</p></div></div>   '; // </div>'; //container and wrap
      $returnStr .= $this->showBottomBar();

      $returnStr .= $this->showFooter(false);
      return $returnStr;
      }

     */
    /*
      function showHouseholdInfo($household){
      $content = $message;

      $content .= '<div class="row">';
      $content .= '<div class="col-6 col-sm-6 col-lg-5">';

      $content .= $this->showInfoHouseholdSub($household);
      $content .= '</div>';
      $content .= '<div class="col-6 col-sm-6 col-lg-5">';
      $content .= '<table>';
      $content .= '<tr><td style="width:100px">Status:</td><td style="width:200px">' . $this->displayStatus($household) . '</td></tr>';
      $content .= '<tr><td># of contacts:</td><td>' . sizeof($household->getContacts()) . '</td></tr>';

      $content .= '<tr><td colspan=2><hr></td></tr>';

      $content .= '<tr><td colspan=3><b>HH members</b></td></tr>';

      $respondents = $household->getRespondents();
      foreach($respondents as $respondent){
      $content .= '<tr><td colspan=3>' . $respondent->getFirstname() . '</td></tr>';
      }


      $content .= '</table>';
      $content .= '</div>';

      $content .= '</div>';
      $content .= '<hr>';
      $content .= '<hr>';


      $content .= '<table width=100%><tr><td>';
      $content .= '<form method=post>';
      $content .= setSessionParamsPost(array('page' => 'interviewer.household.addcontact', 'hhid' => $household->getHhid()));
      $content .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonAddContact() . '</button>';
      $content .= '</form>';
      $content .= '</td><td align=right>';

      if ($household->getStatus() != 2){
      $content .= '<form method=post>';
      $content .= setSessionParamsPost(array('page' => 'interviewer.household.startsurvey', 'hhid' => $household->getHhid()));
      $content .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonStartSurvey() . '</button>';
      $content .= '</form>';
      }
      $content .= '</td></tr></table>';
Пример #3
0
 function showOutputDataSingleSurvey()
 {
     $suid = loadvar('survey');
     if ($suid == "") {
         $suid = $_SESSION['SUID'];
     }
     $survey = new Survey($suid);
     $headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output'), Language::headerOutput()), 'label' => Language::headerOutput());
     $headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.data'), Language::headerOutputData()), 'label' => Language::headerOutputData());
     //$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.rawdata'), Language::headerOutputRawData()), 'label' => Language::headerOutputRawData());
     $headers[] = array('link' => '', 'label' => Language::headerOutputRawData());
     //$headers[] = array('link' => '', 'label' => Language::headerOutputRawDataSingle());
     $returnStr = $this->showOutputHeader($headers);
     $returnStr .= $this->displayComboBox();
     $returnStr .= "<form id=refreshform method=post>";
     $returnStr .= '<input type=hidden name=page value="sysadmin.output.datasingle">';
     $returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
     $returnStr .= "</form>";
     $returnStr .= '<form ' . POST_PARAM_NOAJAX . '=' . NOAJAX . ' id=surveyform method="post">';
     $returnStr .= setSessionParamsPost(array('page' => 'sysadmin.output.datasingleres'));
     /* DATA CRITERIA */
     //TODO:              limitToFields
     //TODO:      primkeys
     $returnStr .= '<span class="label label-default">' . Language::labelOutputDataSource() . '</span>';
     $returnStr .= '<div class="well well-sm">';
     $returnStr .= '<table>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataTable() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPE . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_OUTPUT_TYPE_DATARECORD_TABLE . ">" . Language::optionsDataDataRecordTable() . "</option>";
     $returnStr .= "<option value=" . DATA_OUTPUT_TYPE_DATA_TABLE . ">" . Language::optionsDataDataTable() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $user = new User($_SESSION['URID']);
     $modes = $user->getModes($suid);
     $langs = array();
     foreach ($modes as $m) {
         $langs = array_merge($langs, explode("~", $user->getLanguages($suid, $m)));
     }
     $langs = array_unique($langs);
     $returnStr .= '<tr><td>' . Language::labelOutputDataSurvey() . '</td><td>' . $this->displaySurveys(DATA_OUTPUT_SURVEY, DATA_OUTPUT_SURVEY, $suid, '', "") . '</td></tr>';
     $returnStr .= "<script type='text/javascript'>";
     $returnStr .= '$( document ).ready(function() {
                                             $("#' . DATA_OUTPUT_SURVEY . '").change(function (e) {
                                                 $("#' . SMS_POST_SURVEY . '_hidden").val(this.value);                                                     
                                                 $("#refreshform").submit();
                                             });
                                             })';
     $returnStr .= "</script>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataMode() . '</td><td>' . $this->displayModesAdmin(DATA_OUTPUT_MODES, DATA_OUTPUT_MODES, MODE_CAPI . "~" . MODE_CATI . "~" . MODE_CASI, "multiple", implode("~", $modes)) . '</td></tr>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataLanguage() . '</td><td>' . $this->displayLanguagesAdmin(DATA_OUTPUT_LANGUAGES, DATA_OUTPUT_LANGUAGES, implode("~", $langs), true, false, false, "multiple", implode("~", $langs)) . '</td></tr>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataType() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPEDATA . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_REAL . ">" . Language::optionsDataReal() . "</option>";
     $returnStr .= "<option value=" . DATA_TEST . ">" . Language::optionsDataTest() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelToolsCleanFrom() . ': </td><td>' . $this->displayDateTimePicker(DATA_OUTPUT_FROM, DATA_OUTPUT_FROM, "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td></tr><tr><td>' . Language::labelToolsCleanTo() . ': </td><td>' . $this->displayDateTimePicker(DATA_OUTPUT_TO, DATA_OUTPUT_TO, "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td></tr>';
     if (isset($_COOKIE['uscicvariablecookie'])) {
         $returnStr .= '<tr><td>' . Language::labelOutputDataVarlist() . '</td><td>';
         $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_SUBDATA . ">";
         $returnStr .= "<option value=" . SUBDATA_NO . ">" . Language::optionsSubDataNo() . "</option>";
         $returnStr .= "<option value=" . SUBDATA_YES . ">" . Language::optionsSubDataYes() . "</option>";
         $returnStr .= "</select>";
         $returnStr .= "</td></tr>";
     }
     $returnStr .= '<tr><td>' . Language::labelOutputDataCompleted() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_COMPLETED . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . INTERVIEW_NOTCOMPLETED . ">" . Language::optionsDataNotCompleted() . "</option>";
     $returnStr .= "<option value=" . INTERVIEW_COMPLETED . ">" . Language::optionsDataCompleted() . "</option>";
     $returnStr .= "</select></td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataClean() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_CLEAN . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_CLEAN . ">" . Language::optionsDataClean() . "</option>";
     $returnStr .= "<option value=" . DATA_DIRTY . ">" . Language::optionsDataDirty() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataKeepOnly() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_KEEP_ONLY . ">";
     $returnStr .= "<option value=" . DATA_KEEP_NO . ">" . Language::optionsDataKeepNo() . "</option>";
     $returnStr .= "<option value=" . DATA_KEEP_YES . ">" . Language::optionsDataKeepYes() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataHidden() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_HIDDEN . ">";
     $returnStr .= "<option value=" . DATA_NOTHIDDEN . ">" . Language::optionsDataNotHidden() . "</option>";
     $returnStr .= "<option value=" . DATA_HIDDEN . ">" . Language::optionsDataHidden() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '</table>';
     $returnStr .= '</div>';
     /* format */
     /*
      exportDirectory
      encoding
      outputType
     * 
     */
     $returnStr .= '<span class="label label-default">' . Language::labelOutputDataFormat() . '</span>';
     $returnStr .= '<div class="well well-sm">';
     $returnStr .= '<table>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataFileType() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_FILETYPE . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . FILETYPE_STATA . ">" . Language::optionsFileTypeStata() . "</option>";
     $returnStr .= "<option value=" . FILETYPE_CSV . ">" . Language::optionsFileTypeCSV() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataFileName() . '</td><td>';
     $returnStr .= "<div class='input-group'><input type=text class='form-control' name='" . DATA_OUTPUT_FILENAME . "' ><span class='input-group-addon'>" . Language::labelOutputDataFileNameNoExtension() . "</span></div>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataPrimaryKey() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_PRIMARY_KEY_IN_DATA . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . PRIMARYKEY_YES . ">" . Language::optionsPrimaryKeyInDataYes() . "</option>";
     $returnStr .= "<option value=" . PRIMARYKEY_NO . ">" . Language::optionsPrimaryKeyInDataNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataPrimaryKeyEncryption() . '</td><td>';
     $returnStr .= "<div class='input-group'><input type=text class='form-control' name='" . DATA_OUTPUT_PRIMARY_KEY_ENCRYPTION . "' ><span class='input-group-addon'>" . Language::labelOutputDataPrimaryKeyEncryptionNo() . "</span></div>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataNoData() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_VARIABLES_WITHOUT_DATA . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . VARIABLES_WITHOUT_DATA_YES . ">" . Language::optionsVariablesNoDataInDataYes() . "</option>";
     $returnStr .= "<option value=" . VARIABLES_WITHOUT_DATA_NO . ">" . Language::optionsVariablesNoDataInDataNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataFieldname() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_FIELDNAME_CASE . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . FIELDNAME_LOWERCASE . ">" . Language::optionsFieldnameLowerCase() . "</option>";
     $returnStr .= "<option value=" . FIELDNAME_UPPERCASE . ">" . Language::optionsFieldnameUpperCase() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataValueLabel() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_INCLUDE_VALUE_LABELS . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . VALUELABEL_YES . ">" . Language::optionsValueLabelsYes() . "</option>";
     $returnStr .= "<option value=" . VALUELABEL_NO . ">" . Language::optionsValueLabelsNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataValueLabelNumbers() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_INCLUDE_VALUE_LABEL_NUMBERS . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . VALUELABELNUMBERS_YES . ">" . Language::optionsValueLabelNumbersYes() . "</option>";
     $returnStr .= "<option value=" . VALUELABELNUMBERS_NO . ">" . Language::optionsValueLabelNumbersNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataMarkEmpty() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_MARK_EMPTY . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . MARKEMPTY_IN_VARIABLE . ">" . Language::optionsMarkEmptyInVariable() . "</option>";
     $returnStr .= "<option value=" . MARKEMPTY_IN_SKIP_VARIABLE . ">" . Language::optionsMarkEmptyInSkipVariable() . "</option>";
     $returnStr .= "<option value=" . MARKEMPTY_NO . ">" . Language::optionsMarkEmptyNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '</table>';
     $returnStr .= '</div>';
     $returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonDownload() . '"/>';
     $returnStr .= '</form>';
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }
Пример #4
0
 function showClean($content = "")
 {
     $returnStr = $this->showToolsHeader(Language::headerToolsCleaner());
     $returnStr .= $content;
     $surveys = new Surveys();
     $surveys = $surveys->getSurveys();
     if (sizeof($surveys) > 0) {
         $returnStr .= '<form method="post">';
         $returnStr .= setSessionParamsPost(array('page' => 'sysadmin.tools.cleanres'));
         $returnStr .= '<span class="label label-default">' . Language::labelToolsCleanSurveys() . '</span>';
         $returnStr .= '<div class="well well-sm">';
         $returnStr .= '<table>';
         foreach ($surveys as $survey) {
             $returnStr .= '<tr><td><label><input name=clean[] value="' . $survey->getSuid() . '" type="checkbox">' . $survey->getName() . '</label></td></tr>';
         }
         $returnStr .= '</table>';
         $returnStr .= '</div>';
         $returnStr .= '<span class="label label-default">' . Language::labelToolsCleanDataType() . '</span>';
         $returnStr .= '<div class="well well-sm">';
         $returnStr .= '<table>';
         $returnStr .= '<tr><td><label><input name=datatype[] value="' . SURVEY_EXECUTION_MODE_NORMAL . '" type="checkbox">' . Language::labelDataTypeNormal() . '</label></td></tr>';
         $returnStr .= '<tr><td><label><input name=datatype[] value="' . SURVEY_EXECUTION_MODE_TEST . '" type="checkbox">' . Language::labelDataTypeTest() . '</label></td></tr>';
         $returnStr .= '</table>';
         $returnStr .= '</div>';
         $returnStr .= '<span class="label label-default">' . Language::labelToolsCleanPeriod() . '</span>';
         $returnStr .= '<div class="well well-sm">';
         $returnStr .= '<table>';
         $returnStr .= '<tr><td>' . Language::labelToolsCleanFrom() . ': </td><td>' . $this->displayDateTimePicker("from", "from", "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td><td>' . Language::labelToolsCleanTo() . ': </td><td>' . $this->displayDateTimePicker("to", "to", "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td></tr>';
         $returnStr .= '</table>';
         $returnStr .= '</div>';
         $returnStr .= '<input type="submit" class="btn btn-default" ' . confirmAction(language::messageRemoveData(), 'REMOVE') . ' value="' . Language::buttonClean() . '"/>';
         $returnStr .= '</form>';
     } else {
         $returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
     }
     //END CONTENT
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }
Пример #5
0
    function showFollowupInfo($respondent, $message = '')
    {
        $returnStr = $this->showNurseHeader(Language::messageSMSTitle());
        $returnStr .= '<div id="wrap">';
        $returnStr .= $this->showNavBar();
        $returnStr .= '<div class="container"><p>';
        $returnStr .= '<ol class="breadcrumb">';
        //        $returnStr .= '<li>' . setSessionParamsHref(array('page' => 'nurse.home'), 'Home') . '</li>';
        $returnStr .= '<li class="active">' . Language::labelNurseFollowUp() . '</li>';
        $returnStr .= '</ol>';
        //CONTENT
        $returnStr .= $message;
        $returnStr .= '<table>';
        $returnStr .= '<tr><td>' . Language::labelNurseFollowUpPhone1() . '</td><td>' . getData($respondent->getPrimkey(), 'TG003', 2) . '</td></tr>';
        $returnStr .= '<tr><td>' . Language::labelNurseFollowUpPhone2() . '</td><td>' . getData($respondent->getPrimkey(), 'TG004', 2) . '</td></tr>';
        $returnStr .= '<tr><td>' . Language::labelNurseFollowUpHouseholdHead() . '</td><td>' . getData($respondent->getPrimkey(), 'TG008', 2) . '</td></tr>';
        $returnStr .= '<tr><td>' . Language::labelNurseFollowUpSomeoneElse() . '</td><td>' . getData($respondent->getPrimkey(), 'TG010', 2) . '</td></tr>';
        $returnStr .= '</table>';
        //CALL AND INFO
        $returnStr .= '<hr>';
        $refpage = 'nurse.followup';
        $returnStr .= '<form method=post>';
        $returnStr .= setSessionParamsPost(array('page' => $refpage . '.addcontactres', 'primkey' => $respondent->getPrimkey()));
        $returnStr .= '<input type="hidden" name="contactwith" id="contactwith" value="' . loadvar('contactwith') . '">';
        $returnStr .= '<table width=100%>';
        $returnStr .= '<tr><td style="width:80px">' . Language::labelNurseFollowUpDateTime() . '</td><td style="width:220px">';
        if (loadvar('contactts') != '') {
            $returnStr .= $this->displayDateTimePicker('contactts', 'contactts', loadvar('contactts'), getSMSLanguagePostFix(getSMSLanguage()), "true", "true", Config::usFormatSMS());
        } else {
            $returnStr .= $this->displayDateTimePicker('contactts', 'contactts', date('m/d/Y h:i a'), getSMSLanguagePostFix(getSMSLanguage()), "true", "true", Config::usFormatSMS());
        }
        $returnStr .= '</td><td colspan=2></td></tr>';
        $returnStr .= '<tr><td style="width:90px">' . Language::labelOutcome() . '</td><td valign=top colspan=2>';
        $returnStr .= '<select class="form-control" name=contactcode id=outcomecode style="width:300px"><option value=-1>' . Language::labelPleaseSelect() . '</option>';
        $dispositionCodes = Language::optionsDispositionFollowupContactCode($respondent);
        foreach ($dispositionCodes as $option => $dispositionCode) {
            if ($dispositionCode[5] == 1) {
                //display in dropdown
                $selected = '';
                if (loadvar('contactcode') == $option) {
                    $selected = ' SELECTED';
                }
                $returnStr .= '<option value="' . $option . '"' . $selected . '>' . $option . ': ' . $dispositionCode[1] . '</option>';
            }
        }
        $returnStr .= '</select></td><td>

    <div id="contactwithdiv" style="display: none"><table width=100%><tr><td style="width:90px">' . Language::labelContactWith() . '</td><td>

			<div id="selector" class="btn-group">

				<button type="button" class="btn btn-default" value=1>' . Language::labelHouseholdMember() . '</button>

				<button type="button" class="btn btn-default" value=2>' . Language::labelProxy() . '</button>

			</div></td></tr></table>

      <div id="contactperson" style="display: none"><table width=100%><tr><td style="width:90px">' . Language::labelProxyName() . '</td><td>

        <input type=text class="form-control" name="contactperson"></td></tr></table>

      </div>



    </div>';
        $returnStr .= '<tr><td valign=top>' . Language::labelRemark() . '</td><td colspan=3>';
        $returnStr .= '<textarea class="form-control" name="contactremark">' . loadvar('contactremark') . '</textarea>';
        $returnStr .= '</td></tr>';
        /*
         $returnStr .= '<tr><td style="width:80px">' . Language::labelAppointment() . '</td><td style="width:220px">';
         $returnStr .= $this->displayDateTimePicker('contactappointment', 'contactappointment', loadvar('contactappointment'), getSMSLanguagePostFix(getSMSLanguage()), "true", "true", Config::usHourFormatSMS());
         $returnStr .= '</td><td colspan=2></td></tr>';
        */
        $returnStr .= '</table>';
        $returnStr .= '<hr>';
        $returnStr .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonAddContact() . '</button>';
        $returnStr .= '</form> <b> OR </b>';
        $returnStr .= $this->showStartButton($respondent, 7, false, 'Start follup survey', false);
        $returnStr .= '<br/>';
        $returnStr .= '

<script>





$(document).ready(function() {

    $(\'#outcomecode\').change(function() {

        $(\'#contactwithdiv\').css("display", "none");

        var element = $(this).find(\'option\').filter(\':selected\').val();';
        $check = array();
        $followup = Language::optionsDispositionFollowupContactCode($respondent);
        foreach ($followup as $option => $follow) {
            if ($follow[0] == '1') {
                $check[] = $option;
            }
        }
        $returnStr .= 'if (element == "' . implode($check, '" || element == "') . '") {';
        //$returnStr .= 'alert("ADASD");';
        $returnStr .= '$(\'#contactwithdiv\').css("display", "block"); }';
        $returnStr .= '   switch(element){';
        $messageDispositionCodes = Language::optionsDispositionContactCode($respondentOrHousehold);
        foreach ($messageDispositionCodes as $option => $message) {
            $returnStr .= 'case "' . $option . '":  $( "#outcomehelp" ).html("' . addslashes($message[2]) . '"); break;';
        }
        $returnStr .= 'default: $( "#outcomehelp" ).html("' . addslashes(Language::messageSelectContactOutcome()) . '");';
        $returnStr .= '    }



    });



  $(\'#outcomecode\').change(); //in case reloaded page



});



$(\'#selector button\').click(function() {

    $(\'#contactperson\').css("display", "none");

    $(\'#selector button\').addClass(\'active\').not(this).removeClass(\'active\');

    $(\'#contactwith\').val("1");

    if ($(this).val() == "2") {

      $(\'#contactperson\').css("display", "block");

      $(\'#contactwith\').val("2");

    }

});

if ($(\'#contactwith\').val() == "2"){

  $(\'#selector button\').click();

}

</script>

';
        //END CONTENT
        $returnStr .= '</p></div>    </div>';
        //container and wrap
        $returnStr .= $this->showBottomBar();
        $returnStr .= $this->showFooter(false);
        return $returnStr;
    }
Пример #6
0
 function showAuxData()
 {
     $suid = loadvar('survey');
     if ($suid == "") {
         $suid = $_SESSION['SUID'];
     }
     $survey = new Survey($suid);
     $returnStr = $this->showResearchHeader(Language::messageSMSTitle());
     $returnStr .= '<div id="wrap">';
     $returnStr .= $this->showNavBar();
     $returnStr .= '<div class="container">';
     $returnStr .= '<ol class="breadcrumb">';
     $returnStr .= '<li>' . setSessionParamsHref(array('page' => 'researcher.data'), Language::linkData()) . '</li>';
     $returnStr .= '<li class="active">' . Language::labelShowAuxData() . '</li>';
     $returnStr .= '</ol>';
     $returnStr .= $this->displayComboBox();
     $returnStr .= "<form id=refreshform method=post>";
     $returnStr .= '<input type=hidden name=page value="researcher.data.auxiliarydata">';
     $returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
     $returnStr .= "</form>";
     $returnStr .= '<form ' . POST_PARAM_NOAJAX . '=' . NOAJAX . ' id=surveyform method="post">';
     $returnStr .= setSessionParamsPost(array('page' => 'researcher.data.auxiliarydatares'));
     $returnStr .= '<span class="label label-default">' . Language::labelOutputDataSource() . '</span>';
     $returnStr .= '<div class="well well-sm">';
     $returnStr .= '<table>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataTable() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPE . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_OUTPUT_TYPE_DATARECORD_TABLE . ">" . Language::optionsDataDataRecordTable() . "</option>";
     $returnStr .= "<option value=" . DATA_OUTPUT_TYPE_DATA_TABLE . ">" . Language::optionsDataDataTable() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataSurvey() . '</td><td>' . $this->displaySurveys(DATA_OUTPUT_SURVEY, DATA_OUTPUT_SURVEY, $suid, '', "") . '</td></tr>';
     $returnStr .= "<script type='text/javascript'>";
     $returnStr .= '$( document ).ready(function() {
                                             $("#' . DATA_OUTPUT_SURVEY . '").change(function (e) {
                                                 $("#' . SMS_POST_SURVEY . '_hidden").val(this.value);                                                     
                                                 $("#refreshform").submit();
                                             });
                                             })';
     $returnStr .= "</script>";
     $user = new User($_SESSION['URID']);
     $modes = $user->getModes($suid);
     $langs = array();
     foreach ($modes as $m) {
         $langs = array_merge($langs, explode("~", $user->getLanguages($suid, $m)));
     }
     $langs = array_unique($langs);
     $returnStr .= "<script type='text/javascript'>";
     $returnStr .= '$( document ).ready(function() {
                                             $("#' . DATA_OUTPUT_SURVEY . '").change(function (e) {
                                                 $("#' . SMS_POST_SURVEY . '_hidden").val(this.value);                                                     
                                                 $("#refreshform").submit();
                                             });
                                             })';
     $returnStr .= "</script>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataMode() . '</td><td>' . $this->displayModesAdmin(DATA_OUTPUT_MODES, DATA_OUTPUT_MODES, MODE_CAPI . "~" . MODE_CATI . "~" . MODE_CASI, "multiple", implode("~", $modes)) . '</td></tr>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataLanguage() . '</td><td>' . $this->displayLanguagesAdmin(DATA_OUTPUT_LANGUAGES, DATA_OUTPUT_LANGUAGES, implode("~", $langs), true, false, false, "multiple", implode("~", $langs)) . '</td></tr>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataType() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPEDATA . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_REAL . ">" . Language::optionsDataReal() . "</option>";
     $returnStr .= "<option value=" . DATA_TEST . ">" . Language::optionsDataTest() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelToolsCleanFrom() . ': </td><td>' . $this->displayDateTimePicker(DATA_OUTPUT_FROM, DATA_OUTPUT_FROM, "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td></tr><tr><td>' . Language::labelToolsCleanTo() . ': </td><td>' . $this->displayDateTimePicker(DATA_OUTPUT_TO, DATA_OUTPUT_TO, "", getSMSLanguagePostFix(getSMSLanguage()), "true", "true", "false") . '</td></tr>';
     if (isset($_COOKIE['uscicvariablecookie'])) {
         $returnStr .= '<tr><td>' . Language::labelOutputDataVarlist() . '</td><td>';
         $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_SUBDATA . ">";
         $returnStr .= "<option value=" . SUBDATA_NO . ">" . Language::optionsSubDataNo() . "</option>";
         $returnStr .= "<option value=" . SUBDATA_YES . ">" . Language::optionsSubDataYes() . "</option>";
         $returnStr .= "</select>";
         $returnStr .= "</td></tr>";
     }
     $returnStr .= '<tr><td>' . Language::labelOutputDataCompleted() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_COMPLETED . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . INTERVIEW_NOTCOMPLETED . ">" . Language::optionsDataNotCompleted() . "</option>";
     $returnStr .= "<option value=" . INTERVIEW_COMPLETED . ">" . Language::optionsDataCompleted() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataClean() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_CLEAN . ">";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . DATA_CLEAN . ">" . Language::optionsDataClean() . "</option>";
     $returnStr .= "<option value=" . DATA_DIRTY . ">" . Language::optionsDataDirty() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataKeepOnly() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_KEEP_ONLY . ">";
     $returnStr .= "<option value=" . DATA_KEEP_NO . ">" . Language::optionsDataKeepNo() . "</option>";
     $returnStr .= "<option value=" . DATA_KEEP_YES . ">" . Language::optionsDataKeepYes() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataHidden() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name=" . DATA_OUTPUT_HIDDEN . ">";
     $returnStr .= "<option value=" . DATA_NOTHIDDEN . ">" . Language::optionsDataNotHidden() . "</option>";
     $returnStr .= "<option value=" . DATA_HIDDEN . ">" . Language::optionsDataHidden() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '</table>';
     $returnStr .= '</div>';
     /* format */
     /*
      exportDirectory
      encoding
      outputType
     * 
     */
     $returnStr .= '<span class="label label-default">' . Language::labelOutputDataFormat() . '</span>';
     $returnStr .= '<div class="well well-sm">';
     $returnStr .= '<table>';
     $returnStr .= '<tr><td>' . Language::labelOutputDataFileName() . '</td><td>';
     $returnStr .= "<div class='input-group'><input type=text class='form-control' name='" . DATA_OUTPUT_FILENAME . "' ><span class='input-group-addon'>" . Language::labelOutputDataFileNameNoExtension() . "</span></div>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataPrimaryKey() . '</td><td>';
     $returnStr .= "<select class='selectpicker show-tick' name='" . DATA_OUTPUT_PRIMARY_KEY_IN_DATA . "'>";
     //$returnStr .= "<option></option>";
     $returnStr .= "<option value=" . PRIMARYKEY_YES . ">" . Language::optionsPrimaryKeyInDataYes() . "</option>";
     $returnStr .= "<option value=" . PRIMARYKEY_NO . ">" . Language::optionsPrimaryKeyInDataNo() . "</option>";
     $returnStr .= "</select>";
     $returnStr .= "</td></tr>";
     $returnStr .= '<tr><td>' . Language::labelOutputDataPrimaryKeyEncryption() . '</td><td>';
     $returnStr .= "<div class='input-group'><input type=text class='form-control' name='" . DATA_OUTPUT_PRIMARY_KEY_ENCRYPTION . "' ><span class='input-group-addon'>" . Language::labelOutputDataPrimaryKeyEncryptionNo() . "</span></div>";
     $returnStr .= "</td></tr>";
     $returnStr .= '</table>';
     $returnStr .= '</div>';
     $returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonDownload() . '"/>';
     $returnStr .= '</form>';
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }