aries_

chain_model

Jul 30th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. Class Chain_combo extends CI_Model{
  3.         function __construct()
  4.         {
  5.             parent::__construct();
  6.             $this->load->database();
  7.         }
  8.  
  9.       function Get_stream (){
  10.         $result = array();
  11.         $this->db->select('*');
  12.         $this->db->from('stream');
  13.         $this->db->order_by('STREAM','ASC');
  14.         $array_keys_values = $this->db->get();
  15.         foreach ($array_keys_values->result() as $row)
  16.         {
  17.             $result[0]= '-Pilih Stream-';
  18.             $result[$row->STREAM]= $row->STREAM;
  19.         }
  20.  
  21.         return $result;
  22.         }
  23.          function Get_train (){
  24.             $stream = $this->input->post('stream');
  25.              $result = array();
  26.         $this->db->select('*');
  27.         $this->db->from('materi_training');
  28.                 $this->db->where('STREAM',$stream);
  29.         $this->db->order_by('KODE_M','ASC');
  30.         $array_keys_values = $this->db->get();
  31.         foreach ($array_keys_values->result() as $row)
  32.         {
  33.             $result[0]= '-Pilih Materi-';
  34.             $result[$row->KODE_M]= $row->NAMA_M_TRAINING;
  35.         }
  36.  
  37.         return $result;
  38.         }
  39.  
  40.  
  41.     }
  42.   ?>
Advertisement
Add Comment
Please, Sign In to add comment