<?php

class BankTransactionSetup
{

    /*************************************************
     * / This function add new Bank Setup
     *************************************************/

    public static function AddBankTransactionSetup($data)
    {
        global $db;

        $id = $db->query_insert(TABLE_BANKTRANSACTIONSETUP, $data);
        if ($db->affected_rows > 0) {
            //$db->query_insert("vrs_logs", $data);
            return $id;
        } else {
            return false;
        }

    } // AddBankTransaction

    /*************************************************
     * / This function update BankTransaction
     *************************************************/

    public static function UpdateBankTransactionSetup($pid, $data)
    {
        global $db;

        $id = $db->query_update(TABLE_BANKTRANSACTIONSETUP, $data, "id='$pid'");

        if ($db->affected_rows > 0) {
            //$db->query_insert("vrs_logs", $data);
            return $id;
        } else {
            return $id;
        }

    } // UpdateBankTransaction


    public static function GetBankTransactionSetupById($id)
    {

        global $db;
        $query = "SELECT * from " . TABLE_BANKTRANSACTIONSETUP . " WHERE id ='$id'";
        //print($query);exit;
        $rows = $db->query_first($query);

        if ($db->affected_rows > 0) {

            return $rows;
        } else {

            return false;
        }
    }//BankTransaction

    public static function GetOpeningbalance($filter = "", $pageno = "null", $pagesize = "null")
    {

        global $db;
        $query = "SELECT * from " . TABLE_BANKTRANSACTIONSETUP . " " . $filter;
        //print($query);exit;
        $rows = $db->fetch_all_array($query, $pageno, $pagesize);

        if ($db->affected_rows > 0) {

            return $rows;
        } else {

            return false;
        }
    }//BankTransaction

    /**********************************************************
     * / This function will return BankTransactionSetup
     **********************************************************/

    public static function GetBankTransactionSetupList($filter = "", $pageno = "null", $pagesize = "null")
    {

        global $db;
        $query = "SELECT * from " . TABLE_BANKTRANSACTIONSETUP . " " . $filter;
        //print($query);exit;
        $rows = $db->fetch_all_array($query, $pageno, $pagesize);

        if ($db->affected_rows > 0) {

            return $rows;
        } else {

            return false;
        }
    }//BankSetup

    public static function GetNumRows()
    {
        global $db;
        return $db->GetNumRows();
    }

    public static function GetNumberOfPages()
    {
        global $db;
        return $db->GetNumberOfPages();
    }


}

?>
