db->where("pusat_idpusat", $idpusat); } return $this->db->get("voucer"); } function getData($idvoucer) { $this->db->where("idvoucer", $idvoucer); return $this->db->get("voucer"); } function get_anggota($id, $idpusat = null) { $this->db->join("voucer_user", "voucer_user.data_user_iddata_user = data_user.iddata_user AND voucer_user.voucer_idvoucer = ".$id,"left"); $this->db->where("data_user.status_anggota", 1); if ($idpusat != null || $idpusat != "") { $this->db->where("data_user.pusat_idpusat", $idpusat); } return $this->db->get("data_user"); } public function get_voucer_anggota($iduser=null, $idvoucer = null, $status_voucer = null, $idpemesanan = null) { if ($idpemesanan != null) { $this->db->where("pemesanan_idpemesanan", $idpemesanan); } if ($iduser != null) { $this->db->where("data_user_iddata_user", $iduser); } if ($idvoucer != null) { $this->db->where("voucer_idvoucer", $idvoucer); } if ($status_voucer != null) { $this->db->where("status_voucer", $status_voucer); } $this->db->join("voucer", "voucer.idvoucer = voucer_user.voucer_idvoucer"); return $this->db->get("voucer_user"); } }