Advertisement
jamboljack

Statistik Model

Dec 15th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Statistik_model extends CI_Model {
  4.    
  5.     function __construct() {
  6.         parent::__construct(); 
  7.     }
  8.    
  9.     function select_kegiatan() {
  10.         $this->db->select('*');
  11.         $this->db->from('ft_kegiatan');                  
  12.         $this->db->order_by('kegiatan_id', 'asc');
  13.        
  14.         return $this->db->get();
  15.     }
  16.  
  17.     function select_by_kegiatan($kegiatan_id) {
  18.         $this->db->select('COUNT(alumni_nim) as total FROM ft_alumni');
  19.         $this->db->where('kegiatan_id', $kegiatan_id);     
  20.        
  21.         return $this->db->get();
  22.     }                  
  23. }
  24. /* Location: ./application/model/statistik_model.php */
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement