Flatten mockup repo
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
|
||||
if (isset($prm['card']))
|
||||
{
|
||||
$sql = "SELECT Nat_BankID, Nat_BankName
|
||||
FROM nat_bank WHERE Nat_BankIsCard = 'Y' AND Nat_BankIsActive = 'Y' ORDER BY Nat_BankName ASC";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
}
|
||||
else if (isset($prm['edc']))
|
||||
{
|
||||
$sql = "SELECT Nat_BankID, Nat_BankName
|
||||
FROM nat_bank WHERE Nat_BankIsEDC = 'Y' AND Nat_BankIsActive = 'Y' ORDER BY Nat_BankName ASC";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT Nat_BankID, Nat_BankName
|
||||
FROM nat_bank WHERE Nat_BankIsActive = 'Y' ORDER BY Nat_BankName ASC";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
}
|
||||
|
||||
// $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