当前位置: 首页>>代码示例>>PHP>>正文


PHP initWriteDB函数代码示例

本文整理汇总了PHP中initWriteDB函数的典型用法代码示例。如果您正苦于以下问题:PHP initWriteDB函数的具体用法?PHP initWriteDB怎么用?PHP initWriteDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了initWriteDB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($check_ip)
 {
     //initialize MDB2
     $this->_MDB2 = initDB();
     $this->_MDB2_WRITE = initWriteDB();
     $this->_ERROR_CODE = $check_ip;
     $this->class_name = get_class($this);
     $this->items = array();
     $arr = array('insertOrderTemp' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'OrderStyleID', 'MatchedQuantity', 'OrderSideName', 'StockExchangeID', 'OrderDate', 'CreatedBy'), 'output' => array('OrderTempID')), 'insertStockDetail' => array('input' => array('ConfirmNo', 'OrderNumber', 'AccountID', 'StockID', 'MatchedQuantity', 'MatchedPrice', 'OrderSideID', 'MatchedSession', 'TradingDate', 'CreatedBy'), 'output' => array('StockDetailID')), 'insertSellingOrderForTransactionExecute' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Session', 'OrderStyleID', 'Note', 'StockExchangeID', 'OrderDate', 'CreatedBy'), 'output' => array('ID')), 'insertBuyingOrderForTransactionExecute' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Session', 'OrderStyleID', 'Note', 'StockExchangeID', 'OrderDate', 'CreatedBy'), 'output' => array('ID')), 'insertBuyingOrderForTransactionExecuteWithoutBlockingMoney' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Session', 'OrderStyleID', 'Note', 'StockExchangeID', 'OrderDate', 'CreatedBy'), 'output' => array('ID')), 'insertBuyingOrderForTransactionExecuteWithReservingMoney' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Session', 'OrderStyleID', 'Note', 'StockExchangeID', 'OrderDate', 'CreatedBy'), 'output' => array('ID')), 'insertStockDetailOnline' => array('input' => array('ConfirmNo', 'OrderNumber', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'TradingDate', 'CreatedBy'), 'output' => array('ID')), 'insertStockDetailForExecuteTransaction' => array('input' => array('ConfirmNo', 'OrderNumber', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'TradingDate', 'CreatedBy'), 'output' => array('ID')), 'insertStockDetailForKLDK' => array('input' => array('ConfirmNo', 'OrderNumber', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'TradingDate', 'CreatedBy'), 'output' => array('ID')), 'updateOrderTemp' => array('input' => array('ID', 'AccountNo', 'OrderQuantity', 'OrderStyleID', 'Price'), 'output' => array()), 'executeStockOfBuyingDeal' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'executeStockOfSellingDeal' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'executeMoneyForSellingTransaction' => array('input' => array('TradingDate', 'UpdatedBy'), 'output' => array()), 'executeMoneyForBuyingTransaction' => array('input' => array('TradingDate', 'UpdatedBy'), 'output' => array()), 'executeMoneyForBuyingTransactionOfAccount' => array('input' => array('AccountID', 'AmountMoney', 'TradingDate', 'Updatedby'), 'output' => array()), 'executeEndTransaction' => array('input' => array('TradingDate'), 'output' => array()), 'confirmMatchedAgencyFee' => array('input' => array('TradingDate'), 'output' => array()), 'updateStockDetail' => array('input' => array('ID', 'OrderNumber', 'AccountNo', 'MatchedQuantity', 'UpdatedBy'), 'output' => array()), 'editBuyingOrderWhenExecTransaction' => array('input' => array('OrderID', 'OrderQuantity', 'OrderPrice', 'OrderStyleID', 'AccountNo', 'UpdatedBy'), 'output' => array()), 'editSellingOrderWhenExecTransaction' => array('input' => array('OrderID', 'OrderQuantity', 'OrderPrice', 'OrderStyleID', 'UpdatedBy'), 'output' => array()), 'listWarningOrderTemp' => array('input' => array('TradingDate', 'StockExchangeID'), 'output' => array('OrderTempID', 'OrderNumber', 'AccountNo', 'OrderSide', 'Symbol', 'OrderQuantity', 'OrderPrice', 'OrderStyleName', 'OrderDate', 'ExchangeName', 'StockExchangeID', 'OrderSideID', 'OrderStyleID', 'MatchedQuantity', 'Value')), 'getPrivateStockDetailWithoutConfirmList' => array('input' => array('OrderNumber', 'TradingDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'AccountNo', 'OrderSide', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'Note', 'TradingDate', 'StockExchangeID', 'OrderSideID')), 'getStockDetailWithoutConfirmList' => array('input' => array('OrderDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'AccountNo', 'OrderSide', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'TradingDate', 'StockExchangeID', 'OrderSideID', 'Note')), 'getOrderWithoutOrderNumberList' => array('input' => array('OrderDate', 'StockExchangeID'), 'output' => array('ID', 'OrderNumber', 'AccountNo', 'OrderSide', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Session', 'StatusName', 'OrderStyleName', 'FromName', 'StockExchangeID')), 'getStockDetailWithConfirmList' => array('input' => array('OrderDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'OrderSide', 'AccountNo', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'MatchedAgencyFee', 'Note', 'StockExchangeID')), 'getFullStockDetailWithConfirmList' => array('input' => array('OrderDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'OrderSide', 'AccountNo', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'MatchedAgencyFee', 'MatchedValue', 'Commission', 'LogMoney', 'TMoney', 'StockExchangeID')), 'getReportStockList' => array('input' => array('TradingDate'), 'output' => array('Symbol', 'Mua', 'Ban')), 'getStockDetailWithoutExecAgencyFeeList' => array('input' => array('TradingDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'AccountNo', 'OrderSide', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'Note', 'TradingDate', 'StockExchangeID', 'OrderSideID')), 'getStockDetailAfterExecMoney' => array('input' => array('TradingDate'), 'output' => array('ID', 'ConfirmNo', 'OrderNumber', 'OrderSide', 'AccountNo', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'MatchedSession', 'MatchedAgencyFee', 'Note', 'StockExchangeID')), 'checkOrderIsWarningOrNormal' => array('input' => array('OrderTempID'), 'output' => array()), 'getNextOrderNumber' => array('input' => array('TradingDate'), 'output' => array('OrderNumber')), 'getNextConfirmNo' => array('input' => array('TradingDate'), 'output' => array('ConfirmNo')), 'getAccountWithBuyingTransactionList' => array('input' => array('TradingDate'), 'output' => array('AccountID', 'AccountNo', 'AmountMoney')), 'getAuctionForXML' => array('input' => array('OrderDate', 'BankID'), 'output' => array('FileName')), 'getAllSellForXML' => array('input' => array('OrderDate', 'BankID'), 'output' => array('FileName')), 'getAllCancelBidForXML' => array('input' => array('OrderDate', 'BankID'), 'output' => array('FileName')), 'getDABLockMoneyFile' => array('input' => array(), 'output' => array('FileContent')), 'DABgetListOrderInfo' => array('input' => array('OrderDate'), 'output' => array('OrderID', 'AccountNo', 'Value')), 'DABgetResultFile' => array('input' => array('FileName'), 'output' => array('FileContent')), 'CheckTransaction' => array('input' => array(), 'output' => array()), 'getBuyInfo' => array('input' => array('OrderDate'), 'output' => array("AccountNo", "Amount")), 'getBuyInfoForChecking' => array('input' => array(), 'output' => array("AccountNo", "LogMoney")), 'getSellInfo' => array('input' => array('OrderDate'), 'output' => array("AccountNo", "Amount")), 'getSellInfoForChecking' => array('input' => array(), 'output' => array("AccountNo", "TMoney")), 'getBuyInfoForBravo' => array('input' => array('OrderDate'), 'output' => array("AccountNo", "Amount", "Fee", "BranchName")), 'getSellInfoForBravo' => array('input' => array('OrderDate'), 'output' => array("AccountNo", "Amount", "Fee", "BranchName")), 'getBuyInfoForBravoChecking' => array('input' => array(), 'output' => array("AccountNo", "LogMoney")), 'getSellInfoForBravoChecking' => array('input' => array(), 'output' => array("AccountNo", "TMoney")), 'editMoney' => array('input' => array('OrderID', 'NewValue'), 'output' => array()), 'cutMoney' => array('input' => array('OrderID'), 'output' => array()), 'insertMissingDeal' => array('input' => array('OrderNumber', 'AccountNo', 'Symbol', 'StockExchangeID', 'Quantity', 'Price', 'OrderSideID', 'Session', 'TradingDate', 'Note', 'CreatedBy'), 'output' => array('OrderID')), 'getOrderListToEditOrAuction' => array('input' => array('OrderID', 'AccountNo'), 'output' => array('ID', 'AccountNo', 'Symbol', 'OrderQuantity', 'OrderPrice', 'Note', 'OrderSide')), 'getMoneyBeforeCutting' => array('input' => array('OrderID'), 'output' => array('TotalAmount')), 'calculateAveragePrices' => array('input' => array(), 'output' => array()), 'getOrderTempMissingList' => array('input' => array('OrdeDate', 'IsValid', 'StockExchangeID'), 'output' => array('OrderID', 'OrderNumber', 'Symbol', 'AccountNo', 'OrderQuantity', 'OrderPrice', 'OrderSideName', 'OrderStyleID', 'OrderStyleName', 'StockExchangeID', 'StockExchange', 'OrderMissingStatus')), 'updateOrderTempMissing' => array('input' => array('OrderID', 'AccountNo'), 'output' => array()), 'updateOrderTempMissingIsValidField' => array('input' => array('OrderID'), 'output' => array()), 'changeOrderStatusToFailed' => array('input' => array('OrderID', 'CreatedBy'), 'output' => array()), 'deleteDeal' => array('input' => array('ID'), 'output' => array()), 'editDeal' => array('input' => array('ID', 'AccountNo', 'Quantity', 'CreatedBy'), 'output' => array()), 'getListStockDetailForExecTrans' => array('input' => array('TradingDate', 'AccountNo', 'StockExchangeID'), 'output' => array('ID', 'OrderNumber', 'AccountNo', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'OrderSideName', 'MatchedSession', 'MatchedAgencyFee', 'IsExist')), 'getStockBalanceListForTTBT' => array('input' => array('TradingDate', 'AccountNo'), 'output' => array('AccountNo', 'Symbol', 'T3Quantity', 'AccountID', 'StockID')), 'executeStockTTBTPrivateAccount' => array('input' => array('AccountID', 'StockID', 'T3Quantity', 'TradingDate'), 'output' => array('ID')), 'getAdditionCommission' => array('input' => array('TradingDate', 'UpdatedBy'), 'output' => array()), 'insertAdditionallyCommission' => array('input' => array('TradingDate', 'MinCommission', 'CreatedBy'), 'output' => array()), 'lockMoney' => array('input' => array('OrderID', 'Amount', 'AccountNo'), 'output' => array()), 'getMatchedOrderUnLocked' => array('input' => array(), 'output' => array('OrderID', 'AccountNo', 'Symbol')), 'getInvalidBankIDOfMatchedOrder' => array('input' => array(), 'output' => array('OrderID', 'AccountNo', 'Symbol')), 'getStockDetailWithoutConfirmForHOSE' => array('input' => array('TradingDate', 'TFlag'), 'output' => array('ID', 'OrderNumber', 'AccountNo', 'OrderSideName', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'Note', 'TradingDate', 'StockExchangeID', 'OrderSideID', 'OrderID', 'TFlag')), 'updateTFlagForHOSE' => array('input' => array('OrderID', 'TFlag', 'UpdatedBy'), 'output' => array()), 'updateTFlagForHNX' => array('input' => array('OrderID', 'TFlag', 'UpdatedBy'), 'output' => array()), 'getStockDetailWithoutConfirmForHNX' => array('input' => array('TradingDate', 'TFlag'), 'output' => array('ID', 'OrderNumber', 'AccountNo', 'OrderSideName', 'Symbol', 'MatchedQuantity', 'MatchedPrice', 'Note', 'TradingDate', 'StockExchangeID', 'OrderSideID', 'OrderID', 'TFlag')), 'getMatchedQuantityGreaterThanOrderQuantity' => array('input' => array(), 'output' => array('AccountNo', 'Symbol', 'OrderID', 'MatchedQuantity', 'OrderQuantity')), 'confirmBuyOrderForVirtualBank' => array('input' => array('TradingDate', 'BankID'), 'output' => array()), 'cancelBuyOrderForVirtualBank' => array('input' => array('TradingDate', 'BankID'), 'output' => array()), 'getListMatchNotCutMoney' => array('input' => array('TradingDate', 'BankID', 'AccountNo'), 'output' => array('AccountNo', 'LockID', 'AccountID', 'OrderID', 'Symbol', 'MatchedQuantity', 'Value', 'Commission')), 'getList4Unlock' => array('input' => array('TradingDate', 'BankID', 'AccountNo'), 'output' => array('AccountNo', 'AccountID', 'LockID', 'BidAmount', 'OrderID', 'OrderNumber', 'OrderPrice', 'OrderQuantity', 'Symbol', 'StatusName')), 'unLockForVirtualBank' => array('input' => array('AccountID', 'LockID', 'BankID', 'LockAmount', 'UpdatedBy'), 'output' => array()), 'checkAuctionForVirtualBank' => array('input' => array('TradingDate', 'BankID'), 'output' => array('OrderID', 'AccountNo', 'Symbol', 'Amount', 'BidAmount', 'Delta')), 'getAuctionForNVB' => array('input' => array('OrderDate'), 'output' => array()));
     parent::__construct($arr);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:11,代码来源:classExchange.php

示例2: CBank

 function CBank($check_ip)
 {
     //initialize _MDB2
     $this->_MDB2 = initDB();
     $this->_MDB2_WRITE = initWriteDB();
     $this->_ERROR_CODE = $check_ip;
     //$this->_TIME_ZONE = get_timezon();
     $this->items = array();
     $this->class_name = get_class($this);
     $arr = array('listBank' => array('input' => array('TimeZone'), 'output' => array('ID', 'BankName', 'ShortName', 'Phone', 'BankAddress', 'Fax', 'Email', 'MaximumLoanMoney', 'MinimumLoanMoney', 'MaximumPayMoney', 'MinimumPayMoney', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'listBankWithFilter' => array('input' => array('Where', 'TimeZone'), 'output' => array('ID', 'BankName', 'ShortName', 'Phone', 'BankAddress', 'Fax', 'Email', 'MaximumLoanMoney', 'MinimumLoanMoney', 'MaximumPayMoney', 'MinimumPayMoney', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'addBank' => array('input' => array('BankName', 'ShortName', 'Phone', 'BankAddress', 'Fax', 'Email', 'MaximumLoanMoney', 'MinimumLoanMoney', 'MaximumPayMoney', 'MinimumPayMoney', 'CreatedBy'), 'output' => array('ID')), 'updateBank' => array('input' => array('ID', 'BankName', 'ShortName', 'Phone', 'BankAddress', 'Fax', 'Email', 'MaximumLoanMoney', 'MinimumLoanMoney', 'MaximumPayMoney', 'MinimumPayMoney', 'UpdatedBy'), 'output' => array()), 'deleteBank' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'listBankLoan' => array('input' => array('TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'LoanPeriod', 'LoanInterestRate', 'OverdueInterestRate', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'listBankLoanWithFilter' => array('input' => array('Where', 'TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'LoanPeriod', 'LoanInterestRate', 'OverdueInterestRate', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'addBankLoan' => array('input' => array('BankID', 'LoanPeriod', 'LoanInterestRate', 'OverdueInterestRate', 'CreatedBy'), 'output' => array('ID')), 'updateBankLoan' => array('input' => array('ID', 'BankID', 'LoanPeriod', 'LoanInterestRate', 'OverdueInterestRate', 'UpdatedBy'), 'output' => array()), 'deleteBankLoan' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'listRate' => array('input' => array('TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'listRateWithFilter' => array('input' => array('Where', 'TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'addRate' => array('input' => array('BankID', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy'), 'output' => array('ID')), 'updateRate' => array('input' => array('ID', 'BankID', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'UpdatedBy'), 'output' => array()), 'deleteRate' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'listSpecialRate' => array('input' => array('TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'StockID', 'StockName', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'listSpecialRateWithFilter' => array('input' => array('Where', 'TimeZone'), 'output' => array('ID', 'BankID', 'BankName', 'StockID', 'StockName', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy', 'CreatedDate', 'UpdatedBy', 'UpdatedDate')), 'addSpecialRate' => array('input' => array('BankID', 'StockID', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'CreatedBy'), 'output' => array('ID')), 'updateSpecialRate' => array('input' => array('ID', 'BankID', 'StockID', 'FromValue', 'ToValue', 'PercentRate', 'UseMarketPrice', 'UpdatedBy'), 'output' => array()), 'deleteSpecialRate' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'getPercentRate' => array('input' => array('BankID', 'StockID', 'MarketPrice'), 'output' => array('PercentRate', 'UseMarketPrice')), 'getTransactionTypeList' => array('input' => array(), 'output' => array('ID', 'Name', 'Type', 'Description')), 'getTransactionList' => array('input' => array('TimeZone', 'WhereClause'), 'output' => array('ID', 'AccountID', 'AccountNo', 'InvestorName', 'Amount', 'IsConfirmed', 'TransactionStatus', 'TransTypeName', 'TransTypeID', 'BankID', 'BankName', 'TradingDate', 'CreatedBy', 'UpdatedBy', 'TransactionBankID', 'TransactionBankName', 'CreatedDate', 'UpdatedDate', 'Note', 'TransBankBravoCode')), 'getAccountBankInfo' => array('input' => array('AccountID', 'BankID'), 'output' => array('AccountID', 'BankID', 'BankAccount', 'Amount', 'LockAmount', 'UsableAmount')), 'insertDeposit' => array('input' => array('AccountID', 'BankID', 'TransactionBankID', 'Amount', 'DepositDate', 'Note', 'CreatedBy'), 'output' => array('ID')), 'deleteDeposit' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'cofirmDeposit' => array('input' => array('ID', 'UpdatedBy', 'TransactionBankID', 'TransactionBankBravoCode', 'AccountNo', 'Amount', 'Note'), 'output' => array()), 'insertWithdrawal' => array('input' => array('AccountID', 'BankID', 'TransactionBankID', 'Amount', 'WithdrawalDate', 'Note', 'CreatedBy'), 'output' => array('ID')), 'deleteWithdrawal' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'cofirmWithdrawal' => array('input' => array('ID', 'UpdatedBy', 'TransactionBankID', 'TransactionBankBravoCode', 'AccountNo', 'Amount', 'Note'), 'output' => array()), 'getBankList' => array('input' => array(), 'output' => array('BankID', 'BankName', 'ShortName')), 'getVirtualBankOfAccount' => array('input' => array('AccountNo'), 'output' => array('AccountID', 'AccountNo', 'BankID', 'BankName', 'BankShortName')), 'getBankListForWD' => array('input' => array(), 'output' => array('BankID', 'BankName', 'ShortName')), 'getBankListByType' => array('input' => array('Type'), 'output' => array('BankID', 'BankName', 'ShortName')), 'getBankListByType4Account' => array('input' => array('Type', 'AccountID '), 'output' => array('BankID', 'BankAccount', 'BankName', 'ShortName')), 'insertInternalTransfer' => array('input' => array('FromAccountID', 'ToAccountID', 'BankID', 'Amount', 'TransactionDate', 'Note', 'CreatedBy'), 'output' => array('ID')), 'deleteInternalTransfer' => array('input' => array('ID', 'UpdatedBy'), 'output' => array()), 'confirmInternalTransfer' => array('input' => array('ID', 'UpdatedBy', 'FromAccountNo', 'ToAccountNo', 'Amount'), 'output' => array()), 'getListInternalTransfer' => array('input' => array('TimeZone', 'WhereClause'), 'output' => array('ID', 'FromAccountID', 'FromAccountNo', 'FromInvestorName', 'ToAccountID', 'ToAccountNo', 'ToInvestorName', 'Amount', 'TransactionStatus', 'IsConfirmed', 'BankID', 'BankName', 'TradingDate', 'CreatedBy', 'UpdatedBy')), 'updateAllAdvRate' => array('input' => array('BankID', 'RateForBank', 'RateForEPS', 'MinAdvCommission'), 'output' => array('varError')), 'listAllAdvRate' => array('input' => array('BankID'), 'output' => array('BankID', 'BankName', 'ShortName', 'RateForBank', 'RateForEPS', 'MinAdvCommission')), 'ReportVirtualBank_ReportTransactionByAccount' => array('input' => array('BankID', 'AccountNo', 'FromDate', 'ToDate'), 'output' => array('TradingDate', 'TransName', 'Note', 'Amount', 'Type', 'TransactionBankName', 'ConfirmedDate', 'PrevBalance', 'CreatedBy', 'UpdatedBy', 'SortDate')), 'ReportVirtualBank_GetAccountBalanceByDate' => array('input' => array('BankID', 'AccountNo', 'FromDate', 'ToDate'), 'output' => array('PrevBalance', 'NextBalance', 'AccountNo', 'InvestorName')));
     parent::__construct($arr);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:12,代码来源:classBank.php

示例3: CBravoMoney

 function CBravoMoney($check_ip)
 {
     //initialize _MDB2
     $this->_MDB2 = initDB();
     $this->_MDB2_WRITE = initWriteDB();
     $this->_ERROR_CODE = $check_ip;
     //$this->_TIME_ZONE = get_timezon();
     $this->items = array();
     $this->class_name = get_class($this);
     $arr = array('SellingValueAndFeeListForBravo' => array('input' => array('TradingDate'), 'output' => array('AccountNo', 'Amount', 'Fee', 'Bank', 'BravoError', 'Tax')), 'SellingValueAndFeeListForBravoTDate' => array('input' => array('TradingDate'), 'output' => array('AccountNo', 'Amount', 'Fee', 'Bank', 'BravoError', 'Tax')), 'BuyingValueAndFeeListForBravo' => array('input' => array('TradingDate'), 'output' => array('AccountNo', 'Amount', 'Fee', 'Bank', 'BravoError')), 'PaidAdvanceForBravo' => array('input' => array('TradingDate'), 'output' => array('AccountNo', 'Amount', 'Fee', 'Bank', 'BravoError', 'BankID', 'OrderBankBravoCode')), 'CloseBravoAccount' => array('input' => array('AccountNo'), 'output' => array()));
     parent::__construct($arr);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:12,代码来源:classBravo.php

示例4: CVCB

 function CVCB($check_ip)
 {
     //initialize _MDB2
     //$this->_MDB2 = initDB() ;
     $this->_MDB2_WRITE = initWriteDB();
     //$this->_MDB2_WRITE1 = initWriteDB();
     //$this->_MDB2_WRITE2 = initWriteDB();
     $this->_ERROR_CODE = $check_ip;
     //$this->_TIME_ZONE = get_timezon();
     $this->items = array();
     $this->class_name = get_class($this);
     $arr = array('OpenAccount' => array('input' => array('PersonalCard', 'Name', 'Address', 'BankAccountNo', 'PartnerType', 'dtBirthDay', 'PlaceOfBirth', 'dtDateIssue', 'PlaceIssue', 'ZipCode', 'Country', 'Email', 'Phone', 'Fax', 'CompanyAddress', 'CompanyPhone', 'MailingAddress', 'MailingPhone'), 'output' => array('PersonalCard', 'Name', 'Account', 'State', 'ResponseCode', 'RespString', 'OldNewAccount')));
     parent::__construct($arr);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:14,代码来源:classVCB.php

示例5: insertBuyingOrderForTransactionExecuteWithReservingMoney

 /**
 	Function: insertBuyingOrderForTransactionExecuteWithReservingMoney
 */
 function insertBuyingOrderForTransactionExecuteWithReservingMoney($OrderNumber, $AccountNo, $Symbol, $OrderQuantity, $OrderPrice, $Session, $OrderStyleID, $Note, $StockExchangeID, $OrderDate, $CreatedBy)
 {
     $function_name = 'insertBuyingOrderForTransactionExecuteWithReservingMoney';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($OrderNumber) || !required($AccountNo) || !required($Symbol) || !required($OrderDate) || !required($OrderQuantity) || !unsigned($OrderQuantity) || !required($OrderPrice) || !required($Session) || !unsigned($Session) || !required($OrderStyleID) || !unsigned($OrderStyleID) || !required($StockExchangeID) || !unsigned($StockExchangeID)) {
         if (!required($OrderNumber)) {
             $this->_ERROR_CODE = 34410;
         }
         if (!required($AccountNo)) {
             $this->_ERROR_CODE = 34411;
         }
         if (!required($Symbol)) {
             $this->_ERROR_CODE = 34412;
         }
         if (!required($OrderQuantity) || !unsigned($OrderQuantity)) {
             $this->_ERROR_CODE = 34413;
         }
         if (!required($OrderPrice)) {
             $this->_ERROR_CODE = 34414;
         }
         if (!required($Session) || !unsigned($Session)) {
             $this->_ERROR_CODE = 34415;
         }
         if (!required($OrderDate)) {
             $this->_ERROR_CODE = 34416;
         }
         if (!required($OrderStyleID) || !unsigned($OrderStyleID)) {
             $this->_ERROR_CODE = 34417;
         }
         if (!required($StockExchangeID) || !unsigned($StockExchangeID)) {
             $this->_ERROR_CODE = 34418;
         }
     } else {
         $query = sprintf("CALL sp_insertBuyingOrderForTransactionExecute('%s', '%s', '%s', %u, %u, %u, %u, '%s', %u, '%s', '%s')", $OrderNumber, $AccountNo, $Symbol, $OrderQuantity, $OrderPrice, $Session, $OrderStyleID, $Note, $StockExchangeID, $OrderDate, $CreatedBy);
         $rs = $this->_MDB2_WRITE->extended->getRow($query);
         $this->_MDB2_WRITE->disconnect();
         if (empty($rs)) {
             $this->_ERROR_CODE = 34419;
         } else {
             $result = $rs['varerror'];
             if ($result < 0) {
                 switch ($result) {
                     case '-1':
                         $this->_ERROR_CODE = 34420;
                         break;
                     case '-2':
                         $this->_ERROR_CODE = 34421;
                         break;
                     case '-3':
                         $this->_ERROR_CODE = 34422;
                         break;
                     case '-4':
                         $this->_ERROR_CODE = 34423;
                         break;
                 }
             } else {
                 //block money in bank
                 $query = sprintf("SELECT * FROM vw_ListAccountBank_Detail WHERE AccountNo='%s' ORDER BY Priority ", $AccountNo);
                 $bank_rs = $this->_MDB2->extended->getAll($query);
                 if (strpos(PAGODA_ACCOUNT, $AccountNo) === false) {
                     $dab_rs = 999;
                     $isQuotaAccount = CheckIsQuotaAccount($AccountNo);
                     if ($isQuotaAccount != 0) {
                         // Neu khach hang su dung dich vu T2 thi chi giao dich voi bank NHHM
                         $BankID = NHHM;
                         $mdb = initWriteDB();
                         $query = sprintf("CALL sp_VirtualBank_Lock('%s', %u,  %u, %f, '%s', '%s')", $AccountNo, NHHM, $result, $rs['varordervalue'], $OrderDate, $CreatedBy);
                         $off_rs = $mdb->extended->getRow($query);
                         $mdb->disconnect();
                         $dab_rs = $off_rs['varerror'];
                     } else {
                         for ($i = 0; $i < count($bank_rs); $i++) {
                             switch ($bank_rs[$i]['bankid']) {
                                 case DAB_ID:
                                     $dab =& new CDAB();
                                     $dab_rs = $dab->blockMoney($bank_rs[$i]['bankaccount'], $bank_rs[$i]['cardno'], $AccountNo, $result, 1, $OrderDate);
                                     break;
                                 case VCB_ID:
                                     $dab =& new CVCB();
                                     $OrderID = $result . $rs['varunitcode'];
                                     $dab_rs = $dab->blockMoney($AccountNo, $OrderID, 1);
                                     break;
                                 case NVB_ID:
                                     $dab =& new CNVB();
                                     $dab_rs = $dab->blockMoney(substr($result . date("His"), 3), $bank_rs[$i]['bankaccount'], 1, $result);
                                     break;
                                 case OFFLINE:
                                     $query = sprintf("CALL sp_VirtualBank_Lock('%s', %u,  %u, %f, '%s', '%s')", $AccountNo, OFFLINE, $result, 1, $OrderDate, $CreatedBy);
                                     $this->_MDB2_WRITE->connect();
                                     $off_rs = $this->_MDB2_WRITE->extended->getRow($query);
                                     $this->_MDB2_WRITE->disconnect();
                                     $dab_rs = $off_rs['varerror'];
                                     break;
                             }
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classExchange.php

示例6: changeStatusFromTranferingToMatchedOrFailedForCancelOrderForHN

 /**
 	Function: changeStatusFromTranferingToMatchedOrFailedForCancelOrderForHN
 	Description: change Status
 	Input: Order id
 	Output: success / error code
 */
 function changeStatusFromTranferingToMatchedOrFailedForCancelOrderForHN($OrderID, $IsMatched, $AccountNo, $UpdatedBy)
 {
     $function_name = 'changeStatusFromTranferingToMatchedOrFailedForCancelOrderForHN';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($OrderID) || !unsigned($OrderID)) {
         $this->_ERROR_CODE = 30220;
     } else {
         if (intval($IsMatched) == 1) {
             $query = sprintf("SELECT o1.OrderQuantity, o1.OrderPrice, o1.OrderAgencyFee,\r\n\t\t\t\t\t\t\t\t\t\to2.OrderQuantity AS OlderQuantity, o2.OrderAgencyFee AS OldOrderAgencyFee,\r\n\t\t\t\t\t\t\t\t\t\to1.OldOrderID, o1.AccountID, o2.OrderSideID, o2.UnitCode, o2.BankID\r\n\t\t\t\t\t\t\t\t\t\tFROM %s o1, %s o2\r\n\t\t\t\t\t\t\t\t\t\tWHERE o1.ID=%u\r\n\t\t\t\t\t\t\t\t\t\tAND o1.Deleted='0'\r\n\t\t\t\t\t\t\t\t\t\tAND o2.Deleted='0'\r\n\t\t\t\t\t\t\t\t\t\tAND o1.OldOrderID=o2.ID\r\n\t\t\t\t\t\t\t\t\t\tAND o1.OrderStockStatusID=%u ", TBL_ORDER, TBL_ORDER, $OrderID, ORDER_TRANSFERING);
             $rs = $this->_MDB2->extended->getRow($query);
             //block money in bank
             $query = sprintf("SELECT vw_ListAccountBank_Detail.*\r\n\t\t\t\t\t\t\t\t\t\tFROM vw_ListAccountBank_Detail, %s\r\n\t\t\t\t\t\t\t\t\t\tWHERE AccountNo='%s'\r\n\t\t\t\t\t\t\t\t\t\tAND %s.Deleted='0'\r\n\t\t\t\t\t\t\t\t\t\tAND vw_ListAccountBank_Detail.AccountID = %s.AccountID\r\n\t\t\t\t\t\t\t\t\t\tAND vw_ListAccountBank_Detail.BankID = %u\r\n\t\t\t\t\t\t\t\t\t\tORDER BY Priority LIMIT 1", TBL_ORDER, $AccountNo, TBL_ORDER, TBL_ORDER, $rs['bankid']);
             $bank_rs = $this->_MDB2->extended->getRow($query);
             if ($rs['ordersideid'] == ORDER_BUY) {
                 if ($bank_rs['accountid'] == $rs['accountid']) {
                     //last Order
                     $oldTempFee = $rs['olderquantity'] * $rs['orderprice'] * $rs['oldorderagencyfee'];
                     $oldTempFee = $oldTempFee > 10000 ? $oldTempFee : 10000;
                     $oldOrderValue = $rs['olderquantity'] * $rs['orderprice'] + $oldTempFee;
                     $oldOrderValue = number_format($oldOrderValue, 0, ".", "");
                     //remain Quantity
                     $remainQuantity = $rs['olderquantity'] - $rs['orderquantity'];
                     $remainQuantity = number_format($remainQuantity, 0, ".", "");
                     //cancel Order
                     if ($remainQuantity > 0) {
                         //incompleted cancel
                         $tempCancelFee = $remainQuantity * $rs['orderprice'] * $rs['orderagencyfee'];
                         $tempCancelFee = $tempCancelFee > 10000 ? $tempCancelFee : 10000;
                         $cancelOrderValue = $remainQuantity * $rs['orderprice'] + $tempCancelFee;
                         $cancelOrderValue = number_format($cancelOrderValue, 0, ".", "");
                     } else {
                         //completed cancel
                         $cancelOrderValue = 0;
                     }
                     $cancelValue = $oldOrderValue - $cancelOrderValue;
                     if (strpos(PAGODA_ACCOUNT, $AccountNo) === false) {
                         switch ($bank_rs['bankid']) {
                             case DAB_ID:
                                 $dab =& new CDAB();
                                 $dab_rs = $dab->cancelBlockMoney($bank_rs['bankaccount'], $AccountNo, $rs['oldorderid'], $cancelValue);
                                 break;
                             case VCB_ID:
                                 $dab =& new CVCB();
                                 $oldOrderID = $rs['oldorderid'] . $rs['unitcode'];
                                 $suffix = date("His");
                                 $newOrderID = $rs['oldorderid'] . $suffix;
                                 if ($cancelOrderValue > 0) {
                                     $dab_rs = $dab->editBlockMoney($AccountNo, $oldOrderID, $newOrderID, $oldOrderValue, $cancelOrderValue, $function_name);
                                 } else {
                                     $dab_rs = $dab->cancelBlockMoney($AccountNo, $oldOrderID, $oldOrderValue);
                                 }
                                 break;
                             case NVB_ID:
                                 $dab =& new CNVB();
                                 $dab_rs = $dab->cancelBlockMoney(substr($rs['oldorderid'] . date("His"), 3), $bank_rs['bankaccount'], $cancelValue, $rs['oldorderid']);
                                 break;
                             case OFFLINE:
                                 $query = sprintf("CALL sp_VirtualBank_Cancel('%s', %u, %u, %f, '%s')", $AccountNo, OFFLINE, $rs['oldorderid'], $cancelValue, $UpdatedBy);
                                 $mdb = initWriteDB();
                                 $off_rs = $mdb->extended->getRow($query);
                                 $mdb->disconnect();
                                 $dab_rs = $off_rs['varerror'];
                                 break;
                         }
                         // switch
                     } else {
                         $dab_rs = 0;
                     }
                     if ($dab_rs != 0) {
                         //fail
                         $IsMatched = 0;
                         switch ($bank_rs['bankid']) {
                             case DAB_ID:
                                 switch ($dab_rs) {
                                     case '-1':
                                         $this->_ERROR_CODE = 41060;
                                         break;
                                     case '-2':
                                         $this->_ERROR_CODE = 41061;
                                         break;
                                     case '-3':
                                         $this->_ERROR_CODE = 41062;
                                         break;
                                     case '-4':
                                         $this->_ERROR_CODE = 41063;
                                         break;
                                     case '-5':
                                         $this->_ERROR_CODE = 41064;
                                         break;
                                     case '1':
                                         $this->_ERROR_CODE = 41065;
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classOrder.php

示例7: ConfirmBuyingStockForDividend_CutMoney

 /**
  * Function ConfirmBuyingStockForDividend_CutMoney	: Ke toan cat tien -- day dl qua Bravo -- cap nhat bankid khi cat tien thanh cong
  * Input 					: $EventID, $AccountID, $Today, $UpdatedBy
  * OutPut 					: error code. Return 0 if success else return error code (number >0).
  */
 function ConfirmBuyingStockForDividend_CutMoney($EventID, $AccountID, $UpdatedBy, $Today, $BankID)
 {
     try {
         $class_name = $this->class_name;
         $function_name = 'ConfirmBuyingStockForDividend_CutMoney';
         if (authenUser(func_get_args(), $this, $function_name) > 0) {
             return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
         }
         if (!required($EventID) || !numeric($EventID)) {
             $this->_ERROR_CODE = 22042;
         }
         if ($this->_ERROR_CODE == 0 && (!required($AccountID) || !numeric($AccountID))) {
             $this->_ERROR_CODE = 22005;
         }
         if ($this->_ERROR_CODE == 0 && (!required($Today) || !valid_date($Today))) {
             $this->_ERROR_CODE = 22056;
         }
         if ($this->_ERROR_CODE == 0) {
             $Withdrawal = $this->CheckConfirmBuyingStock_CutMoney($EventID, $AccountID, $Today);
             if ($Withdrawal['ErrorCode'] == '0') {
                 // money in bank
                 $query = sprintf("SELECT BankID, BankAccount, BravoCode FROM vw_ListAccountBank_Detail WHERE AccountID='%s' AND BankID ='%s' ", $AccountID, $BankID);
                 $this->_MDB2->disconnect();
                 $this->_MDB2->connect();
                 $bank_rs = $this->_MDB2->extended->getAll($query);
                 $dab_rs = 999;
                 $BankID = 0;
                 $TransactionType = BRAVO_BUYING_STOCK;
                 // phat hanh them cp
                 if ($Withdrawal['AccountNo'] != PAGODA_ACCOUNT) {
                     if (count($bank_rs) > 0) {
                         $i = 0;
                         $BankID = $bank_rs[$i]['bankid'];
                         $BravoCode = $bank_rs[$i]['bravocode'];
                         switch ($BankID) {
                             case DAB_ID:
                                 $dab =& new CDAB();
                                 $dab_rs = $dab->transfertoEPS($bank_rs[$i]['bankaccount'], $Withdrawal['AccountNo'], '3_' . $EventID . '_' . $AccountID, $Withdrawal['Amount'], "*Mua cp uu dai " . $Withdrawal['StockSymbol']);
                                 write_my_log_path('transfertoEPS', $function_name . ' BankAccount ' . $bank_rs[$i]['bankaccount'] . '  AccountNo ' . $Withdrawal['AccountNo'] . '  Event_AccountID ' . '3_' . $EventID . ' ' . $AccountID . '  Amount ' . $Withdrawal['Amount'] . " Decription *Mua cp uu dai " . $Withdrawal['StockSymbol'] . ' Error ' . $dab_rs, EVENT_PATH);
                                 break;
                             case OFFLINE:
                                 $mdb2 = initWriteDB();
                                 //`sp_VirtualBank_insertBuyingStockDivident`(inAccountID bigint, inBankID int, inAmount double,inTransactionDate date, inNote text(1000), inCreatedBy varchar(100))
                                 $query = sprintf("CALL sp_VirtualBank_insertBuyingStockDivident(%u, %u, %f, '%s', '%s', '%s' )", $AccountID, $BankID, $Withdrawal['Amount'], $Today, 'Mua cp uu dai  ' . $Withdrawal['StockSymbol'], $UpdatedBy);
                                 $rs = $mdb2->extended->getRow($query);
                                 $mdb2->disconnect();
                                 $dab_rs = $rs["varerror"];
                                 break;
                             default:
                                 $dab_rs = 0;
                         }
                     } else {
                         $dab_rs = 9999;
                         $this->_ERROR_CODE = 22155;
                         //TK k co TK Ngan hang nay
                     }
                 } else {
                     $TransactionType = BRAVO_BUYING_STOCK;
                     // phat hanh them cp
                     $dab_rs = 0;
                     $BankID = EXI_ID;
                 }
                 if ($dab_rs == 0) {
                     $soap =& new Bravo();
                     $Withdrawal_value = array("TradingDate" => $Today, 'TransactionType' => $TransactionType, "AccountNo" => $Withdrawal['AccountNo'], "Amount" => $Withdrawal['Amount'], "Bank" => $BravoCode, "Branch" => "", "Note" => "Mua cp gia uu dai " . $Withdrawal['StockSymbol']);
                     //'011C001458'
                     //var_dump($withdraw_value);
                     $ret = $soap->withdraw($Withdrawal_value);
                     if ($ret['table0']['Result'] == 1) {
                         $query = sprintf("CALL sp_UpdateDividendPrivilege_BankID ('%s','%s','%s','%s')", $BankID, $EventID, $AccountID, $UpdatedBy);
                         //echo $query;
                         $result = $this->_MDB2_WRITE->extended->getAll($query);
                         //Can not update
                         if (empty($result) || is_object($result)) {
                             $this->_ERROR_CODE = 22120;
                             write_my_log_path('ErrorCallStore', $query . '  ' . $result->backtrace[0]['args'][4], EVENT_PATH);
                         } else {
                             if (isset($result[0]['varerror'])) {
                                 //p_iDividentPrivilege sai hoac dang ky mua chua xac nhan hoac da cat tien roi
                                 if ($result[0]['varerror'] == -2) {
                                     $this->_ERROR_CODE = 22121;
                                 } else {
                                     if ($result[0]['varerror'] == -3) {
                                         //qua ngay cat tien
                                         $this->_ERROR_CODE = 22149;
                                     } else {
                                         if ($result[0]['varerror'] == -1) {
                                             //Exception
                                             $this->_ERROR_CODE = 22122;
                                         } else {
                                             if ($result[0]['varerror'] < 0) {
                                                 $this->_ERROR_CODE = 22134;
                                                 write_my_log_path($function_name, $query . '  VarError ' . $result[0]['varerror'], EVENT_PATH);
                                             }
                                         }
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classTradingRegister_old.php

示例8: cofirmWithdrawal

 function cofirmWithdrawal($ID, $UpdatedBy, $TransactionBankID, $TransactionBankBravoCode, $AccountNo, $Amount, $Note = "")
 {
     $function_name = 'cofirmWithdrawal';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($ID)) {
         $this->_ERROR_CODE = 13130;
     } else {
         $query = sprintf("CALL  sp_VirtualBank_confirmWithdrawal(%u, '%s' )", $ID, $UpdatedBy);
         $rs = $this->_MDB2_WRITE->extended->getRow($query);
         if (empty($rs)) {
             $this->_ERROR_CODE = 13131;
         } else {
             $result = $rs['varerror'];
             $content = date("d/m/Y H:i:s") . " Rut: ID => {$ID}, AccountNo => {$AccountNo}, Amount => {$Amount}, TransactionBankID => {$TransactionBankID}, TransactionBankBravoCode => {$TransactionBankBravoCode}, UpdatedBy => {$UpdatedBy} --> {$result}";
             write_log($function_name, $content, VIRTUAL_BANK_LOG_FILE_PATH);
             if ($result < 0) {
                 switch ($result) {
                     case '-1':
                         $this->_ERROR_CODE = 13132;
                         break;
                     case '-2':
                         $this->_ERROR_CODE = 13133;
                         break;
                     case '-3':
                         $this->_ERROR_CODE = 13134;
                         break;
                     case '-4':
                         $this->_ERROR_CODE = 13135;
                         break;
                     case '-5':
                         $this->_ERROR_CODE = 13136;
                         break;
                     default:
                         $this->_ERROR_CODE = $result;
                 }
                 //switch
             } else {
                 //if
                 $query = "SELECT mobilephone,ab.usableamount FROM " . TBL_INVESTOR;
                 $query .= " i INNER JOIN " . TBL_ACCOUNT . " a ON(i.id=a.investorId)";
                 $query .= " INNER JOIN " . TBL_ACCOUNT_BANK . " ab ON(a.id=ab.accountid)";
                 $query .= " WHERE a.accountNo='" . $AccountNo . "' AND ab.bankid=" . OFFLINE;
                 $mdb = initWriteDB();
                 $acc_rs = $mdb->extended->getRow($query);
                 $mdb->disconnect();
                 if (!empty($acc_rs['mobilephone'])) {
                     $message = 'Tai khoan cua quy khach tai KIS da thay doi: -' . number_format($Amount, 0, '.', ',') . '. ' . $Note;
                     $message .= '. So du hien tai la: ' . number_format($acc_rs['usableamount'], 0, '.', ',');
                     sendSMS(array('Phone' => $acc_rs['mobilephone'], 'Content' => $message));
                 }
                 $soap =& new Bravo();
                 if ($TransactionBankID == EPS_BANKID) {
                     $withdrawValue = array("TradingDate" => date("Y-m-d"), 'TransactionType' => WITHDRAW_AT_EPS, "AccountNo" => $AccountNo, "Amount" => $Amount, "Fee" => 0, "Bank" => $TransactionBankBravoCode, "Note" => $Note);
                 } else {
                     $withdrawValue = array("TradingDate" => date("Y-m-d"), 'TransactionType' => WITHDRAW_AT_OTHERS, "AccountNo" => $AccountNo, "Amount" => $Amount, "Fee" => 0, "Bank" => $TransactionBankBravoCode, "Note" => $Note);
                 }
                 $ret = $soap->withdraw($withdrawValue);
                 if ($ret['table0']['Result'] != 1) {
                     // success
                     switch ($ret['table0']['Result']) {
                         case '-2':
                             $this->_ERROR_CODE = 23002;
                             break;
                         case '-1':
                             $this->_ERROR_CODE = 23003;
                             break;
                         case '-13':
                             $this->_ERROR_CODE = 23006;
                             break;
                         case '-15':
                             $this->_ERROR_CODE = 23005;
                             break;
                         case '-16':
                             $this->_ERROR_CODE = 23004;
                             break;
                         default:
                             $this->_ERROR_CODE = 'Bravo' . $ret['table0']['Result'];
                     }
                     //switch
                 }
             }
         }
         //if WS
     }
     return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:89,代码来源:classBank_251.php

示例9: rollbackupdatePayment

 function rollbackupdatePayment($PaymentID, $UpdatedBy)
 {
     $mdbwrite2 = initWriteDB();
     $query1 = sprintf("CALL sp_rollbackupdatePayment (%s,'%s')", $PaymentID, $UpdatedBy);
     $result = $mdbwrite2->extended->getAll($query1);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:6,代码来源:classAdvancePaper.php

示例10: ConfirmExtraCollectDisbursement

 function ConfirmExtraCollectDisbursement($ID, $UpdatedBy)
 {
     $function_name = 'ConfirmExtraCollectDisbursement';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     $query = sprintf("CALL sp_ExtraCollectDisbursement_getInfo('%s')", $ID);
     $rs = $this->_MDB2->extended->getRow($query);
     $BankAccount = $rs['bankaccount'];
     $BankID = (int) $rs['bankid'];
     $BravoCode = (int) $rs['bravocode'];
     $Amount = $rs['amount'];
     $AccountNo = $rs['accountno'];
     $TradingDate = $rs['tradingdate'];
     $Note = $rs['note'];
     $TranTypeID = (int) $rs['trantypeid'];
     if ($BankAccount != '') {
         switch ($BankID) {
             case DAB_ID:
                 $dab =& new CDAB();
                 $refno = $AccountNo . "_" . $ID . "_" . date('Y-m-d');
                 if ($TranTypeID == 1) {
                     // Thu tien
                     $dab_rs = $dab->transfertoEPS($BankAccount, $AccountNo, $refno, $Amount, $Note);
                 } elseif ($TranTypeID == 2) {
                     // Chuyen tien
                     $dab_rs = $dab->transferfromEPS($BankAccount, $AccountNo, $refno, $Amount, $Note);
                 }
                 break;
             case OFFLINE:
                 $mdb = initWriteDB();
                 $query = sprintf("CALL sp_VirtualBank_ExtraCollectDisbursement(%u, '%s', '%s')", $ID, date("Y-m-d"), $UpdatedBy);
                 $offline_rs = $mdb->extended->getRow($query);
                 $mdb->disconnect();
                 if (PEAR::isError($offline_rs)) {
                     $this->_ERROR_CODE = 31500;
                 } else {
                     $result = $offline_rs['varerror'];
                     if ($result < 0) {
                         switch ($result) {
                             case '-1':
                                 $this->_ERROR_CODE = 31501;
                                 break;
                             case '-2':
                                 $this->_ERROR_CODE = 31502;
                                 break;
                             case '-3':
                                 $this->_ERROR_CODE = 31503;
                                 break;
                             case '-4':
                                 $this->_ERROR_CODE = 30624;
                                 // khong du tien
                                 break;
                             case '-5':
                                 $this->_ERROR_CODE = 31504;
                                 break;
                             case '-9':
                                 $this->_ERROR_CODE = 31505;
                                 break;
                         }
                         //switch
                     } else {
                         //if
                         $dab_rs = 0;
                     }
                 }
                 //if PEAR
                 break;
         }
         //switch
         if ($dab_rs == 0) {
             $query = sprintf("CALL sp_ExtraCollectDisbursement_Confirm(%u,'%s')", $ID, $UpdatedBy);
             $rs = $this->_MDB2_WRITE->extended->getRow($query);
             if ($rs['varerror'] < 0) {
                 switch ($rs['varerror']) {
                     case '-2':
                         $this->_ERROR_CODE = 31450;
                         break;
                 }
                 return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
             } else {
                 //update Bank
                 $soap =& new Bravo();
                 if ($TranTypeID == 1) {
                     // Thu tien
                     $transactionType = "M13.09";
                 } elseif ($TranTypeID == 2) {
                     // Chuyen tien
                     $transactionType = "M13.08";
                 }
                 $Deposit_value = array("TradingDate" => date('Y-m-d'), 'TransactionType' => $transactionType, "AccountNo" => $AccountNo, "Amount" => $Amount, "Bank" => $BravoCode, "Branch" => "", "Note" => $Note);
                 $ret = $soap->deposit($Deposit_value);
                 if ($ret['table0']['Result'] != 1) {
                     switch ($ret['table0']['Result']) {
                         case 0:
                             $this->_ERROR_CODE = 0;
                             break;
                         case -2:
                             //Error - bravo
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classMortage.php

示例11: insertCoSellOrder

 function insertCoSellOrder($CoAccountNo, $AccountNo, $StockID, $OrderQuantity, $OrderPrice, $Session, $FromTypeID, $Note, $OrderDate, $IsAssigner, $IsGotPaper, $CreatedBy, $AccountNoContra, $CompanyNameContra)
 {
     $function_name = 'insertCoSellOrder';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     $log[] = sprintf('insertCoSellOrder - CoAccountNo:%s;AccountNo:%s;StockID:%s;OrderQuantity:%s;OrderPrice:%s;Session:%s;FromTypeID:%s;Note:%s;OrderDate:%s;IsAssigner:%s;IsGotPaper:%s;CreatedBy:%s;AccountNoContra:%s;CompanyNameContra:%s;ExecutedTime:%s', $CoAccountNo, $AccountNo, $StockID, $OrderQuantity, $OrderPrice, $Session, $FromTypeID, $Note, $OrderDate, $IsAssigner, $IsGotPaper, $CreatedBy, $AccountNoContra, $CompanyNameContra, date('Y-m-d h:i:s'));
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         $log[] = sprintf('authenUser: ERROR_CODE: %s', $this->_ERROR_CODE);
         write_my_log_path("insertCoSellOrder", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/otc/');
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     $log[] = sprintf('authenUser: ERROR_CODE: %s', $this->_ERROR_CODE);
     // checking account is active / not
     if (!checkAccountIsActive($AccountNo) || !checkAccountIsActive($CoAccountNo)) {
         $this->_ERROR_CODE = 30275;
         $log[] = sprintf('checkAccountIsActive: ERROR_CODE: %s; AccountNo:%s,%s;CoAccountNo: %s,%s', $this->_ERROR_CODE, $AccountNo, checkAccountIsActive($AccountNo) ? 'TRUE' : 'FALSE', $CoAccountNo, checkAccountIsActive($CoAccountNo) ? 'TRUE' : 'FALSE');
         write_my_log_path("insertCoSellOrder", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/otc/');
         return returnXML(func_get_args(), $this->class_name, $function_name, 30275, $this->items, $this);
     }
     $log[] = sprintf('checkAccountIsActive: ERROR_CODE: %s; AccountNo:%s,%s;CoAccountNo: %s,%s', $this->_ERROR_CODE, $AccountNo, checkAccountIsActive($AccountNo) ? 'TRUE' : 'FALSE', $CoAccountNo, checkAccountIsActive($CoAccountNo) ? 'TRUE' : 'FALSE');
     if (!required($CoAccountNo) || !required($AccountNo) || !required($OrderDate) || !required($StockID) || !required($OrderQuantity) || !required($OrderPrice) || !required($Session) || !unsigned($OrderQuantity) || !unsigned($StockID)) {
         if (!required($AccountNo) || !required($CoAccountNo)) {
             $this->_ERROR_CODE = 30051;
         }
         if (!required($OrderDate)) {
             $this->_ERROR_CODE = 30052;
         }
         if (!required($StockID) || !unsigned($StockID)) {
             $this->_ERROR_CODE = 30053;
         }
         if (!required($OrderQuantity) || !unsigned($OrderQuantity)) {
             $this->_ERROR_CODE = 30054;
         }
         if (!required($Session)) {
             $this->_ERROR_CODE = 30055;
         }
         if (!required($OrderPrice)) {
             $this->_ERROR_CODE = 30056;
         }
         $log[] = sprintf('check require: ERROR_CODE: %s', $this->_ERROR_CODE);
     } else {
         $vip = checkVIPAccount($AccountNo);
         // 1: exist 0: not exist
         $vipCo = checkVIPAccount($CoAccountNo);
         // 1: exist 0: not exist
         if (($vip == 1 || $vipCo == 1) && $FromTypeID == 5) {
             // web
             $this->_ERROR_CODE = 30602;
             $log[] = sprintf('Vip on web: Fail; AccountNo: %s;CoAccountNo: %s', $vip == 0 ? 'not vip' : 'vip', $vipCo == 0 ? 'not vip' : 'vip');
             write_my_log_path("insertCoSellOrder", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/otc/');
             return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
         }
         if ((strpos(EOT_PROHIBITION_ACCOUNT, $AccountNo) !== false || strpos(EOT_PROHIBITION_ACCOUNT, $CoAccountNo) !== false) && $FromTypeID == 5) {
             $this->_ERROR_CODE = 30602;
             $log[] = sprintf('check EOT_PROHIBITION_ACCOUNT: ERROR_CODE: %s;AccountNo:%s,%s;CoAccountNo:%s,%s', $this->_ERROR_CODE, $AccountNo, strpos(EOT_PROHIBITION_ACCOUNT, $AccountNo), $CoAccountNo, strpos(EOT_PROHIBITION_ACCOUNT, $CoAccountNo));
             write_my_log_path("insertCoSellOrder", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/otc/');
             return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
         }
         if (!checkStockPrice($StockID, $OrderPrice, $OrderDate)) {
             $this->_ERROR_CODE = 30057;
         }
         $log[] = sprintf('checkStockPrice: ERROR_CODE: %s', $this->_ERROR_CODE);
         $sellingOrderID = '';
         $buyingOrderID = '';
         try {
             if ($this->_ERROR_CODE == 0) {
                 // -------------------------------------------------------------------------------------- //
                 // Insert sell order for $CoAccountNo
                 // -------------------------------------------------------------------------------------- //
                 $query = sprintf("CALL sp_upcom_insertSellingOrder('%s', %u, %u, %u, %u, '%u', '%s', '%s', '%u', '%u', '%s', '%s', '%s')", $CoAccountNo, $StockID, $OrderQuantity, $OrderPrice, $Session, $FromTypeID, $Note, $OrderDate, $IsAssigner, $IsGotPaper, $CreatedBy, $AccountNoContra, $CompanyNameContra);
                 $log[] = sprintf('%s', $query);
                 $mdb = initWriteDB();
                 $rs = $mdb->extended->getRow($query);
                 $mdb->disconnect();
                 if (empty($rs)) {
                     $this->_ERROR_CODE = 30060;
                 } else {
                     $result = $rs['varerror'];
                     if ($result < 0) {
                         switch ($result) {
                             case '-1':
                                 $this->_ERROR_CODE = 19010;
                                 break;
                             case '-2':
                                 $this->_ERROR_CODE = 19011;
                                 break;
                             case '-3':
                                 $this->_ERROR_CODE = 19012;
                                 break;
                             case '-4':
                                 $this->_ERROR_CODE = 19013;
                                 break;
                             case '-5':
                                 $this->_ERROR_CODE = 19014;
                                 break;
                             case '-6':
                                 $this->_ERROR_CODE = 19015;
                                 break;
                             default:
                                 $this->_ERROR_CODE = $result;
                         }
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classOTC.php

示例12: deleteSetOfEmployee4Group

 function deleteSetOfEmployee4Group($GroupID, $SetOfEmployeeID, $UpdatedBy)
 {
     $function_name = 'deleteSetOfEmployee4Group';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     $delete_log = array();
     $lastest_error = 0;
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         $delete_log[] = sprintf('GroupID:%s;SetOfEmployeeID:%s;UpdatedBy:%s;ErrorCode:%s;ExecutedTime:%s', $GroupID, $SetOfEmployeeID, $UpdatedBy, $this->_ERROR_CODE, date('Y-m-d h:i:s'));
         write_my_log_path("deleteSetOfEmployee4Group", implode("\n --> ", $delete_log), '/home/vhosts/eSMS/htdocs/logs/employee/');
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($GroupID) || !unsigned($GroupID) || !required($SetOfEmployeeID)) {
         if (!required($GroupID) || !unsigned($GroupID)) {
             $this->_ERROR_CODE = $lastest_error = 32071;
         }
         if (!required($SetOfEmployeeID)) {
             $this->_ERROR_CODE = $lastest_error = 32070;
         }
         $delete_log[] = sprintf('GroupID:%s;SetOfEmployeeID:%s;UpdatedBy:%s;ErrorCode:%s;ExecutedTime:%s', $GroupID, $SetOfEmployeeID, $UpdatedBy, $this->_ERROR_CODE, date('Y-m-d h:i:s'));
     } else {
         $arr_epm = explode(',', $SetOfEmployeeID);
         $delete_success = array();
         $delete_fail = array();
         $delete_log[] = sprintf('GroupID:%s;SetOfEmployeeID:%s;UpdatedBy:%s;ExecutedTime:%s', $GroupID, $SetOfEmployeeID, $UpdatedBy, date('Y-m-d h:i:s'));
         foreach ($arr_epm as $emp_id) {
             $this->_ERROR_CODE = 0;
             $result = NULL;
             if (!unsigned($emp_id)) {
                 $this->_ERROR_CODE = 32070;
                 $delete_fail[] = trim($emp_id);
             } else {
                 $query = sprintf("CALL sp_deleteEmployeeGroup(%u, %u, '%s')", trim($emp_id), $GroupID, $UpdatedBy);
                 $mdb = initWriteDB();
                 $rs = $mdb->extended->getRow($query);
                 if (empty($rs)) {
                     $this->_ERROR_CODE = 32072;
                     $delete_fail[] = trim($emp_id);
                 } else {
                     $result = $rs['varerror'];
                     if ($result < 0) {
                         $delete_fail[] = trim($emp_id);
                         switch ($result) {
                             case '-1':
                                 $this->_ERROR_CODE = 32073;
                                 break;
                             case '-2':
                                 $this->_ERROR_CODE = 32074;
                                 break;
                         }
                     }
                 }
             }
             if ($this->_ERROR_CODE == 0) {
                 $delete_success[] = trim($emp_id);
             } else {
                 $lastest_error = $this->_ERROR_CODE;
             }
             $delete_log[] = sprintf('GroupID:%s;EmployeeID:%s;UpdatedBy:%s;ErrorCode:%s;ExecutedTime:%s', $GroupID, trim($emp_id), $UpdatedBy, $this->_ERROR_CODE, date('Y-m-d h:i:s'));
         }
         $this->items[] = new SOAP_Value('item', $struct, array("SuccessdedEmployeeID" => new SOAP_Value("SuccessdedEmployeeID", "string", implode(', ', $delete_success)), "FailedEmployeeID" => new SOAP_Value("FailedEmployeeID", "string", implode(', ', $delete_fail))));
     }
     write_my_log_path("deleteSetOfEmployee4Group", implode("\n --> ", $delete_log), '/home/vhosts/eSMS/htdocs/logs/employee/');
     return returnXML(func_get_args(), $this->class_name, $function_name, $lastest_error, $this->items, $this);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:64,代码来源:classEmployee_251.php

示例13: confirmChangeOrder

 function confirmChangeOrder($OrderID, $IsMatched, $MatchedQuantity, $ExchangeRefno)
 {
     $function_name = 'confirmChangeOrder';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($OrderID) || !required($IsMatched)) {
         if (!required($OrderID)) {
             $this->_ERROR_CODE = 30451;
         }
         if (!required($IsMatched)) {
             $this->_ERROR_CODE = 30452;
         }
     } else {
         $this->_MDB2_WRITE = newInitWriteDB();
         $query = sprintf("CALL sp_hnx_ChangeOrder_Confirm(%u, '%s', %u, '%s' )", $OrderID, $IsMatched, $MatchedQuantity, $ExchangeRefno);
         $rs = $this->_MDB2_WRITE->extended->getRow($query);
         $this->_MDB2_WRITE->disconnect();
         if (empty($rs)) {
             $this->_ERROR_CODE = 30453;
         } else {
             $result = $rs['varError'];
             if ($result < 0) {
                 switch ($result) {
                     case '-1':
                         $this->_ERROR_CODE = 30454;
                         break;
                     case '-2':
                         $this->_ERROR_CODE = 30455;
                         break;
                     default:
                         $this->_ERROR_CODE = 666;
                 }
                 // switch
             } else {
                 // if
                 //,varOldValue,varReBlockedValue,varUnitCode,varBankID,varAccountNo,varAccountBank;
                 if (strpos(PAGODA_ACCOUNT, $AccountNo) === false) {
                     $suffix = date("His");
                     if ($rs['varReBlockedValue'] > 0) {
                         switch ($rs['varBankID']) {
                             case DAB_ID:
                                 $dab =& new CDAB();
                                 $dab_rs = $dab->editBlockMoney($rs['varAccountBank'], $rs['varAccountNo'], $OrderID, $rs['varReBlockedValue']);
                                 break;
                             case VCB_ID:
                                 $dab =& new CVCB();
                                 $oldOrderID = $OrderID . $rs['varUnitCode'];
                                 $newOrderID = $OrderID . $suffix;
                                 $dab_rs = $dab->editBlockMoney($rs['varAccountNo'], $oldOrderID, $newOrderID, $rs['varOldValue'], $rs['varReBlockedValue'], $function_name);
                                 break;
                             case NVB_ID:
                                 $dab =& new CNVB();
                                 $dab_rs = $dab->editBlockMoney(substr($OrderID . date("His"), 3), $rs['varAccountBank'], $rs['varReBlockedValue'], $OrderID);
                                 break;
                             case NHHM:
                             case OFFLINE:
                                 $query = sprintf("CALL sp_VirtualBank_Edit( '%s', %u, %u, %f, '%s')", $rs['varAccountNo'], $rs['varBankID'], $OrderID, $rs['varReBlockedValue'], 'HNX');
                                 $this->_MDB2_WRITE->connect();
                                 $off_rs = $this->_MDB2_WRITE->extended->getRow($query);
                                 $this->_MDB2_WRITE->disconnect();
                                 $dab_rs = $off_rs['varError'];
                                 break;
                         }
                         //switch
                     }
                 } else {
                     //PAGODA_ACCOUNT
                     $dab_rs = 0;
                 }
                 if ($dab_rs == 0) {
                     //Successfully
                     // if ( $rs['varbankid'] == VCB_ID ) {
                     if ($rs['varBankID'] == VCB_ID) {
                         $_MDB2_WRITE = initWriteDB();
                         $query = sprintf(" CALL sp_updateUnitCode(%u, '%s' )", $OrderID, $suffix);
                         $rs = $_MDB2_WRITE->extended->getRow($query);
                         $_MDB2_WRITE->disconnect();
                         if (empty($rs)) {
                             $this->_ERROR_CODE = 30456;
                         }
                     }
                 } else {
                     // bank fail
                     // switch ($rs['varbankid']) {
                     switch ($rs['varBankID']) {
                         case DAB_ID:
                             switch ($dab_rs) {
                                 case '-1':
                                     $this->_ERROR_CODE = 41040;
                                     break;
                                 case '-2':
                                     $this->_ERROR_CODE = 41041;
                                     break;
                                 case '-3':
                                     $this->_ERROR_CODE = 41042;
                                     break;
                                 case '-4':
                                     $this->_ERROR_CODE = 41043;
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classDirectlyOrderTransfer_prepare_up.php

示例14: InsertListOfQuota4AcountVB

 function InsertListOfQuota4AcountVB($TradingDate)
 {
     $class_name = $this->class_name;
     $function_name = 'InsertListOfQuota4AcountVB';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     $log[] = sprintf('InsertListOfQuota4AcountVB - TradingDate:%s;BankID:%s;ExecutedTime:%s', $TradingDate, OFFLINE, date('Y-m-d h:i:s'));
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         $log[] = sprintf('ErrorCode:%s(authenUser);', $this->_ERROR_CODE);
         write_my_log_path("InsertListOfQuota4AcountVB", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/quota/');
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     $query = sprintf("CALL sp_quota_getQuota4Bravo('%s', %u)", $TradingDate, OFFLINE);
     $result = $this->_MDB2->extended->getAll($query);
     $count = count($result);
     $log[] = sprintf('Query:%s;Count:%s', $query, $count);
     $f_args = func_get_args();
     $argscount = count($f_args);
     for ($i = 0; $i < $count; $i++) {
         $error_code = 0;
         $query = sprintf("CALL sp_quota_insertQuota4AccountVB(%u, %f, '%s', '%s', %u, '%s')", $result[$i]['accountid'], $result[$i]['debtamount'], 'Nộp hạn mức', $TradingDate, OFFLINE, $f_args[$argscount - 2]);
         $mdb = initWriteDB();
         $result2 = $mdb->extended->getAll($query);
         $log[] = sprintf('Query:%s; Times:%s', $query, $i);
         if (!isset($result2[0]['varerror'])) {
             $error_code = 40001;
         } else {
             $varerror = $result2[0]['varerror'];
             if ($varerror < 0) {
                 switch ($varerror) {
                     case '-1':
                         $error_code = 40002;
                         break;
                     case '-2':
                         $error_code = 40047;
                         break;
                     case '-3':
                         $error_code = 40048;
                         break;
                     case '-4':
                         $error_code = 40049;
                         break;
                     case '-5':
                         $error_code = 40050;
                         break;
                     default:
                         $error_code = $varerror;
                         break;
                 }
             }
         }
         $log[] = sprintf('ErrorCode:%s;', $error_code);
         if ($error_code == 0) {
             $deposit = array("TradingDate" => date("Y-m-d"), 'TransactionType' => BRAVO_QUOTA, "AccountNo" => $result[$i]['accountno'], "Amount" => $result[$i]['debtamount'], "Fee" => $result[$i]['debtamount'], "Bank" => VIRTUAL_BANK_BRAVO_BANKCODE, "Branch" => "", "Note" => 'Nop han muc');
             $log[] = sprintf('Bravo: TransactionType:%s;AccountNo:%s;Amount:%s;Fee:%s;Bank:%s;', BRAVO_QUOTA, $result[$i]['accountno'], $result[$i]['debtamount'], $result[$i]['debtamount'], VIRTUAL_BANK_BRAVO_BANKCODE);
             $soap =& new Bravo();
             $ret = $soap->deposit($deposit);
             if ($ret['table0']['Result'] != 1) {
                 switch ($ret['table0']['Result']) {
                     case '-2':
                         $error_code = 23002;
                         break;
                     case '-1':
                         $error_code = 23003;
                         break;
                     case '-13':
                         $error_code = 23006;
                         break;
                     case '-15':
                         $error_code = 23005;
                         break;
                     case '-16':
                         $error_code = 23004;
                         break;
                     default:
                         $error_code = 'Bravo' . $ret['table0']['Result'];
                 }
             }
             $log[] = sprintf('ErrorCode:%s;', $error_code);
         }
         if ($error_code != 0) {
             $this->_ERROR_CODE = $error_code;
             $this->items[] = new SOAP_Value('item', $struct, array("AccountID" => new SOAP_Value("AccountID", "string", $result[$i]['accountid']), "AccountNo" => new SOAP_Value("AccountNo", "string", $result[$i]['accountno']), "DebtAmount" => new SOAP_Value("DebtAmount", "string", $result[$i]['debtamount']), "BravoCode" => new SOAP_Value("BravoCode", "string", $result[$i]['bravocode']), "ErrorCode" => new SOAP_Value("ErrorCode", "string", $error_code)));
         }
     }
     $log[] = "\n\n";
     write_my_log_path("InsertListOfQuota4AcountVB", implode("\n --> ", $log), '/home/vhosts/eSMS/htdocs/logs/quota/');
     return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:88,代码来源:classQuota_251.php

示例15: confirmCollectDebt

 /**
 	Function: confirmCollectDebt
 	Description:
 	Input:
 	Output: success / error code
 */
 function confirmCollectDebt($CollectDebtID, $UpdatedBy)
 {
     $function_name = 'confirmCollectDebt';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     if (!required($CollectDebtID) || !unsigned($CollectDebtID)) {
         $this->_ERROR_CODE = 21130;
     } else {
         $query = sprintf("CALL sp_getInfoForCollectDebt( %u )", $CollectDebtID);
         $rs = $this->_MDB2->extended->getRow($query);
         $dab_rs = 999;
         $Amount = $rs['payment'] + $rs['paymentinterest'];
         $description = "EPS thu nợ cầm cố hợp đồng " . $rs['contractno'];
         switch ($rs['bankid']) {
             case DAB_ID:
                 $dab =& new CDAB();
                 $contractno = $CollectDebtID . " " . $rs['contractno'];
                 $dab_rs = $dab->transfertoEPS($rs['bankaccount'], $rs['accountno'], $contractno, $Amount, $description);
                 break;
             case OFFLINE:
                 $mdb = initWriteDB();
                 $query = sprintf("CALL sp_VirtualBank_CollectDebt(%u, '%s', '%s')", $CollectDebtID, date("Y-m-d"), $UpdatedBy);
                 $offline_rs = $mdb->extended->getRow($query);
                 $mdb->disconnect();
                 if (PEAR::isError($offline_rs)) {
                     $this->_ERROR_CODE = 21200;
                 } else {
                     $result = $offline_rs['varerror'];
                     if ($result < 0) {
                         switch ($result) {
                             case '-1':
                                 $this->_ERROR_CODE = 21201;
                                 break;
                             case '-2':
                                 $this->_ERROR_CODE = 21202;
                                 break;
                             case '-3':
                                 $this->_ERROR_CODE = 21203;
                                 break;
                             case '-4':
                                 $this->_ERROR_CODE = 21204;
                                 break;
                             case '-5':
                                 $this->_ERROR_CODE = 21205;
                                 break;
                             case '-9':
                                 $this->_ERROR_CODE = 21206;
                                 break;
                         }
                         //switch
                     } else {
                         //if
                         $dab_rs = 0;
                     }
                 }
                 //if PEAR
                 break;
             case VCB_ID:
                 $dab_rs = 666;
                 break;
         }
         if ($dab_rs == 0) {
             //Successfully
             $query = sprintf("UPDATE %s SET IsBank='1', UpdatedBy='%s', CollectDate=date(now()), UpdatedDate=convert_tz(now(), '+07:00', '+00:00') WHERE ID=%u", TBL_COLLECT_DEBT, $UpdatedBy, $CollectDebtID);
             $this->_MDB2_WRITE->extended->getRow($query);
             $this->_MDB2_WRITE->disconnect();
             //bravo
             $soap =& new Bravo();
             if ($rs['bravocode'] == VIRTUAL_BANK_BRAVO_BANKCODE) {
                 $withdrawValue = array("TradingDate" => date("Y-m-d"), 'TransactionType' => BRAVO_PAID_MORTAGE_EPS, "AccountNo" => $rs['accountno'], "Amount" => $rs['payment'], "Fee" => $rs['payment'], "Bank" => $rs['bravocode'], "Branch" => $rs['mortagebravocode'], "Note" => $description);
                 $ret = $soap->withdraw($withdrawValue);
                 if ($ret['table0']['Result'] == 1 && $rs['paymentinterest'] > 0) {
                     $withdrawValue = array("TradingDate" => date("Y-m-d"), 'TransactionType' => BRAVO_PAID_MORTAGE_INTEREST_EPS, "AccountNo" => $rs['accountno'], "Amount" => $rs['paymentinterest'], "Fee" => $rs['paymentinterest'], "Bank" => $rs['bravocode'], "Branch" => $rs['mortagebravocode'], "Note" => $description . ' - Lai cam co');
                     $ret = $soap->withdraw($withdrawValue);
                 }
             } else {
                 $withdrawValue = array("TradingDate" => date("Y-m-d"), 'TransactionType' => BRAVO_PAID_MORTAGE, "AccountNo" => $rs['accountno'], "Amount" => $rs['payment'], "Fee" => $rs['paymentinterest'], "Bank" => $rs['bravocode'], "Branch" => $rs['mortagebravocode'], "Note" => $description);
                 $ret = $soap->withdraw($withdrawValue);
             }
             if ($ret['table0']['Result'] == 1) {
                 // success
                 $this->_MDB2_WRITE->connect();
                 $query = sprintf("UPDATE %s SET IsBravo='1', UpdatedBy='%s', UpdatedDate=convert_tz(now(), '+07:00', '+00:00') WHERE ID=%u", TBL_COLLECT_DEBT, $UpdatedBy, $CollectDebtID);
                 $this->_MDB2_WRITE->extended->getRow($query);
             } else {
                 // Bravo fail
                 switch ($ret['table0']['Result']) {
                     case '-2':
                         $this->_ERROR_CODE = 23002;
                         break;
                     case '-1':
                         $this->_ERROR_CODE = 23003;
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classPayment.php


注:本文中的initWriteDB函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。