本文整理汇总了PHP中authenUser函数的典型用法代码示例。如果您正苦于以下问题:PHP authenUser函数的具体用法?PHP authenUser怎么用?PHP authenUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了authenUser函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkAuctionForVirtualBank
function checkAuctionForVirtualBank($TradingDate, $BankID)
{
$function_name = 'checkAuctionForVirtualBank';
$class_name = $this->class_name;
$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_VirtualBank_CheckAuction('%s', %u)", $TradingDate, $BankID);
$result = $this->_MDB2->extended->getAll($query);
for ($i = 0; $i < count($result); $i++) {
$this->items[$i] = new SOAP_Value('item', $struct, array("OrderID" => new SOAP_Value("OrderID", "string", $result[$i]['orderid']), "AccountNo" => new SOAP_Value("AccountNo", "string", $result[$i]['accountno']), "Symbol" => new SOAP_Value("Symbol", "string", $result[$i]['symbol']), "Amount" => new SOAP_Value("Amount", "string", $result[$i]['amount']), "BidAmount" => new SOAP_Value("BidAmount", "string", $result[$i]['bidamount']), "Delta" => new SOAP_Value("Delta", "string", $result[$i]['delta'])));
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:15,代码来源:classExchange.php
示例2: insertTradeForHNX
/**
Chi them ngay 04-03-2010
Function: insertTradeForHNX
Description: insert deal for hnx
Input: $'OrderQuantity', 'Session', 'FromTypeID', 'OldOrderID', 'Note', 'OrderDate', 'IsAssigner', 'CreatedBy'
Output: ID / error code
*/
function insertTradeForHNX($ConfirmNo, $OrderNumber, $MatchedQuantity, $MatchedPrice, $MatchedSession, $TradingDate, $CreatedBy)
{
$function_name = 'insertTradeForHNX';
$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($ConfirmNo) || !required($OrderNumber) || !required($MatchedQuantity) || !required($MatchedPrice) || !required($MatchedSession) || !required($TradingDate)) {
if (!required($ConfirmNo)) {
$this->_ERROR_CODE = 99999;
}
if (!required($OrderNumber)) {
$this->_ERROR_CODE = 99999;
}
if (!required($MatchedQuantity)) {
$this->_ERROR_CODE = 99999;
}
if (!required($MatchedPrice)) {
$this->_ERROR_CODE = 99999;
}
if (!required($MatchedSession)) {
$this->_ERROR_CODE = 99999;
}
if (!required($TradingDate)) {
$this->_ERROR_CODE = 99999;
}
} else {
$query = sprintf("CALL sp_hnx_Trade_Insert('%s', '%s', %u, %u, %u, '%s', '%s')", $ConfirmNo, $OrderNumber, $MatchedQuantity, $MatchedPrice, $MatchedSession, $TradingDate, $CreatedBy);
$rs = $this->_MDB2_WRITE->extended->getRow($query);
if (empty($rs)) {
$this->_ERROR_CODE = 999998;
} else {
$result = $rs['varerror'];
if ($result < 0) {
switch ($result) {
case '-1':
$this->_ERROR_CODE = 999997;
break;
default:
$this->_ERROR_CODE = $result;
}
} else {
$this->_ERROR_CODE = 0;
}
}
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:55,代码来源:classOrder.php
示例3: ReportVirtualBank_GetAccountBalanceByDate
function ReportVirtualBank_GetAccountBalanceByDate($BankID, $AccountNo, $FromDate, $ToDate)
{
$function_name = 'ReportVirtualBank_GetAccountBalanceByDate';
$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_VirtualBank_getAccountBalanceByDate('%s','%s','%s','%s')", $BankID, $AccountNo, $FromDate, $ToDate);
$result = $this->_MDB2->extended->getAll($query);
$num_row = count($result);
if ($num_row > 0) {
for ($i = 0; $i < $num_row; $i++) {
$this->items[$i] = new SOAP_Value('items', '{urn:' . $this->class_name . '}' . $function_name . 'Struct', array('PrevBalance' => new SOAP_Value("PrevBalance", "string", $result[$i]['prevbalance']), 'NextBalance' => new SOAP_Value("NextBalance", "string", $result[$i]['nextbalance']), 'AccountNo' => new SOAP_Value("AccountNo", "string", $result[$i]['accountno']), 'InvestorName' => new SOAP_Value("InvestorName", "string", $result[$i]['investorname'])));
}
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:17,代码来源:classBank.php
示例4: getAdvanceAmountforBankAndDate
function getAdvanceAmountforBankAndDate($AdvanceDate, $TDate, $BankID)
{
try {
$class_name = $this->class_name;
$function_name = 'getAdvanceAmountforBankAndDate';
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);
}
$this->items = array();
$query = sprintf("CALL sp_getAdvanceAmountforBankAndDate('%s','%s','%s')", $AdvanceDate, $TDate, $BankID);
$result = $this->_MDB2->extended->getAll($query);
$num_row = count($result);
if ($num_row > 0) {
for ($i = 0; $i < $num_row; $i++) {
$this->items[$i] = new SOAP_Value('items', '{urn:' . $class_name . '}' . $function_name . 'Struct', array('AdvanceAmount' => new SOAP_Value("AdvanceAmount", "string", $result[$i]['advanceamount']), 'Numday' => new SOAP_Value("Numday", "string", $result[$i]['numday']), 'Val' => new SOAP_Value("Val", "string", $result[$i]['val'])));
}
}
} catch (Exception $e) {
write_my_log_path('PHP-Exception', $function_name . ' Caught exception: ' . $e->getMessage() . ' ' . date('Y-m-d h:i:s'), DEBUG_PATH);
$this->_ERROR_CODE = 23022;
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:23,代码来源:classAdvancePaper.php
示例5: insertBuyingStockDivident
function insertBuyingStockDivident($AccountID, $BankID, $Amount, $DepositDate, $Note, $CreatedBy)
{
$function_name = 'insertBuyingStockDivident';
$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($AccountID) || !unsigned($AccountID) || !required($BankID) || !unsigned($BankID) || !required($Amount) || !unsigned($Amount) || !required($DepositDate)) {
if (!required($AccountID) || !unsigned($AccountID)) {
$this->_ERROR_CODE = 22230;
}
if (!required($BankID) || !unsigned($BankID)) {
$this->_ERROR_CODE = 22231;
}
if (!required($Amount) || !unsigned($Amount)) {
$this->_ERROR_CODE = 22232;
}
if (!required($DepositDate)) {
$this->_ERROR_CODE = 22233;
}
} else {
$query = sprintf("CALL sp_VirtualBank_insertBuyingStockDivident(%u, %u, %f, '%s', '%s', '%s' )", $AccountID, $BankID, $Amount, $DepositDate, $Note, $CreatedBy);
$rs = $this->_MDB2_WRITE->extended->getRow($query);
if (empty($rs)) {
$this->_ERROR_CODE = 22234;
} else {
$result = $rs['varerror'];
if ($result < 0) {
switch ($result) {
case '-1':
$this->_ERROR_CODE = 22235;
break;
case '-2':
$this->_ERROR_CODE = 22236;
break;
case '-3':
$this->_ERROR_CODE = 22237;
break;
case '-4':
$this->_ERROR_CODE = 22238;
break;
case '-5':
$this->_ERROR_CODE = 22239;
break;
case '-9':
$this->_ERROR_CODE = 22240;
break;
default:
$this->_ERROR_CODE = $result;
}
}
}
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:55,代码来源:classTradingRegister_old.php
示例6: checkQuotaAccountIsExisted
function checkQuotaAccountIsExisted($AccountNo)
{
$function_name = 'checkQuotaAccountIsExisted';
$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);
}
$MDB2 = initDB();
$query = sprintf("SELECT f_quota_QuotaAccount_IsExisted('%s') AS Boolean", $AccountNo);
$result = $MDB2->extended->getRow($query);
$this->items[0] = new SOAP_Value('item', $struct, array("Boolean" => new SOAP_Value("Boolean", "string", $result['boolean'])));
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:13,代码来源:classOrder.php
示例7: 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
示例8: ConfirmBuyingStockForDividend_CutMoney_ForTraiPhieu
/**
* (Function nay chi khac ConfirmBuyingStockForDividend_CutMoney o cho tham so $Note - Tao ngay 20100712, request ngay 20100709)
* Function ConfirmBuyingStockForDividend_CutMoney_ForTraiPhieu : Ke toan cat tien -- day dl qua Bravo -- cap nhat bankid khi cat tien thanh cong
* Input : $EventID, $AccountID, $Today, $UpdatedBy, $Note
* OutPut : error code. Return 0 if success else return error code (number >0).
*/
function ConfirmBuyingStockForDividend_CutMoney_ForTraiPhieu($EventID, $AccountID, $UpdatedBy, $Today, $BankID, $Note)
{
try {
$class_name = $this->class_name;
$function_name = 'ConfirmBuyingStockForDividend_CutMoney_ForTraiPhieu';
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'], $Note);
write_my_log_path('transfertoEPS', $function_name . ' BankAccount ' . $bank_rs[$i]['bankaccount'] . ' AccountNo ' . $Withdrawal['AccountNo'] . ' Event_AccountID ' . '3_' . $EventID . ' ' . $AccountID . ' Amount ' . $Withdrawal['Amount'] . ' Description ' . $Note . ' 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, $Note, $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) {
if ($BankID == OFFLINE) {
$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='" . $Withdrawal['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($Withdrawal['Amount'], 0, '.', ',') . '. ' . $Note;
$message .= '. So du hien tai la: ' . number_format($acc_rs['usableamount'], 0, '.', ',');
sendSMS(array('Phone' => $acc_rs['mobilephone'], 'Content' => $message), 'ConfirmBuyingStockForDividend_CutMoney_ForTraiPhieu');
}
}
$soap =& new Bravo();
$Withdrawal_value = array("TradingDate" => $Today, 'TransactionType' => $TransactionType, "AccountNo" => $Withdrawal['AccountNo'], "Amount" => $Withdrawal['Amount'], "Bank" => $BravoCode, "Branch" => "", "Note" => $Note);
//'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) {
//.........这里部分代码省略.........
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:101,代码来源:classTradingRegister_251.php
示例9: 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
示例10: getTransferingOrderForReSend
function getTransferingOrderForReSend($OrderDate, $AccountNo, $OrderID)
{
$function_name = 'getTransferingOrderForReSend';
$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);
}
try {
$this->_MDB2_WRITE = newInitWriteDB();
$query = sprintf("CALL sp_hnx_GetTransferingOrderForReSend('%s', '%s', %u)", $OrderDate, $AccountNo, $OrderID);
$result = $this->_MDB2_WRITE->extended->getAll($query);
$count = count($result);
if ($count > 0) {
for ($i = 0; $i < $count; $i++) {
$this->items[$i] = new SOAP_Value('item', $struct, array("OrderID" => new SOAP_Value("OrderID", "string", $result[$i]['OrderID']), "OrderNumber" => new SOAP_Value("OrderNumber", "string", $result[$i]['OrderNumber']), "AccountNo" => new SOAP_Value("AccountNo", "string", $result[$i]['AccountNo']), "OrderSideName" => new SOAP_Value("OrderSideName", "string", $result[$i]['OrderSideName']), "Symbol" => new SOAP_Value("Symbol", "string", $result[$i]['Symbol']), "OrderStyleName" => new SOAP_Value("OrderStyleName", "string", $result[$i]['OrderStyleName']), "OrderPrice" => new SOAP_Value("OrderPrice", "string", $result[$i]['OrderPrice']), "OrderQuantity" => new SOAP_Value("OrderQuantity", "string", $result[$i]['OrderQuantity']), "StatusName" => new SOAP_Value("StatusName", "string", $result[$i]['StatusName']), "GetNumber" => new SOAP_Value("GetNumber", "string", $result[$i]['o.GetNumber'])));
}
}
$content = date("d/m/Y H:i:s") . "\t" . $query . "\t--> " . $count;
another_write_log($function_name, $content, 'directly_tranfer');
} catch (Exception $e) {
$this->_ERROR_CODE = $e->getMessage();
}
return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:24,代码来源:classDirectlyOrderTransfer_prepare_up.php
示例11: 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
示例12: 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
示例13: UpdateIsCollectedVSDFee
function UpdateIsCollectedVSDFee()
{
$class_name = $this->class_name;
$function_name = 'UpdateIsCollectedVSDFee';
$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);
}
$date_array = getdate();
$csv_dir = $this->path . 'vcb_kq/';
if (!is_dir($csv_dir)) {
mkdir($csv_dir, 0755);
}
$csv_dir = $csv_dir . 'logs/';
if (!is_dir($csv_dir)) {
mkdir($csv_dir, 0755);
}
$csv_dir = $csv_dir . $date_array['year'] . '/';
if (!is_dir($csv_dir)) {
mkdir($csv_dir, 0755);
}
$csv_dir = $csv_dir . $date_array['mon'] . '/';
if (!is_dir($csv_dir)) {
mkdir($csv_dir, 0755);
}
$filename = 'eps' . date('Ymd') . '_buy_log.vcbit';
$filepath = $csv_dir . $filename;
$vsdlogfile = 'vsdrefno_' . date('Ymd') . '.txt';
$vsdlogfile = sprintf('%s%s%s/%s/%s', $this->path, 'vcb_kq/', $date_array['year'], $date_array['mon'], $vsdlogfile);
if (is_file($vsdlogfile)) {
if (!is_file($filepath)) {
$conn_id = ftp_connect($this->ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $this->ftp_user_name, $this->ftp_user_pass);
// check connection
if (!$conn_id || !$login_result) {
$this->_ERROR_CODE = 24001;
} else {
$destination_file = $filepath;
// open some file to write to
$handle = fopen($destination_file, 'w');
$source_file = 'OUT/' . $filename;
// get the size of $file
$res = ftp_size($conn_id, $source_file);
if ($res != -1) {
$upload = ftp_fget($conn_id, $handle, $source_file, FTP_BINARY);
// check upload status
if (!$upload) {
$this->_ERROR_CODE = 24002;
} else {
$this->_ERROR_CODE = 0;
}
} else {
//echo "couldn't get the size";
$this->_ERROR_CODE = 24005;
}
// close the FTP stream
ftp_close($conn_id);
fclose($handle);
}
}
if (file_exists($filepath) === true) {
$handle = fopen($vsdlogfile, "r");
$vsdlogcontent = fgets($handle);
fclose($handle);
$vsdrefarray = explode('_', $vsdlogcontent);
$handle = fopen($filepath, "r");
while (!feof($handle)) {
$line = fgets($handle);
$splited = explode(';', $line);
if (in_array($splited[1], $vsdrefarray)) {
$orderID = substr($splited[1], 0, strlen($splited[1]) - 6);
$unitCode = substr($splited[1], -6);
if ($splited[15] == '0000') {
$this->_MDB2->connect();
$query = sprintf("CALL sp_FeeForVSD_updateIsCollectedForVCB('%s')", $orderID);
$result = $this->_MDB2->extended->getAll($query);
$this->_MDB2->disconnect();
}
$content = $line . ' ' . $query . ' varerror: ' . $result[0]['varerror'];
write_my_log_path('UpdateIsCollectedVSDFee', $content, $csv_dir);
$this->items[] = new SOAP_Value('item', $struct, array('Refno' => new SOAP_Value("Refno", "string", $splited[1]), 'OrderID' => new SOAP_Value("OrderID", "string", $orderID), 'UnitCode' => new SOAP_Value("UnitCode", "string", $unitCode), 'AccountNo' => new SOAP_Value("AccountNo", "string", $splited[4]), 'Amount' => new SOAP_Value("Amount", "string", $splited[12]), 'VCBResult' => new SOAP_Value("VCBResult", "string", $splited[15]), 'Note' => new SOAP_Value("Note", "string", substr($splited[16], 0, strlen($splited[16]) - 1)), 'UpdateIsCollectedResult' => new SOAP_Value("UpdateIsCollectedResult", "string", $result[0]['varerror'])));
}
}
fclose($handle);
} else {
// Chua co log file
$this->_ERROR_CODE = 24004;
|
请发表评论