Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- Class Chain_combo extends CI_Model{
- function __construct()
- {
- parent::__construct();
- $this->load->database();
- }
- function Get_stream (){
- $result = array();
- $this->db->select('*');
- $this->db->from('stream');
- $this->db->order_by('STREAM','ASC');
- $array_keys_values = $this->db->get();
- foreach ($array_keys_values->result() as $row)
- {
- $result[0]= '-Pilih Stream-';
- $result[$row->STREAM]= $row->STREAM;
- }
- return $result;
- }
- function Get_train (){
- $stream = $this->input->post('stream');
- $result = array();
- $this->db->select('*');
- $this->db->from('materi_training');
- $this->db->where('STREAM',$stream);
- $this->db->order_by('KODE_M','ASC');
- $array_keys_values = $this->db->get();
- foreach ($array_keys_values->result() as $row)
- {
- $result[0]= '-Pilih Materi-';
- $result[$row->KODE_M]= $row->NAMA_M_TRAINING;
- }
- return $result;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment