Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2. function infaq ($p=array(),$count=FALSE){
  3.         $total = 0;
  4.         $month = date('m');
  5.         $year = date('Y');
  6.         $tanggal= date('Y-m-d');
  7.  
  8.         // $this->db->select('transaksi.*');
  9.         // $this->db->where('trxDesc', 'DONASI');
  10.         // $this->db->where('(date(dateTransaction) >= '.$p['date_from'].' and date(dateTransaction) <= '.$p['date_to'].')');
  11.         // $this->db->where('produk', 'DONASI');
  12.         // $this->db->where('jenisProduk', 'INFAQ');
  13.         // $this->db->join('agent','agent.noreg=transaksi.noregAdminBmt','LEFT');
  14.  
  15.         $query = "SELECT *,t.namaLoket as username, a.namaLengkap as Baitull
  16.             FROM transaksi t
  17.             JOIN agent a on a.noregAdminBmt = t.noregAdminBmt
  18.             LEFT JOIN agent b ON b.namaLoket = t.namaLoket
  19.             where (date(dateTransaction) >= '".$p['date_from']."' and date(dateTransaction) <= '".$p['date_to']."')
  20.             AND jenisProduk = 'INFAQ'
  21.             AND produk = 'donasi'
  22.             AND a.namaLengkap LIKE '%Baitul Maal%' ";
  23.  
  24.             if (strlen($p['keyword']) > 0) {
  25.                 if ($p['keyword'] != '') {
  26.                     $query .= "and ".$p['column']." like '%".$p['keyword']."%'";
  27.                 }
  28.             }
  29.            
  30.         $result['query'] = $this->db->query($query);
  31.            
  32.  
  33.         $query = $this->db->query($query);
  34.  
  35.         if ($query) {
  36.             $result['jumlah_data'] = $query->num_rows();
  37.             $result['data'] = $query->result();
  38.             $result['query'] = $this->db->last_query();
  39.  
  40.             return $result;
  41.         }else {
  42.             return $this->db->_error_message();
  43.         }
  44.  
  45.  
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement