function do_exam() { $header = new header(); $header->lang('Làm bài test TOELF', 'toefl'); $this->load->view('toefl/exam/index'); $exam = $this->input->post(); $arr_true = $this->db->select('*')->from('toefl_reading')->get()->result_array(); $return_array = array(); foreach ($arr_true as $key) { array_push($return_array, $key['id_sentence'] . "_" . $key['id_true']); } $data['arr_true'] = $return_array; //start if if ($exam['type'] == 'reading') { switch ($exam['id']) { case '1_1': $data['title'] = ''; $this->load->view('toefl/exam/reading_1_1', $data); break; } } //end if if ($exam['type'] == 'default_login') { redirect('/'); } }