示例#1
0
 public function renderTestRow($id, $label, $selectedRecord, $selectedEvent)
 {
     // Make a dropdown that contains all record_ids.
     $data = REDCap::getData('array', NULL, REDCap::getRecordIdField());
     //error_log("data: ".print_r($data,true));
     foreach ($data as $record_id => $arr) {
         $record_id_options[$record_id] = $record_id;
     }
     // Get all Events
     $events = REDCap::getEventNames(TRUE, FALSE);
     $row = RCView::tr(array(), RCView::td(array('class' => 'td1'), self::insertHelp('test')) . RCView::td(array('class' => 'td2'), "<label for='test-{$id}'><b>{$label}:</b></label>") . RCView::td(array('class' => 'td3'), RCView::span(array(), "Test logic using " . REDCap::getRecordIdField() . ":" . RCView::select(array('id' => "test_record-{$id}", 'name' => "test_record-{$id}", 'class' => "tbi x-form-text x-form-field", 'style' => 'height:20px;border:0px;', 'onchange' => "testLogic('{$id}');"), $record_id_options, $selectedRecord)) . RCView::span(array('style' => 'display:' . (REDCap::isLongitudinal() ? 'inline;' : 'none;')), " of event " . RCView::select(array('id' => "test_event-{$id}", 'name' => "test_event-{$id}", 'class' => "tbi x-form-text x-form-field", 'style' => 'height:20px;border:0px;', 'onchange' => "testLogic('{$id}');"), $events, $selectedEvent)) . RCView::span(array(), RCView::button(array('class' => 'jqbuttonmed ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only', 'onclick' => 'testLogic("' . $id . '");', 'style' => 'margin:0px 10px;'), 'Test') . RCView::span(array('id' => 'result-' . $id)))));
     return $row;
 }