Advertisement
jamboljack

Wisuda Model

Feb 27th, 2015
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. class Wisuda_model extends CI_Model {  
  2.     function __construct() {
  3.         parent::__construct(); 
  4.     }
  5.    
  6.     function getFakultasList() {
  7.         $result = array();
  8.         $this->db->from('umk_m_fakultas');
  9.         $this->db->where('fakultas_trash', 0);
  10.         $this->db->where('fakultas_status', 0);
  11.         $this->db->order_by('fakultas_id','asc');
  12.         $array_keys_values = $this->db->get();
  13.         foreach ($array_keys_values->result() as $row)
  14.         {
  15.             $result['']= '- Pilih Fakultas -';
  16.             $result[$row->fakultas_id] = $row->fakultas_name;
  17.         }
  18.  
  19.         return $result;
  20.     }
  21.  
  22.     function getProgdiList(){
  23.         $fakultas_id = $this->input->post('fakultas_id');
  24.        
  25.         $result = array();
  26.         $this->db->select('*');
  27.         $this->db->from('umk_progdi');
  28.         $this->db->where('fakultas_id', $fakultas_id);
  29.         $this->db->order_by('progdi_id','asc');
  30.         $array_keys_values = $this->db->get();
  31.         foreach ($array_keys_values->result() as $row)
  32.         {
  33.             $result['']= '- Pilih Program Studi -';
  34.             $result[$row->progdi_id] = $row->progdi_name;
  35.         }
  36.  
  37.         return $result;
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement