<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class M_anggota extends CI_Model{

  public function __construct()
  {
    parent::__construct();
    //Codeigniter : Write Less Do More
  }

  public function get_data($idpusat = null){
    if ($idpusat != null || $idpusat != "") {
      $this->db->where("pusat_idpusat",$idpusat);
    }
    return $this->db->get('data_user')->result();
  }

  public function getKurir()
  {
    return $this->db->get('kurir')->result();
  }

  function get_rek_tabungan($iddata_user)
  {
    $this->db->where("jenis_rekening_idjenis_rekening", "1");
    $this->db->where("data_user_iddata_user", $iddata_user);
    return $this->db->get("rekening_nasabah");
  }
  function get_rek_pinjaman($iddata_user)
  {
    $this->db->where("jenis_rekening_idjenis_rekening", "2");
    $this->db->where("data_user_iddata_user", $iddata_user);
    return $this->db->get("rekening_nasabah");
  }

  // public function get_filter($tgl_mulai,$tgl_akhir) //ditangkap disini
  // {
  //   $metode_pembayaran = 2;
  //   $this->db->join("data_user", "data_user.iddata_user = pemesanan.data_user_iddata_user");
  //   $this->db->join("kurir","kurir.idkurir=pemesanan.kurir_idkurir");
  //   $this->db->where('metode_pembayaran',$metode_pembayaran);
  //   $this->db->where('tanggal >=',$tgl_mulai);
  //   $this->db->where('tanggal <=',$tgl_akhir);
  //   return $this->db->get("pemesanan");
  // }



}
