本文整理汇总了PHP中DBConnection::rq方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::rq方法的具体用法?PHP DBConnection::rq怎么用?PHP DBConnection::rq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection::rq方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mailForm
function mailForm(){
$db=new DBConnection();
$templates=array();
$templates[0]='Select template to use';
$query='SELECT mail_templates_id, mail_template_title FROM mail_templates ORDER BY mail_template_title';
$res=$db->rq($query);
while(($row=$db->fetch($res)) != FALSE) {
$templates[$row['mail_templates_id']]=$row['mail_template_title'];
}
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>Editing Mail Settings</b></div>
<form name="addNewExpDate" method="POST" id="MainForms" action="">
<fieldset class="mainFormHolder" style="width:400px;">
<legend>SMTP Settings</legend>';
$query='SELECT * FROM global_settings WHERE section="mail_assigns"';
$res=$db->rq($query);
while(($row=$db->fetch($res)) != FALSE) {
$pcontent.='
<div class="formsLeft" style="width:150px;">'.$row['variable'].':</div>
<div class="formsRight">
<select name="Assign'.$row['global_settings_id'].'" class="text-input">';
foreach ($templates AS $TemplateID=>$TemplateName) {
$pcontent.='<option value="'.$TemplateID.'"'.(($TemplateID==$row['variable_value'])?' selected':'').'>'.$TemplateName.'</option>';
}
$pcontent.='
</select>
</div>
<br />';
}
$pcontent.='
<input type="hidden" name="_form_submit" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'mails_assigns.php\';" />
</fieldset>
</form>
</div>';
$db->close();
return $pcontent;
}
示例2: addNewAdmin
/**
* Add new admin action
* @param int $admins_id
* @return string
*/
function addNewAdmin($admins_id = 0) {
if ($admins_id && !isset($_POST['_form_submit'])){
$_SESSION['admin']['uedit'] = $admins_id;
$db = new DBConnection();
$query = 'SELECT * FROM ul_logins WHERE id='.($admins_id+0).'';
$res = $db->rq($query);
foreach ($db->fetch($res) as $RowName => $RowValue){
$FormFieldName = str_replace('adm_', '', $RowName);
$_POST[$FormFieldName] = $RowValue;
}
$now = new \DateTime();
$column = new \DateTime($_POST['block_expires']);
if ($column > $now) {
$_POST['status'] = 0;
}
else {
$_POST['status'] = 1;
}
unset($_POST['password']);
$db->close();
}
$view = new App\View\View('admin/add');
$view->admin_id = $admins_id;
$view->data = $_POST;
return $view->render();
}
示例3: addLog
function addLog($log_area = '', $log_section = '', $log_user = '', $log_admin = '', $log_details = '')
{
$user_ip = GetHostByName($_SERVER["REMOTE_ADDR"]);
$db = new DBConnection();
$query = 'INSERT INTO logs SET
log_area="' . $log_area . '",log_section="' . $log_section . '",log_user="' . $log_user . '",log_admin="' . $log_admin . '",log_details="' . $log_details . '",
log_date="' . date('Y-m-d H:i:s', CUSTOMTIME) . '", log_ip="' . $user_ip . '"';
$db->rq($query);
}
示例4: addNewAdvisor
function addNewAdvisor($users_advisors_id=0) {
if ($users_advisors_id&&!$_POST['_form_submit']){
$_SESSION['admin']['uedit']=$users_advisors_id;
$db=new DBConnection();
$query='SELECT * FROM users_advisors WHERE users_advisors_id='.($users_advisors_id+0).'';
$res=$db->rq($query);
foreach ($db->fetch($res) as $RowName=>$RowValue){
$FormFieldName=str_replace('advisor_', '', $RowName);
$_POST[$FormFieldName]=$RowValue;
}
$db->close();
}
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($users_advisors_id>0)?'Editing':'Creating New').' Advisor</b></div>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/advisors.js"></script>
<form name="addNewAdvisor" method="POST" id="MainForms" action="">
<fieldset class="mainFormHolder">
<legend>User information</legend>
<div class="formsLeft">REF:</div>
<div class="formsRight">
<input class="text-input" type="text" name="ref" id="ref" value="'.$_POST['ref'].'" />
</div>
<br />
<div class="formsLeft">Names:</div>
<div class="formsRight">
<input class="text-input" name="names" id="names" value="'.$_POST['names'].'" />
</div>
<br />
<div class="formsLeft">Firm:</div>
<div class="formsRight">
<input class="text-input" name="firm" id="firm" value="'.$_POST['firm'].'" />
</div>
<br />
<div class="formsLeft">Contacts:</div>
<div class="formsRight">
<input class="text-input" name="contacts" id="contacts" value="'.$_POST['contacts'].'" />
</div>
<input type="hidden" name="_form_submit" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />
';
if ($users_advisors_id){
$pcontent.='
<input type="hidden" name="advid" value="'.$users_advisors_id.'">
<input type="button" name="_delete" value="'.getLang('sform_delbtn').'" class="submitBtn ui-state-default" onclick="if(confirm(\'Are you sure you want to delete this advisor?\')) location=\'?action=delete&advid='.($_POST['users_advisors_id']+0).'\';" />';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'users_advisors.php\';" />
</fieldset>
</form>
</div>';
return $pcontent;
}
示例5: addNewExpDate
function addNewExpDate($expiry_dates_id=0){
if($expiry_dates_id&&!$_POST['_form_submit']) {
$_SESSION['admin']['uedit']=$expiry_dates_id;
$db=new DBConnection();
$query='SELECT * FROM expiry_dates WHERE expiry_dates_id='.($expiry_dates_id+0).'';
$res=$db->rq($query);
foreach ($db->fetch($res) AS $RowName=>$RowValue) {
$_POST[$RowName]=$RowValue;
}
$db->close();
}
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($expiry_dates_id>0)?'Editing':'Creating New').' Expiry Date</b></div>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/expiry_dates.js"></script>
<form name="addNewExpDate" method="POST" id="MainForms" action="">
<fieldset class="mainFormHolder">
<legend>Date information</legend>
<div class="formsLeft">Expiry date:</div>
<div class="formsRight">
<input class="text-input" type="text" name="expiry_date" id="expiry_date" value="'.$_POST['expiry_date'].'" autocomplete="off" />
</div>
<input type="hidden" name="_form_submit" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />';
if($expiry_dates_id) {
$pcontent.='
<input type="hidden" name="edid" value="'.$expiry_dates_id.'">
<input type="button" name="_delete" value="'.getLang('sform_delbtn').'" class="submitBtn ui-state-default" onclick="if(confirm(\'Are you sure you want to delete this expiry date?\')) location=\'?action=delete&edid='.($_POST['expiry_dates_id']+0).'\';" />';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'expiry_dates.php\';" />
</fieldset>
</form>
</div>';
return $pcontent;
}
示例6: addNewTradeSell
function addNewTradeSell($tradesSell_id=0) {
$db=new DBConnection();
if ($tradesSell_id&&!$_POST['_form_submit']){
$query='SELECT * FROM trades WHERE trade_ref="'.$tradesSell_id.'"';
$res=$db->rq($query);
$_POST=$db->fetch($res);
$_SESSION['admin']['uedit']=$_POST['trades_id'];
}
$JSCripts=' onchange="setDetails(0);"';
$JSCriptsPremium=' onchange="setDetails(1);"';
if ($_POST['trade_date']=='') $_POST['trade_date']=date('Y-m-d', CUSTOMTIME);
global $tradesSellStatuses;
global $tradesBuyOptions;
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($_GET['action']=='new_sell')?'Adding new':'Editing').' SELL Order</b></div>
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/tradesSell.js"></script>
<script type="text/javascript">
jQuery(document).ready(
function($) {
var sliderValue = '.$_POST['trade_positions_left'].';
$("#slider").slider( {
min : 1,
max : '.$_POST['trade_positions_left'].',
step : 1,
value : [ sliderValue ],
slide : function(event, ui) {
$("#sliderVal").val(ui.value);
}
});
$("#sliderVal").attr("value", sliderValue);
$("#sliderVal").keyup(function() {
var sliderValue = +this.value;
if (sliderValue >= 1 && sliderValue <= '.$_POST['trade_positions_left'].') {
$("#slider").slider("value", sliderValue);
} else {
alert("Please enter a value between 1 and '.$_POST['trade_positions_left'].'");
$("#slider").slider("value", 1);
$("#sliderVal").attr("value", 1);
}
});
$("#slider, #sliderVal").bind("mousedown mouseup mousemove mouseout mouseover", function() {
setDetails();
});
setDetails();
});
</script>
<form name="addNewTradeBuy" method="POST" id="MainForms" action="">
<div class="left">
<fieldset class="mainFormHolder left">
<legend>Account</legend>
<div class="formsRight">
<select name="user_account_num" id="user_account_num" class="text-input-big" title="Please select user account!" validate="required:true">';
$query='SELECT user_account_num, user_firstname, user_lastname, user_balance FROM users WHERE user_account_num="'.$_POST['user_account_num'].'" LIMIT 1';
$res=$db->rq($query);
while (($row=$db->fetch($res))!=FALSE){
$pcontent.='<option value="'.$row['user_account_num'].'">'.$row['user_account_num'].' ('.$row['user_firstname'].' '.$row['user_lastname'].', $'.$row['user_balance'].')</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Contract</legend>
<div class="formsLeft">Trade Order:</div>
<div class="formsRight">SELL</div>
<br />
<div class="formsLeft">Position(s):</div>
<div class="formsRight">
<div id="slider"><a href="#"></a></div> <input type="text" class="text-input-smallest left" id="sliderVal" name="trade_positions"'.$JSCripts.' />
</div>
<br /><br />
<div class="formsLeft">Option:</div>
<div class="formsRight"><input class="text-input ui-state-default" type="text" name="trade_option" id="trade_option" value="'.$tradesBuyOptions[$_POST['trade_option']].'"></div>
<br />
<div class="formsLeft">Commodity:</div>
<div class="formsRight">';
$query='SELECT * FROM commodities WHERE commodities_id='.($_POST['commodities_id']+0).' LIMIT 1';
$res=$db->rq($query);
$row=$db->fetch($res);
//.........这里部分代码省略.........
示例7: page_header_simple
function page_header_simple($redirect = 0)
{
if ($_SESSION['user']['is_logged'] == 1) {
$PageTitle = getLang('ptitle_logged');
} else {
$PageTitle = getLang('ptitle_notlogged');
}
echo '<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>' . $PageTitle . '</title>
<meta http-equiv="content-type" content="application/xhtml+xml" />
<meta http-equiv="X-UA-Compatible" content="IE=100" />
<meta name="robots" content="NOINDEX,NOFOLLOW" />
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1;">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
';
echo '
<link href="adminica/styles/adminica/reset.css" media="all" rel="stylesheet" type="text/css" />
<link href="adminica/styles/plugins/all/plugins.css" media="all" rel="stylesheet" type="text/css" />
<link href="adminica/styles/adminica/all.css" media="all" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="adminica/styles/themes/layout_switcher.php?default=layout_fixed.css" >
<link rel="stylesheet" href="adminica/styles/themes/nav_switcher.php?default=nav_top.css" >
<link rel="stylesheet" href="adminica/styles/themes/skin_switcher.php?default=skin_light.css" >
<link rel="stylesheet" href="adminica/styles/themes/theme_switcher.php?default=theme_blue.css" >
<link rel="stylesheet" href="adminica/styles/themes/bg_switcher.php?default=bg_white_wall.css" >
<link rel="stylesheet" href="adminica/styles/adminica/colours.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css">
<link href="css/validationEngine.jquery.css" media="all" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="adminica/scripts/plugins-min.js"></script>
<script type="text/javascript" src="adminica/scripts/adminica/adminica_all-min.js"></script>
<!--<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>-->
<script type="text/javascript" src="js/scripts.js"></script>';
if ($SelectedTab == 2) {
echo '
<link href="css/jquery.jqplot.css" media="all" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/excanvas.min.js"></script>
<script type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="js/plugins/jqplot.dateAxisRenderer.min.js"></script>
<script type="text/javascript" src="js/plugins/jqplot.canvasTextRenderer.min.js"></script>
<script type="text/javascript" src="js/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
<script type="text/javascript" src="js/plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="js/plugins/jqplot.barRenderer.js"></script>
';
}
echo '
<style>
.xLabel
{
display: inline-block;
width: 50%;
}
</style>
</head>
<body>
<div id="pjax">';
include 'includes/custom_header.php';
if ($_SESSION['user']['is_logged'] == 1) {
echo '<div id="main_container" class="main_container container_16 clearfix">';
include 'adminica/includes/components/navigation.php';
} else {
$db = new DBConnection();
$UserIP = GetHostByName($_SERVER["REMOTE_ADDR"]);
$query = 'SELECT banned_ips_id FROM banned_ips WHERE banned_ip="' . $UserIP . '" LIMIT 1';
$res = $db->rq($query);
$num_rows = $db->num_rows($res);
$db->close();
if ($num_rows > 0) {
echo '</div><div class="LoginContainer"><h3>' . getLang('lform_publicbanmessage') . '</h3></div>';
} else {
//include('parts/login_box.php');
}
}
}
示例8: DBConnection
<?php
require '../vendor/autoload.php';
require_once '../classes/db.class.php';
require_once '../includes/timefix.php';
set_time_limit(900);
$db = new DBConnection();
$today = date('Y-m-d', CUSTOMTIME);
$query = 'UPDATE trades SET trade_status=4 WHERE trade_expiry_date<"' . $today . '" AND trade_status=1';
$db->rq($query);
$query = 'SELECT user_account_num, user_lscp, user_lscp FROM users WHERE user_status=1';
$res = $db->rq($query);
while (($row = $db->fetch($res)) != FALSE) {
$query2 = 'SELECT MIN(trade_strikeprice) AS min_strike FROM trades WHERE trade_status=1 AND trade_option=1 AND user_account_num="' . $row['user_account_num'] . '"';
$res2 = $db->rq($query2);
$row2 = $db->fetch($res2);
if ($row2['min_strike'] < $row['user_lscp'] || $row['user_lscp'] == 0) {
$query3 = 'UPDATE users SET user_lscp="' . ($row2['min_strike'] + 0) . '", user_lastupdate="' . date('Y-m-d H:i:s', CUSTOMTIME) . '"
WHERE user_account_num="' . $row['user_account_num'] . '"';
$db->rq($query3);
}
$query4 = 'SELECT MAX(trade_strikeprice) AS max_strike FROM trades WHERE trade_status=1 AND trade_option=2 AND user_account_num="' . $row['user_account_num'] . '"';
$res4 = $db->rq($query4);
$row4 = $db->fetch($res4);
if ($row4['max_strike'] > $row['user_hpsp'] || $row['user_hpsp'] == 0) {
$query5 = 'UPDATE users SET user_hpsp="' . ($row4['max_strike'] + 0) . '", user_lastupdate="' . date('Y-m-d H:i:s', CUSTOMTIME) . '"
WHERE user_account_num="' . $row['user_account_num'] . '"';
$db->rq($query5);
}
$query6 = 'SELECT COUNT(trades_id) AS total_trades FROM trades WHERE trade_status=1 AND user_account_num="' . $row['user_account_num'] . '"';
$res6 = $db->rq($query6);
示例9: addNewWithdraw
function addNewWithdraw($transferID=0) {
$db=new DBConnection();
if ($transferID && !isset($_POST['_form_submit'])){
$query='SELECT * FROM transfers WHERE tr_ref="'.$transferID.'"';
$res=$db->rq($query);
$_POST=$db->fetch($res);
}
$JSCripts=' onkeyup="setDetails();" onchange="setDetails();"';
if (array_get($_GET, 'uid', 0) > 0){
$query='SELECT user_bank_online,user_bank_beneficiary,user_bank_address,user_bank_account,user_bank_name,user_bank_codetype,user_bank_code,
user_bank_moredetails FROM users WHERE user_account_num="'.(array_get($_GET, 'uid', 0)).'"';
$res=$db->rq($query);
$row=$db->fetch($res);
foreach ($row as $Column=>$ColumnValue){
$fixColumnName=str_replace('user_', 'tr_', $Column);
$_POST[$fixColumnName]=$ColumnValue;
}
}
if (!isset($_POST['tr_fees']) || empty($_POST['tr_fees'])){
$_POST['tr_fees']='0.00';
}
if (!isset($_POST['tr_date']) || empty($_POST['tr_date'])){
$_POST['tr_date']=date('Y-m-d', CUSTOMTIME);
}
global $depositOptions;
$userBankCodeTypes=array(1=>'SWIFT Code', 2=>'IBAN Code', 3=>'ABA #', 4=>'BSC Code');
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($transferID>0)?'Editing':'Adding New').' Withdraw</b></div>
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/transfersWithdraw.js"></script>
<form name="addNewDeposit" method="POST" id="MainForms" action="">
<div class="left">
<fieldset class="mainFormHolder left">
<legend>Account</legend>
<div class="formsRight">
<select name="user_account_num" id="user_account_num" class="text-input-big" title="Please select user account!" validate="required:true">
<option value="">Select account</option>';
$query='SELECT user_account_num, user_firstname, user_lastname, user_balance FROM users ORDER BY user_firstname ASC, user_lastname ASC';
$res=$db->rq($query);
while (($row=$db->fetch($res))!=FALSE){
$pcontent.='<option value="'.$row['user_account_num'].'"'.((array_get($_GET, 'uid') == $row['user_account_num'] || array_get($_POST, 'user_account_num')==$row['user_account_num'])?' selected':'').'>'.$row['user_account_num'].' ('.$row['user_firstname'].' '.$row['user_lastname'].', $'.$row['user_balance'].')</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Bank Details</legend>
<br />
<div class="formsLeft">Beneficiary:</div>
<div class="formsRight">
<input class="text-input" type="text" name="tr_bank_beneficiary" id="tr_bank_beneficiary" value="'.array_get($_POST, 'tr_bank_beneficiary').'" />
</div>
<br />
<div class="formsLeft">Bank Address:</div>
<div class="formsRight">
<textarea class="text-area" name="tr_bank_address" id="tr_bank_address">'.array_get($_POST, 'tr_bank_address').'</textarea>
</div>
<br />
<div class="formsLeft">Bank Account:</div>
<div class="formsRight">
<input class="text-input" type="text" name="tr_bank_account" id="tr_bank_account" value="'.array_get($_POST, 'tr_bank_account').'" />
</div>
<br />
<div class="formsLeft">Bank Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="tr_bank_name" id="tr_bank_name" value="'.array_get($_POST, 'tr_bank_name').'" />
</div>
<br />
<div class="formsLeft">
<select name="tr_bank_codetype" class="select-medium">';
foreach ($userBankCodeTypes as $BankCodeID=>$BankCodeType){
$pcontent.='<option value="'.$BankCodeID.'"'.(($BankCodeID==array_get($_POST, 'tr_bank_codetype'))?' selected':'').'>'.$BankCodeType.'</option>';
}
$pcontent.='
</select>
</div>
<div class="formsRight">
<input class="text-input" type="text" name="tr_bank_code" id="tr_bank_code" value="'.array_get($_POST, 'tr_bank_code').'" />
</div>
<br />
<div class="formsLeft">More Bank Details:</div>
//.........这里部分代码省略.........
示例10: foreach
}
}
$searchFor='';
if ($_GET['sSearch']!=''){
$searchFor.='WHERE ';
foreach ($searchColumns AS $Count=>$columnToSearch) {
$addOr='';
if($Count!=0) $addOr.=' OR ';
$searchFor.=$addOr.$columnToSearch.' LIKE "%'.$db->string_escape($_GET['sSearch']).'%"';
}
}
$searchQuery='SELECT SQL_CALC_FOUND_ROWS * FROM commodities_groups '.$searchFor.' '.$searchOrder.' '.$searchLimit.'';
$rResult=$db->rq($searchQuery);
$query='SELECT FOUND_ROWS() AS frows';
$res=$db->rq($query);
$row=$db->fetch($res);
$iFilteredTotal=$row['frows'];
$query='SELECT COUNT(commodities_groups_id) AS total_groups FROM commodities_groups';
$res=$db->rq($query);
$row=$db->fetch($res);
$iTotal=$row['total_groups'];
$sOutput='{';
$sOutput.='"sEcho": '.$_GET['sEcho'].', ';
$sOutput.='"iTotalRecords": '.$iTotal.', ';
$sOutput.='"iTotalDisplayRecords": '.$iFilteredTotal.', ';
示例11: addNewUser
function addNewUser($users_id=0) {
$db=new DBConnection();
if($users_id&&!$_POST['_form_submit']) {
$query='SELECT * FROM users WHERE user_account_num="'.$users_id.'"';
$res=$db->rq($query);
$_POST=$db->fetch($res);
$_SESSION['admin']['uedit']=$_POST['users_id'];
$FullREF=explode('-', $_POST['user_fullref']);
$UserNID=$FullREF[1];
$JSCripts='';
}else {
$JSCripts=' onkeyup="generateAccountInfos();" onblur="generateAccountInfos();"';
$_POST['user_password']='xy'.date('d', CUSTOMTIME).'r89';
$_POST['user_app_date']=date('Y-m-d', CUSTOMTIME);
}
global $userTitles;
global $userStatuses;
global $userBankCodeTypes;
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($users_id>0)?'Editing':'Creating New').' User Account</b></div>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/users.js"></script>
<form name="addNewUser" method="POST" id="MainForms" action="">
<div class="left">
<fieldset class="mainFormHolder left minHeight200">
<legend>Contact Information</legend>
<div class="formsLeft">Title:</div>
<div class="formsRight">
<select name="user_title" class="text-input">';
foreach ($userTitles AS $TitleID=>$TitleName) {
$selected='';
if($_POST['user_title']==$TitleID) $selected=' selected';
$pcontent.='<option value="'.$TitleID.'"'.$selected.'>'.$TitleName.'</option>';
}
$pcontent.='
</select>
</div>
<br />
<div class="formsLeft">First Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_firstname" id="user_firstname" value="'.$_POST['user_firstname'].'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Middle Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_middlename" id="user_middlename" value="'.$_POST['user_middlename'].'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Last Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_lastname" id="user_lastname" value="'.$_POST['user_lastname'].'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Email:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_email" id="user_email" value="'.$_POST['user_email'].'" />
</div>
<br />
<div class="formsLeft">Phone:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_phone" id="user_phone" value="'.$_POST['user_phone'].'" />
</div>
<br />
<div class="formsLeft">Mailing Address:</div>
<div class="formsRight">
<textarea class="text-area-small2rows" name="user_mailing_address" id="user_mailing_address" rows="2" cols="1">'.$_POST['user_mailing_address'].'</textarea>
</div>
<br />
<div class="formsLeft">Postal Code/ZIP:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_postal" id="user_postal" value="'.$_POST['user_postal'].'" />
</div>
<br />
<div class="formsLeft">City:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_city" id="user_city" value="'.$_POST['user_city'].'" />
</div>
<br />
<div class="formsLeft">State/Province:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_state" id="user_state" value="'.$_POST['user_state'].'" />
</div>
<br />
<div class="formsLeft">Country:</div>
<div class="formsRight">
<select name="user_country" id="user_country" class="text-input">';
//.........这里部分代码省略.........
示例12: DBConnection
if($_SESSION['admin']['is_logged']==1) {
$db=new DBConnection();
$query='DELETE FROM mail_queue WHERE mail_queue_id='.($_GET['mailid']+0);
$db->rq($query);
$db->close();
header('Location: mails_outbox.php');
exit();
}
break;
case 'massdel' :
if($_SESSION['admin']['is_logged']==1) {
$db=new DBConnection();
$query='DELETE FROM mail_queue WHERE is_sent=0';
$db->rq($query);
$db->close();
header('Location: mails_outbox.php');
exit();
}
break;
default :
$page_content=listOutgoingMails();
break;
}
page_header();
echo $page_content;
page_footer();
?>
示例13: addNewCommodity
function addNewCommodity($commodities_id=0) {
if($commodities_id&&!$_POST['_form_submit']) {
$_SESSION['admin']['uedit']=$commodities_id;
$db=new DBConnection();
$query='SELECT * FROM commodities WHERE commodities_id='.($commodities_id+0).'';
$res=$db->rq($query);
foreach ($db->fetch($res) AS $RowName=>$RowValue) {
$_POST[$RowName]=$RowValue;
}
$db->close();
}
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($commodities_id>0)?'Editing':'Creating New').' Commodity</b></div>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/commodities.js"></script>
<form name="addNewCommodity" method="POST" id="MainForms" action="">
<fieldset class="mainFormHolder">
<legend>Commodity information</legend>
<div class="formsLeft">Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="commodities_name" id="commodities_name" value="'.$_POST['commodities_name'].'" />
</div>
<br />
<div class="formsLeft">Group:</div>
<div class="formsRight">
<select name="commodities_groups_id" class="text-input">';
$db=new DBConnection();
$query='SELECT * FROM commodities_groups ORDER BY commodities_groups_name';
$res=$db->rq($query);
while(($row=$db->fetch($res)) != FALSE) {
$pcontent.='<option value="'.$row['commodities_groups_id'].'"'.(($_POST['commodities_groups_id']==$row['commodities_groups_id'])?' selected':'').'>'.$row['commodities_groups_name'].'</option>';
}
$db->close();
$pcontent.='
</select>
</div>
<br />
<div class="formsLeft">Symbol:</div>
<div class="formsRight">
<input class="text-input" name="commodities_symbol" id="commodities_symbol" value="'.$_POST['commodities_symbol'].'" />
</div>
<br />
<div class="formsLeft">Contract size:</div>
<div class="formsRight">
<input class="text-input" name="commodities_contract_size" id="commodities_contract_size" value="'.$_POST['commodities_contract_size'].'" />
</div>
<br />
<div class="formsLeft">Unit:</div>
<div class="formsRight">
<input class="text-input" name="commodities_unit" id="commodities_unit" value="'.$_POST['commodities_unit'].'" />
</div>
<br />
<div class="formsLeft">Default Fees:</div>
<div class="formsRight">
<input class="text-input" name="commodities_def_fee" id="commodities_def_fee" value="'.$_POST['commodities_def_fee'].'" />
</div>
<br />
<div class="formsLeft">Default Premium Price:</div>
<div class="formsRight">
<input class="text-input" name="commodities_def_prem" id="commodities_def_prem" value="'.$_POST['commodities_def_prem'].'" />
</div>
<br />
<div class="formsLeft">Status:</div>
<div class="formsRight">
<select name="commodities_status" class="text-input">
<option value="0"'.(($_POST['commodities_status']==0)?' selected':'').'>Not active</option>
<option value="1"'.(($_POST['commodities_status']==1)?' selected':'').'>Active</option>
</select>
</div>
<br />
<div class="formsLeft">Order priority:</div>
<div class="formsRight">
<input class="text-input" name="commodities_order_priority" id="commodities_order_priority" value="'.$_POST['commodities_order_priority'].'" />
</div>
<input type="hidden" name="_form_submit" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />';
if($commodities_id) {
$pcontent.='
<input type="hidden" name="cid" value="'.$commodities_id.'">
<input type="button" name="_delete" value="'.getLang('sform_delbtn').'" class="submitBtn ui-state-default" onclick="if(confirm(\'Are you sure you want to delete this commodity?\')) location=\'?action=delete&cid='.($_POST['commodities_id']+0).'\';" />';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'commodities.php\';" />
</fieldset>
</form>
</div>';
return $pcontent;
}
示例14: getLang
<?php
require_once 'common.php';
check_logged_in();
$PageTitle = getLang('ptitle_logged');
$db = new DBConnection();
$query = 'SELECT user_firstname, trading_type,user_lastname,user_account_num FROM users WHERE user_account_num="' . $_SESSION['user']['user_account_num'] . '" LIMIT 1';
$res = $db->rq($query);
$username = $db->fetch($res);
$total_change = 0;
$total_cost = 0;
$total_value = 0;
$total_profit = 0;
$total_pps_a = 0;
$total_pps_b = 0;
$query = 'SELECT * FROM stock_trades WHERE user_account_num="' . $_SESSION['user']['user_account_num'] . '" AND (trade_type="1" OR trade_type="3") AND trade_status="1" ORDER BY trade_date DESC';
$res = $db->rq($query);
$result = array();
while ($row = $db->fetch($res)) {
$subq = $db->rq("SELECT * FROM stocks WHERE stocks_id='" . $row['stocks_id'] . "' LIMIT 1");
$row['stock'] = $db->fetch($subq);
$subq = $db->rq("SELECT * FROM stock_details WHERE stocks_id='" . $row['stocks_id'] . "' ORDER BY date DESC LIMIT 1");
$row['details'] = $db->fetch($subq);
$total_pps_b += $row['trade_price_share'];
$total_pps_a += $row['details']['value'];
$total_cost += $row['trade_value'];
$row['cur_value'] = $row['details']['value'] * $row['trade_shares_left'];
$total_value += $row['cur_value'];
$row['profit'] = ($row['cur_value'] - $row['trade_value']) / $row['trade_value'] * 100;
if ($row['profit'] > 0) {
$row['profit_class'] = ' class="text-success"';
示例15: addNewTradeShort
function addNewTradeShort($tradesSell_id=0) {
$db=new DBConnection();
if ($tradesSell_id && !isset($_POST['_form_submit'])){
$query='SELECT * FROM stock_trades WHERE trade_ref="'.$tradesSell_id.'"';
$res=$db->rq($query);
$_POST=$db->fetch($res);
$_SESSION['admin']['uedit']=$_POST['trades_id'];
$JSCripts=' onchange="setDetails(0);"';
$JSCriptsSelect=' onchange="setDetails(3);"';
$JSCriptsPremium=' onchange="setDetails(1);"';
}else{
$_POST['trade_stockprice']='0.0000';
$_POST['trade_shares']=10;
$JSCripts=' onchange="setDetails(0);"';
$JSCriptsSelect=' onchange="setDetails(3);"';
$JSCriptsPremium=' onchange="setDetails(1);"';
}
if (array_get($_POST, 'trade_date') == ''){
$_POST['trade_date'] = date('Y-m-d', CUSTOMTIME);
}
global $tradesStatuses;
global $tradesBuyOptions;
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($tradesSell_id>0)?'Editing':'Adding New').' SHORT Order</b></div>
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/forms/stradesShort.js"></script>
<script type="text/javascript">
jQuery(document).ready(
function($) {
var sliderValue = '.$_POST['trade_shares'].';
$("#slider").slider( {
min : 1,
max : 99999,
step : 1,
value : [ sliderValue ],
slide : function(event, ui) {
$("#sliderVal").val(ui.value);
}
});
$("#sliderVal").attr("value", sliderValue);
$("#sliderVal").keyup(function() {
var sliderValue = +this.value;
if (sliderValue >= 1 && sliderValue <= 99999) {
$("#slider").slider("value", sliderValue);
} else {
alert("Please enter a value between 1 and 99999");
$("#slider").slider("value", 1);
$("#sliderVal").attr("value", 1);
}
});
$("#slider, #sliderVal").bind("mousedown mouseup mousemove mouseout mouseover", function() {
setDetails(0);
});
'.((!$tradesSell_id)?'setDetails(3);':'setDetails(4);').'
});
</script>
<form name="addNewTradeShort" method="POST" id="MainForms" action="">
<div class="left">
<fieldset class="mainFormHolder left">
<legend>Account</legend>
<div class="formsRight">
<select name="user_account_num" id="user_account_num" class="text-input-big" title="Please select user account!" validate="required:true"'.$JSCripts.'>
<option value="">Select account</option>';
$query='SELECT user_account_num, user_firstname, user_lastname, user_balance FROM users ORDER BY user_firstname ASC, user_lastname ASC';
$res=$db->rq($query);
while (($row=$db->fetch($res))!=FALSE){
$pcontent.='<option value="'.$row['user_account_num'].'"'.((array_get($_GET, 'uid')==$row['user_account_num']||array_get($_POST, 'user_account_num')==$row['user_account_num'])?' selected':'').'>'.$row['user_account_num'].' ('.$row['user_firstname'].' '.$row['user_lastname'].', $'.$row['user_balance'].')</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Transaction</legend>
<div class="formsLeft">Trade Order:</div>
<div class="formsRight">SHORT SELL</div>
<br />
<div class="formsLeft">Share(s):</div>
<div class="formsRight">
<div id="slider"><a href="#"></a></div> <input type="text" class="text-input-smallest left" id="sliderVal" name="trade_shares"'.$JSCripts.' />
</div>
<br /><br />
//.........这里部分代码省略.........