sebuahhobi

pembayaran-model

Dec 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.53 KB | None | 0 0
  1. //range 2018
  2.     function januari($id_mhs){
  3.         $this->db->select('count(*) as tgl');
  4.         $this->db->where('tgl_pembayaran >=', '2018-01-01');
  5.         $this->db->where('tgl_pembayaran <=', '2018-01-31');
  6.         $this->db->where('id_mhs',$id_mhs);
  7.         $bln1=$this->db->get('pembayaran');
  8.         foreach ($bln1->result() as $januari1) {
  9.             return $januari1->tgl;
  10.         }
  11.     }
  12.     function februari($id_mhs){
  13.         $this->db->select('count(*) as tgl');
  14.         $this->db->where('tgl_pembayaran >=', '2018-02-01');
  15.         $this->db->where('tgl_pembayaran <=', '2018-02-31');
  16.         $this->db->where('id_mhs',$id_mhs);
  17.         $bln=$this->db->get('pembayaran')->result();
  18.         foreach ($bln as $key) {
  19.             return $key->tgl;
  20.         }
  21.     }
  22.     function maret($id_mhs){
  23.         $this->db->select('count(*) as tgl');
  24.         $this->db->where('tgl_pembayaran >=', '2018-03-01');
  25.         $this->db->where('tgl_pembayaran <=', '2018-03-31');
  26.         $this->db->where('id_mhs',$id_mhs);
  27.         $bln=$this->db->get('pembayaran')->result();
  28.         foreach ($bln as $key) {
  29.             return $key->tgl;
  30.         }
  31.     }
  32.     function april($id_mhs){
  33.         $this->db->select('count(*) as tgl');
  34.         $this->db->where('tgl_pembayaran >=', '2018-04-01');
  35.         $this->db->where('tgl_pembayaran <=', '2018-04-31');
  36.         $this->db->where('id_mhs',$id_mhs);
  37.         $bln=$this->db->get('pembayaran')->result();
  38.         foreach ($bln as $key) {
  39.             return $key->tgl;
  40.         }
  41.     }
  42.     function mei($id_mhs){
  43.         $this->db->select('count(*) as tgl');
  44.         $this->db->where('tgl_pembayaran >=', '2018-05-01');
  45.         $this->db->where('tgl_pembayaran <=', '2018-05-31');
  46.         $this->db->where('id_mhs',$id_mhs);
  47.         $bln=$this->db->get('pembayaran')->result();
  48.         foreach ($bln as $key) {
  49.             return $key->tgl;
  50.         }
  51.     }
  52.     function juni($id_mhs){
  53.         $this->db->select('count(*) as tgl');
  54.         $this->db->where('tgl_pembayaran >=', '2018-06-01');
  55.         $this->db->where('tgl_pembayaran <=', '2018-06-31');
  56.         $this->db->where('id_mhs',$id_mhs);
  57.         $bln=$this->db->get('pembayaran')->result();
  58.         foreach ($bln as $key) {
  59.             return $key->tgl;
  60.         }
  61.     }
  62.     function juli($id_mhs){
  63.         $this->db->select('count(*) as tgl');
  64.         $this->db->where('tgl_pembayaran >=', '2018-07-01');
  65.         $this->db->where('tgl_pembayaran <=', '2018-07-31');
  66.         $this->db->where('id_mhs',$id_mhs);
  67.         $bln=$this->db->get('pembayaran')->result();
  68.         foreach ($bln as $key) {
  69.             return $key->tgl;
  70.         }
  71.     }
  72.     function agustus($id_mhs){
  73.         $this->db->select('count(*) as tgl');
  74.         $this->db->where('tgl_pembayaran >=', '2018-08-01');
  75.         $this->db->where('tgl_pembayaran <=', '2018-08-31');
  76.         $this->db->where('id_mhs',$id_mhs);
  77.         $bln=$this->db->get('pembayaran')->result();
  78.         foreach ($bln as $key) {
  79.             return $key->tgl;
  80.         }
  81.     }
  82.     function september($id_mhs){
  83.         $this->db->select('count(*) as tgl');
  84.         $this->db->where('tgl_pembayaran >=', '2018-09-01');
  85.         $this->db->where('tgl_pembayaran <=', '2018-09-31');
  86.         $this->db->where('id_mhs',$id_mhs);
  87.         $bln=$this->db->get('pembayaran')->result();
  88.         foreach ($bln as $key) {
  89.             return $key->tgl;
  90.         }
  91.     }
  92.     function oktober($id_mhs){
  93.         $this->db->select('count(*) as tgl');
  94.         $this->db->where('tgl_pembayaran >=', '2018-10-01');
  95.         $this->db->where('tgl_pembayaran <=', '2018-10-31');
  96.         $this->db->where('id_mhs',$id_mhs);
  97.         $bln=$this->db->get('pembayaran')->result();
  98.         foreach ($bln as $key) {
  99.             return $key->tgl;
  100.         }
  101.     }
  102.     function november($id_mhs){
  103.         $this->db->select('count(*) as tgl');
  104.         $this->db->where('tgl_pembayaran >=', '2018-11-01');
  105.         $this->db->where('tgl_pembayaran <=', '2018-11-31');
  106.         $this->db->where('id_mhs',$id_mhs);
  107.         $bln=$this->db->get('pembayaran')->result();
  108.         foreach ($bln as $key) {
  109.             return $key->tgl;
  110.         }
  111.     }
  112.     function desember($id_mhs){
  113.         $this->db->select('count(*) as tgl');
  114.         $this->db->where('tgl_pembayaran >=', '2018-12-01');
  115.         $this->db->where('tgl_pembayaran <=', '2018-12-31');
  116.         $this->db->where('id_mhs',$id_mhs);
  117.         $bln=$this->db->get('pembayaran')->result();
  118.         foreach ($bln as $key) {
  119.             return $key->tgl;
  120.         }
  121.     }
Add Comment
Please, Sign In to add comment