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


PHP DBConnection::getRow方法代码示例

本文整理汇总了PHP中DBConnection::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::getRow方法的具体用法?PHP DBConnection::getRow怎么用?PHP DBConnection::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBConnection的用法示例。


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

示例1: exit

    if($_GET['noheader']==1) {
    	header('Location: /history.php');
    }else{
    	header('Location: users.php');
    }
    exit();
}

if(array_get($_GET, 'noheader')==1) {
	page_header(0);
}else{
	page_header();
}

$db=new DBConnection();
$userDetails=$db->getRow('users','user_account_num="'.$_GET['uid'].'"','user_email, user_firstname, user_lastname, user_username, user_account_num, user_balance');
if(isset($_GET['buyref'])) {
	$query='SELECT mail_templates_id FROM mail_templates mt LEFT JOIN global_settings gs ON mt.mail_templates_id=gs.variable_value WHERE variable="Buy Confirmation"';
	$res=$db->rq($query);
	$num_rows=$db->num_rows($res);
	if($num_rows>0) {
		$row=$db->fetch($res);
		$_POST['mail_templates_id']=$row['mail_templates_id'];
	}
}elseif(isset($_GET['sellref'])) {
	$query='SELECT mail_templates_id FROM mail_templates mt LEFT JOIN global_settings gs ON mt.mail_templates_id=gs.variable_value WHERE variable="Sell Confirmation"';
	$res=$db->rq($query);
	$num_rows=$db->num_rows($res);
	if($num_rows>0) {
		$row=$db->fetch($res);
		$_POST['mail_templates_id']=$row['mail_templates_id'];
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:mails_singleuser.php

示例2:

			$query='UPDATE stock_trades SET trade_shares_left=0, trade_status=4 WHERE trades_id='.($row['trades_id']+0).'';
			$db->rq($query);
		}

		if ($_POST['trade_status']==1){
			$fixPostValue=str_replace(',', '', $_POST['trade_invoiced']);
			$query='UPDATE users SET user_balance=(user_balance+'.($fixPostValue+0).'), user_lastupdate="'.date('Y-m-d H:i:s', CUSTOMTIME).'" WHERE user_account_num="'.$_POST['user_account_num'].'"';
			$db->rq($query);
		}

		$query='INSERT INTO trades_related SET trade_ref='.($tradeRef+0).', trade_ref_relatedto='.($row['trade_ref']+0).'';
		$db->rq($query);

		$link='sellref='.$tradeRef;

		$uDetails=$db->getRow('users','user_account_num="'.$_POST['user_account_num'].'"','user_firstname, user_lastname, user_account_num');
		addLog('Back-end','Stock Trades',''.$uDetails['user_firstname'].' '.$uDetails['user_lastname'].' ('.$uDetails['user_account_num'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Sell added '.($tradeRef+0).' ('.$tradesSellStatuses[$_POST['trade_status']].')');
	}else{
		//EDIT SELL ORDER
		$mysql_fields='';
		$mysql_fields.='user_account_num="'.($row['user_account_num']+0).'", ';

		$mysql_fields.='trade_shares="'.$_POST['trade_shares'].'", ';
		$mysql_fields.='trade_shares_left="'.$_POST['trade_shares'].'", ';
		$mysql_fields.='trade_details="'.$_POST['trade_details'].'", ';
		$mysql_fields.='trade_price_share="'.str_replace(',', '', $_POST['trade_price_share']).'", ';
		$mysql_fields.='trade_value="'.str_replace(',', '', $_POST['trade_value']).'", ';
		$mysql_fields.='trade_fees="'.str_replace(',', '', $_POST['trade_fees']).'", ';
		$mysql_fields.='trade_invoiced="'.str_replace(',', '', $_POST['trade_invoiced']).'", ';
		$mysql_fields.='trade_date="'.$_POST['trade_date'].'", ';
		$mysql_fields.='trade_status="'.$_POST['trade_status'].'", ';
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:c.add.sell.php

示例3: addNewTradeSell


//.........这里部分代码省略.........
	
	<br />
	<div class="formsLeft">Expiry Date:</div>
	<div class="formsRight">
	    <div class="formsRight"><input class="text-input ui-state-default" type="text" name="trade_expiry_date" id="trade_expiry_date" value="'.date('d M y', $strToUse).'"></div>
	</div>
	
	<br />
	<div class="formsLeft">Strike Price:</div>
	<div class="formsRight">
		<input class="text-input align-right" type="text" name="trade_strikeprice" id="trade_strikeprice" value="'.$_POST['trade_strikeprice'].'"'.$JSCripts.' />
	</div><br />
	<div class="formsLeft">Notes:</div>
	<div class="formsRight">
		<input type="text" class="text-input left" name="trade_notes" value="'.$_POST['trade_notes'].'"'.$JSCripts.' />
	</div>
	</fieldset>
	
	<div class="clear"></div>

	<fieldset class="mainFormHolder left">
	<legend>Trade Details</legend>
	<input class="ui-state-default trade-details" type="text" name="trade_details" id="trade_details" value="'.(($_POST['trade_details']!='')?''.$_POST['trade_details'].'':'BUY').'" readonly />
	</fieldset>
	
	<div class="clear"></div>';
	
	$totalRelated=0;
	$query2='SELECT trade_ref_relatedto FROM trades_related WHERE trade_ref="'.$_POST['trade_ref'].'"';
	$res2=$db->rq($query2);
	$totalRelated=$db->num_rows($res2);
	if ($totalRelated>0){
		$row2=$db->fetch($res2);
		$getRelatedInfo=$db->getRow('trades','trade_ref="'.$row2['trade_ref_relatedto'].'"','trade_ref, trade_details');
		$pcontent.='
		<fieldset class="mainFormHolder left">
			<legend>Related Trades</legend><br />
			<div class="ui-state-default trade-details"><a href="trades.php?action=edit_buy&tref='.$getRelatedInfo['trade_ref'].'" style="display:block;">'.$getRelatedInfo['trade_details'].'</a></div><br />
		</fieldset>';
	}
	
	$pcontent.='
</div>

<div class="left">
	<fieldset class="mainFormHolder left">
	<legend>Prices</legend>
	<div class="formsLeft">Premium:</div>
	<div class="formsRight">
		<input class="text-input align-right" type="text" name="trade_premium_price" id="trade_premium_price" value="'.$_POST['trade_premium_price'].'"'.$JSCriptsPremium.' />
	</div>
	<br />
	<div class="formsLeft">Contract Size:</div>
	<div class="formsRight">
		<input class="text-input align-right ui-state-default" type="text" name="trade_contract_size" id="trade_contract_size" value="'.$_POST['trade_contract_size'].'" readonly />
	</div>
	<br />
	<div class="formsLeft">Price/contract:</div>
	<div class="formsRight">
		<input class="text-input align-right" type="text" name="trade_price_contract" id="trade_price_contract" value="'.$_POST['trade_price_contract'].'"'.$JSCripts.' />
	</div>
	<br />
	<div class="formsLeft">Trade Value:</div>
	<div class="formsRight">
		<input class="text-input align-right ui-state-default" type="text" name="trade_value" id="trade_value" value="'.$_POST['trade_value'].'" readonly />
	</div>
开发者ID:sahartak,项目名称:v1poject,代码行数:67,代码来源:trades.php

示例4: exit

         exit();
     }else {
         $page_content=addNewUser($_GET['uid']);
     }
     break;
 case 'delete'	:
     if($_SESSION['admin']['is_logged']==1) {
         $exp="/[^a-zA-Z0-9]/i";
         $check=preg_match($exp, $_GET['uid']);
         if(($check+0)==1) {
             header('Location: users.php');
             exit();
         }
         $db=new DBConnection();
         
         $uDetails=$db->getRow('users','user_uid="'.$_GET['uid'].'"','user_firstname, user_lastname, user_account_num');
         $query='SELECT * FROM trades WHERE user_account_num="'.$uDetails['user_account_num'].'"';
         $res=$db->rq($query);
         $num_rows=$db->num_rows($res);
         if($num_rows>0) {
         	while(($row=$db->fetch($res)) != FALSE) {
         		$query2='DELETE FROM trades_related WHERE trade_ref="'.$row['trade_ref'].'" OR trade_ref_relatedto="'.$row['trade_ref'].'"';
         		$db->rq($query2);
         	}
         }
         $query='DELETE FROM trades WHERE user_account_num="'.$uDetails['user_account_num'].'"';
         $db->rq($query);
         
         $query='DELETE FROM transfers WHERE user_account_num="'.$uDetails['user_account_num'].'"';
         $db->rq($query);
         
开发者ID:sahartak,项目名称:v1poject,代码行数:30,代码来源:users-active.php

示例5: DBConnection

			exit();
		}else{
			$page_content=addNewWithdraw($_GET['ref']);
		}
		break;
	case 'delete_withdraw' :
		if ($_SESSION['admin']['is_logged']==1){
			$exp="/[^a-zA-Z0-9]/i";
			$check=preg_match($exp, $_GET['wtrid']);
			if (($check+0)==1){
				header('Location: transfers.php');
				exit();
			}
			$db=new DBConnection();
			
			$getCurrentData=$db->getRow('transfers', 'tr_ref="'.$_GET['wtrid'].'"');
			
			/*** FIX USERS's BALANCE IF CURRENT STATUS IS TRANSFERED ***/
			if ($getCurrentData['tr_status']==1){ // if new status is Transfered
				$query='UPDATE users SET user_balance=(user_balance+'.($getCurrentData['tr_total']+0).'), user_lastupdate="'.date('Y-m-d H:i:s', CUSTOMTIME).'" WHERE user_account_num="'.$getCurrentData['user_account_num'].'"';
				$db->rq($query);
			}
			
			$query='DELETE FROM transfers WHERE tr_ref="'.$_GET['wtrid'].'"';
			$db->rq($query);
			
			global $depositOptions;
			$uDetails=$db->getRow('users','user_account_num="'.$getCurrentData['user_account_num'].'"','user_firstname, user_lastname, user_account_num');
			addLog('Back-end','Transfers',''.$uDetails['user_firstname'].' '.$uDetails['user_lastname'].' ('.$uDetails['user_account_num'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Withdraw deleted '.($_GET['wtrid']+0).' ('.$depositOptions[$getCurrentData['tr_status']].')');
			
			$db->close();
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:transfers.php

示例6: DBConnection

    $cmd='';
}

if (isset($_POST['_back']))	$cmd='';
$page_content='';
switch	($cmd) {
    case 'new':
        $page_content=addNewCommodityGroup();
        break;
    case 'edit':
        $page_content=addNewCommodityGroup($_GET['cgid']+0);
        break;
    case 'delete'	:
        if($_SESSION['admin']['is_logged']==1) {
            $db=new DBConnection();
            $currentInfo=$db->getRow('commodities_groups','commodities_groups_id='.($_GET['cgid']+0).'');
            
            $query='DELETE FROM commodities_groups WHERE commodities_groups_id='.($_GET['cgid']+0);
            $db->rq($query);
            
            addLog('Back-end','Back-end Settings, Commodities - groups',0,''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Commodity group deleted ('.$currentInfo['commodities_groups_name'].')');
            
            $db->close();
            header('Location: commodities_groups.php');
            exit();
        }
        break;
    default	:
        $page_content=listCommoditiesGroup();
        break;
}
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:commodities_groups.php

示例7: DBConnection

    $cmd='';
}

if (isset($_POST['_back']))	$cmd='';
$page_content='';
switch	($cmd)	{
    case 'new':
	$page_content=addNewExpDate();
	break;
    case 'edit':
	$page_content=addNewExpDate($_GET['edid']+0);
	break;
    case 'delete'	:
	if($_SESSION['admin']['is_logged']==1) {
	    $db=new DBConnection();
	    $currentInfo=$db->getRow('expiry_dates','expiry_dates_id='.($_GET['edid']+0).'');
	    $query='DELETE FROM expiry_dates WHERE expiry_dates_id='.($_GET['edid']+0);
	    $db->rq($query);

	    addLog('Back-end','Back-end Settings, Commodities - exp. dates',0,''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Commodity expiry date deleted ('.$currentInfo['expiry_date'].')');
	    
	    $db->close();
	    header('Location: expiry_dates.php');
	    exit();
	}
	break;
    default	:
	$page_content=listExpDates();
	break;
}
开发者ID:sahartak,项目名称:v1poject,代码行数:30,代码来源:expiry_dates.php

示例8: addNewValue

function addNewValue($details_id=0) {
	$JSCripts=' onchange="setDetails();"';
	$db=new DBConnection();
	$pcontent='';
	$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>Adding New Stock Values</b></div> 
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/stockValues.js"></script>
<form name="addNewStockValue" method="POST" id="MainForms" action="">';

$query='SELECT * FROM stocks ORDER BY stocks_name ASC';
$res=$db->rq($query);
$num = 1;
$pcontent.='<div class="left">';
while (($row=$db->fetch($res))!=FALSE){
    
	if($details_id > 0) { 
		$details_id = $db->string_escape($details_id);
		$curval     = $db->getRow('stock_details','stocks_id="'.$row['stocks_id'].'" AND details_ref="'.$details_id.'"','value, volume, date');
	} else { 
		$curval = $db->getRow('stock_details','stocks_id="'.$row['stocks_id'].'" ORDER BY date DESC','value, volume');
	}
    
	if($curval){
	    $date = array_get($curval, 'date');
	    
		$pcontent.='<fieldset class="mainFormHolder">
			<legend>Share</legend>
			<div class="formsLeft">Share:</div>
			<div class="formsRight">
				<select name="stocks_id_'.$num.'" id="stocks_id_'.$num.'" class="text-input">';
				$pcontent.='<option value="'.$row['stocks_id'].'">'.$row['stocks_symbol'].' ('.$row['stocks_name'].')</option>';
			$pcontent.='
				</select>
			</div><br />
			<div class="formsLeft">Value:</div>
			<div class="formsRight">
				<input class="required text-input align-right" type="text" name="value_'.$num.'" id="value_'.$num.'" value="'.$curval['value'].'"'.$JSCripts.' />
			</div>
			<br />
			<div class="formsLeft">Volume:</div>
			<div class="formsRight">
				<input class="text-input align-right" type="text" name="volume_'.$num.'" id="volume_'.$num.'" value="'.$curval['volume'].'"'.$JSCripts.' />
			</div><br />
		</fieldset>';
	}
	$num++;
}
$pcontent.='</div><div class="left"><fieldset class="mainFormHolder">

	<legend>Date</legend>
	<div class="formsLeft">Value date:</div>
	<div class="formsRight"><input class="text-input" type="text" name="date_value" id="date_value" value="'.$date.'" /></div>
	<br />';
	if($details_id) { 
		$pcontent.='<input type="hidden" name="trade_ref" value="'.$details_id.'" />';
		$pcontent.='<input type="button" name="_delete" value="'.getLang('sform_delbtn').'" class="submitBtn ui-state-default" onclick="if(confirm(\'Are you sure you want to delete the values from this date?\')) location=\'?action=delete_values&sid='.($details_id).'\';" />';
	}
	$pcontent.='<input type="hidden" name="_form_submit" value="1" />
	<input type="hidden" name="_new_value" value="1" />
	<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />
	';
	$pcontent.='
	<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'stocks.php\';" />
	</fieldset></div>
</form>
</div>';
	return $pcontent;
}
开发者ID:sahartak,项目名称:v1poject,代码行数:70,代码来源:stocks.php

示例9: DBConnection

			}
			$db=new DBConnection();
			
			$query='SELECT * FROM stock_trades WHERE trade_ref="'.($_GET['sellid']+0).'"';
			$res=$db->rq($query);
			$row=$db->fetch($res);
			
			$query2='SELECT * FROM trades_related WHERE trade_ref="'.($_GET['sellid']+0).'"';
			$res2=$db->rq($query2);
			$row2=$db->fetch($res2);
			
			$query3='UPDATE stock_trades SET trade_shares_left=(trade_shares_left+'.($row['trade_shares']+0).') 
			WHERE trade_ref="'.$row2['trade_ref_relatedto'].'"';
			$db->rq($query3);

			$checkPositions=$db->getRow('stock_trades','trade_ref="'.$row2['trade_ref_relatedto'].'"','trade_shares_left');
			if($checkPositions['trade_shares_left']>0) {
				$query4='UPDATE stock_trades SET trade_status=1 WHERE trade_ref="'.$row2['trade_ref_relatedto'].'"';
				$db->rq($query4);
			}
			
			if ($row['trade_type']==2&&$row['trade_status']==1){
				$query='UPDATE users SET user_balance=(user_balance-'.($row['trade_invoiced']+0).'), user_lastupdate="'.date('Y-m-d H:i:s', CUSTOMTIME).'" WHERE user_account_num="'.$row['user_account_num'].'"';
				$db->rq($query);
			}
			
			$query='DELETE FROM trades_related WHERE trade_ref="'.$_GET['sellid'].'"';
			$db->rq($query);
			
			$query='DELETE FROM stock_trades WHERE trade_ref="'.$_GET['sellid'].'"';
			$db->rq($query);
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:strades.php

示例10: DBConnection

		$page_content=addNewAdvisor();
		break;
	case 'edit' :
		if ($_GET['ref']!=''&&($_GET['advid']+0)==0){
			$db=new DBConnection();
			$query='SELECT users_advisors_id FROM users_advisors WHERE advisor_ref="'.$db->string_escape($_GET['ref']).'" LIMIT 1';
			$res=$db->rq($query);
			$row=$db->fetch($res);
			$_GET['advid']=($row['users_advisors_id']+0);
		}
		$page_content=addNewAdvisor($_GET['advid']+0);
		break;
	case 'delete' :
		if ($_SESSION['admin']['is_logged']==1){
			$db=new DBConnection();
			$getCurrentData=$db->getRow('users_advisors', 'users_advisors_id="'.$_GET['advid'].'"');
			
			$query='DELETE FROM users_advisors WHERE users_advisors_id='.($_GET['advid']+0);
			$db->rq($query);

			addLog('Back-end','Advisors',''.$getCurrentData['advisor_names'].' ('.$getCurrentData['advisor_ref'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Advisor deleted');
			
			$db->close();
			header('Location: users_advisors.php');
			exit();
		}
		break;
	default :
		$page_content=listAdvisors();
		break;
}
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:users_advisors.php

示例11: DBConnection

		break;
	case 'edit' :
		if (isset($_GET['username']) && array_get($_GET, 'aid', 0) == 0){
			$db = new DBConnection();
			$query = 'SELECT id FROM ul_logins WHERE username="'.$db->string_escape($_GET['username']).'" LIMIT 1';
			$res = $db->rq($query);
			$row = $db->fetch($res);
            
			$_GET['aid'] = $row['id'];
		}
		$page_content = addNewAdmin($_GET['aid']+0);
		break;
	case 'delete' :
		if (isAppLoggedIn()){
            $db = new DBConnection();
			$currentData = $db->getRow('ul_logins', 'id='.($_GET['aid']+0).'');
            
            $ulogin->DeleteUser($_GET['aid']);
			
			addLog('Back-end','Back-end users',''.$currentData['name'].' ('.$currentData['ref'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Admin deleted');
			
			$db->close();
			header('Location: users_admins.php');
			exit();
		}
		break;
	default :
		$page_content = listAdmins();
		break;
}
开发者ID:sahartak,项目名称:v1poject,代码行数:30,代码来源:users_admins.php

示例12:

global $tradesBuyOptions;

if (!$_POST['tref']){
	$tradeRef=hexdec(substr(uniqid(''), 0, 10))-81208208208;
	$query='INSERT INTO stock_trades SET '.$mysql_fields.', trade_shares_left='.($_POST['trade_shares']+0).', trade_type=4, trades_id="'.NID.'", trade_ref='.($tradeRef+0); //.', trade_date="'.date('Y-m-d H:i:s', CUSTOMTIME).'"'
	$db->rq($query);

	if ($_POST['trade_status']==1){
		$fixPostValue=str_replace(',', '', $_POST['trade_invoiced']);
		$query='UPDATE users SET user_balance=(user_balance+'.($fixPostValue+0).'), user_lastupdate="'.date('Y-m-d H:i:s', CUSTOMTIME).'", 
		user_trades=(user_trades+1) WHERE user_account_num="'.$_POST['user_account_num'].'"';
		$db->rq($query);
	}
	$link='buyref='.$tradeRef;

	$uDetails=$db->getRow('users','user_account_num="'.$_POST['user_account_num'].'"','user_firstname, user_lastname, user_account_num');
	addLog('Back-end','Stock Trades',''.$uDetails['user_firstname'].' '.$uDetails['user_lastname'].' ('.$uDetails['user_account_num'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Short Sell added '.($tradeRef+0).' ('.$tradesBuyOptions[$_POST['trade_option']].' @ '.$tradesStatuses[$_POST['trade_status']].')');
}else{
	$query='SELECT * FROM stock_trades WHERE trade_ref="'.$_POST['tref'].'" LIMIT 1';
	$res=$db->rq($query);
	$row=$db->fetch($res);

	$query='UPDATE stock_trades SET '.$mysql_fields.', trade_shares_left=0, trade_type=4 
	WHERE trade_ref="'.$_POST['tref'].'"'; //, trade_date="'.date('Y-m-d H:i:s', CUSTOMTIME).'"
	$db->rq($query);

	$fixPostValue=str_replace(',', '', $_POST['trade_invoiced']);

	/*** FIX USERS's BALANCE IF NEEDED ***/
	if($fixPostValue==$row['trade_invoiced']&&$_POST['trade_status']!=$row['trade_status']){ // if new total and old total are same, but status is different
		if ($_POST['trade_status']==1&&$row['trade_status']!=1&&$row['trade_status']!=4){
开发者ID:sahartak,项目名称:v1poject,代码行数:31,代码来源:c.add.short.php


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