當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Survey::getResponseStatus方法代碼示例

本文整理匯總了PHP中Survey::getResponseStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP Survey::getResponseStatus方法的具體用法?PHP Survey::getResponseStatus怎麽用?PHP Survey::getResponseStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Survey的用法示例。


在下文中一共展示了Survey::getResponseStatus方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 //Collect form names and form menu names into arrays
 $form_info = array();
 foreach ($Proj->eventsForms[$row['event_id']] as $this_form) {
     $form_info[$this_form]['form_menu_description'] = $Proj->forms[$this_form]['menu'];
     $form_info[$this_form]['form_status'] = '';
 }
 //Retrieve all known form status values for forms for this record
 $sql = "select distinct m.form_name, if(d2.value is null, '0', d2.value) as value \n\t\t\t\t\t\t\tfrom (redcap_data d, redcap_metadata m) left join redcap_data d2 \n\t\t\t\t\t\t\ton d2.project_id = m.project_id and d2.record = d.record and d2.event_id = d.event_id \n\t\t\t\t\t\t\tand d2.field_name = concat(m.form_name, '_complete')\n\t\t\t\t\t\t\twhere d.project_id = {$project_id} and d.project_id = m.project_id and d.record = '" . prep($row['record']) . "' \n\t\t\t\t\t\t\tand d.field_name = m.field_name and m.form_name in (" . prep_implode($Proj->eventsForms[$row['event_id']]) . ")\n\t\t\t\t\t\t\tand d.event_id = {$row['event_id']}";
 $q = db_query($sql);
 while ($row4 = db_fetch_assoc($q)) {
     $form_info[$row4['form_name']]['form_status'] = $row4['value'];
 }
 // Determine if record also exists as a survey response for some instruments
 $surveyResponses = array();
 if ($surveys_enabled) {
     $surveyResponses = Survey::getResponseStatus($project_id, $row['record'], $row['event_id']);
 }
 foreach ($form_info as $this_form => $attr) {
     // If it's a survey response, display different icons
     if (isset($surveyResponses[$row['record']][$row['event_id']][$this_form])) {
         //Determine color of button based on response status
         switch ($surveyResponses[$row['record']][$row['event_id']][$this_form]) {
             case '2':
                 $holder_color = 'tick_circle_frame.png';
                 break;
             default:
                 $holder_color = 'circle_orange_tick.png';
         }
     } else {
         //Determine color of button based on form status value
         switch ($attr['form_status']) {
開發者ID:hcv-target,項目名稱:redcap_plugins,代碼行數:31,代碼來源:calendar_popup.php

示例2: foreach

        foreach ($grid_form_status as $this_event_id => $these_forms) {
            ksort($instance_count[$this_event_id]);
            foreach ($these_forms as $this_form => $these_instances) {
                // Seed all defaults for this form
                $grid_form_status[$this_event_id][$this_form] = $instance_count[$this_event_id];
                // Add form instance
                foreach ($these_instances as $this_instance => $this_form_status) {
                    $grid_form_status[$this_event_id][$this_form][$this_instance] = $this_form_status;
                }
            }
        }
    }
    // Determine if this record also exists as a survey response for some instruments
    $surveyResponses = array();
    if ($surveys_enabled) {
        $surveyResponses = Survey::getResponseStatus($project_id, $id);
    }
    // Get Custom Record Label and Secondary Unique Field values (if applicable)
    if ($existing_record) {
        $this_custom_record_label_secondary_pk = "<span style='color:#800000;margin-left:3px;'>" . Records::getCustomRecordLabelsSecondaryFieldAllRecords(addDDEending($_GET['id']), false, $arm, true, '') . "</span>";
    } else {
        $this_custom_record_label_secondary_pk = "";
    }
    // JavaScript for setting floating table headers
    ?>
	<script type="text/javascript">
	$(function(){
		// Center the record ID name with the table
		var eg = $('#event_grid_table');
		if (eg.width() < 700) {
			$('#record_display_name').width( eg.width() );
開發者ID:hcv-target,項目名稱:redcap_mods,代碼行數:31,代碼來源:advanced-grid.php


注:本文中的Survey::getResponseStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。