Esempio n. 1
0
 /** Specifies the contents of the add testinvite page */
 public function add()
 {
     $testsurveys = $this->testSurveyModel->get_all_testsurveys();
     $participants = $this->participantModel->get_all_participants(TRUE);
     $data['testsurveys'] = testsurvey_options($testsurveys);
     $data['participants'] = participant_options($participants);
     $data['page_title'] = lang('add_testinvite');
     $data['action'] = 'testinvite/add_submit/';
     $data = add_fields($data, 'testinvite');
     $this->load->view('templates/header', $data);
     $this->load->view('testinvite_edit_view', $data);
     $this->load->view('templates/footer');
 }
<?php 
echo form_open($action, array('class' => 'pure-form pure-form-aligned'));
echo form_fieldset($page_title);
?>

<?php 
if ($new_score) {
    echo form_dropdown_and_label('test', test_options($tests), $test_id);
    if (!empty($testcat_id)) {
        echo form_dropdown_and_label('testcat', testcat_options($testcats), $testcat_id);
    } else {
        echo form_dropdown_and_label('testcat', array(), array(), 'disabled');
    }
    if (!empty($testsurvey_id)) {
        echo form_dropdown_and_label('testsurvey', testsurvey_options($testsurveys), $testsurvey_id);
    } else {
        echo form_dropdown_and_label('testsurvey', array(), array(), 'disabled');
    }
    echo form_input_and_label('participant');
    echo form_hidden('participant_id', $participant_id);
} else {
    echo form_input_and_label('test', $test->name, 'readonly');
    echo form_input_and_label('testcat', testcat_code_name($testcat), 'readonly');
    echo form_input_and_label('participant', name($participant), 'readonly');
    echo form_input_and_label('testsurvey', testsurvey_when($testsurvey->whensent, $testsurvey->whennr), 'readonly');
}
?>

<?php 
echo form_input_and_label('score', $score, 'class="positive-integer"');
Esempio n. 3
0
 /** Filters the testsurveys by test on the add (single) page. */
 public function filter_testsurveys()
 {
     $test_id = $this->input->post('test_id');
     $testsurveys = $this->testSurveyModel->get_testsurveys_by_test($test_id);
     echo form_dropdown_and_label('testsurvey', testsurvey_options($testsurveys));
 }