[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
software bumsil
/
APLIKASI SIMAKU
/
unb.simaku.net
/
unb.simaku.net
/
application
/
models
/
[
Home
]
File: Mpenerimaan.php
<?php class Mpenerimaan extends CI_Model { public function cek_last_batch(){ $this->db->select('batch'); $this->db->group_by('batch'); $this->db->order_by('batch','desc'); $q = $this->db->get('tbl_penyetor_penerimaan'); if ($q->num_rows()>0){ return $q->row(0)->batch; }else{ return null; } } public function notyet_posting() { $this->db->where('is_posting',0); return $this->db->get('tbl_penyetor_penerimaan'); } public function posting() { $this->db->select('SUM(jumlah) as total,batch'); $this->db->where('is_posting',1); $this->db->group_by('batch'); return $this->db->get('tbl_penyetor_penerimaan'); } public function get_batch_notyet_posting() { $this->db->group_by('batch'); $q = $this->notyet_posting(); if($q->num_rows()>0){ return $q->row(0)->batch; }else{ return ''; } } public function update_notyet_posting($upd) { $this->db->where('is_posting',0); $this->db->update('tbl_penyetor_penerimaan',$upd); } public function update_posting($batch,$upd) { $this->db->where('batch',$batch); $this->db->update('tbl_penyetor_penerimaan',$upd); } public function get_name_by_batch($batch) { $this->db->where('batch',$batch); return $this->db->get('tbl_penyetor_penerimaan'); } }