Initial import
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
class Bank extends MY_Controller
|
||||
{
|
||||
var $db_smartone;
|
||||
public function index()
|
||||
{
|
||||
echo "Bank API";
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->db_smartone = $this->load->database("onedev", true);
|
||||
}
|
||||
|
||||
|
||||
public function search()
|
||||
{
|
||||
$prm = $this->sys_input;
|
||||
|
||||
$sql = "select Nat_BankID, Nat_BankName
|
||||
from nat_bank
|
||||
where Nat_BankIsActive = 'Y'
|
||||
ORDER BY Nat_BankName";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
|
||||
if ($query) {
|
||||
$rows = $query->result_array();
|
||||
|
||||
$result = array("total" => 0, "records" => $rows, "total_display" => sizeof($rows));
|
||||
$this->sys_ok($result);
|
||||
}
|
||||
else {
|
||||
$this->sys_error_db("BANK rows",$this->db_smartone);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function search_account()
|
||||
{
|
||||
$prm = $this->sys_input;
|
||||
|
||||
$sql = "select M_BankAccountID, CONCAT(Nat_BankCode, ' no ', M_BankAccountNo) M_BankAccountNo
|
||||
from nat_bank
|
||||
JOIN m_bank_account ON M_BankAccountNat_BankID = Nat_BankID AND M_BankAccountIsActive = 'Y'
|
||||
where Nat_BankIsActive = 'Y'
|
||||
ORDER BY Nat_BankName";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
|
||||
if ($query) {
|
||||
$rows = $query->result_array();
|
||||
|
||||
$result = array("total" => 0, "records" => $rows, "total_display" => sizeof($rows));
|
||||
$this->sys_ok($result);
|
||||
}
|
||||
else {
|
||||
$this->sys_error_db("BANK rows",$this->db_smartone);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user