oyazhuryachna

model_dyn_pivot_tabel

Apr 27th, 2016
2,826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class M_pivot_tabel extends CI_Model {
  4.  
  5.  
  6.  
  7.     public function __construct(){
  8.     parent::__construct();
  9.     }
  10.    
  11.    
  12.     public function TampilPivotPembayaran() {
  13.     $sql_query=$this->db->query('call rekap_bayaran()');;  
  14.             if($sql_query->num_rows()>0){
  15.                 return $sql_query->result_array();
  16.             }
  17.     }  
  18.  
  19.  
  20.     public function list_all_data($tabel){
  21.     $sql_query=$this->db->get($tabel); 
  22.             if($sql_query->num_rows()>0){
  23.                 return $sql_query->result_array();
  24.             }      
  25.     }
  26.  
  27.  
  28.     public function simpan(){
  29.     $data=array(
  30.     'nis'=>$this->input->post('nis'),
  31.     'id_tagihan'=>$this->input->post('id_tagihan'),
  32.     'tgl_bayar'=>date('Y-m-d')
  33.     );
  34.     $this->db->insert('tbl_pembayaran',$data); 
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment