本文整理汇总了PHP中DBConnection::close方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::close方法的具体用法?PHP DBConnection::close怎么用?PHP DBConnection::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection::close方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4:
</div>
<div class="block" style="opacity: 1;">
<div class="section">
<div class="alert alert_light">
'.getLang('rw_notes').'
</div>
</div>
</div>
</div><!--End container_16-->
</form>
</div>';
$db->close();
echo $pcontent;
}
page_footer();
?>
<style>
.positive
{
示例5: resetPasswordAnswer
public function resetPasswordAnswer()
{
$db = new DBConnection();
$return = array();
$query = 'SELECT * FROM users WHERE user_email="' . $db->string_escape($_POST['rform_email']) . '" LIMIT 1';
$res = $db->rq($query);
$row = $db->fetch($res);
if (!isset($row['user_secret_answer'])) {
$return['error'] = getLang('reset_noansw');
} else {
if (strtolower(trim($_POST['rform_answer'])) == strtolower(trim($row['user_secret_answer']))) {
$pattern = '/^[\\_]*([a-z0-9]+(\\.|\\_*)?)+@([a-z][a-z0-9\\-]+(\\.|\\-*\\.))+[a-z]{2,6}$/i';
$check = preg_match($pattern, $_POST['rform_email']);
if ($check == 0) {
$return['error'] = getLang('reset_invalid_email');
} else {
$db = new DBConnection();
$query = 'SELECT u.*, ua1.advisor_names as user_advisor1, ua2.advisor_names as user_advisor2 FROM users u
left join users_advisors ua1 on u.user_advisor1 = ua1.users_advisors_id
left join users_advisors ua2 on u.user_advisor2 = ua2.users_advisors_id
WHERE u.user_email="' . $_POST['rform_email'] . '" LIMIT 1';
$res = $db->rq($query);
$num_rows = $db->num_rows($res);
if ($num_rows > 0) {
$row = $db->fetch($res);
addLog('Front-end', 'Login', '' . $row['user_firstname'] . ' ' . $row['user_lastname'] . ' (' . $row['user_account_num'] . ')', 0, 'Password reset request.');
/*$possible = '0123456789abcdfghjklmnopqrstuvwxyzABCDFGHJKLMNOPQRSTUVWXYZ';
$newpass = '';
$i = 0;
for($i=0;$i<8;$i++) {
$newpass.= substr($possible, mt_rand(0, strlen($possible)-1), 1);
}
$query2='UPDATE users SET user_password="'.$newpass.'", user_passisset=0 WHERE users_id='.($row['users_id']+0).'';
$db->rq($query2);
*/
$query3 = 'SELECT * FROM mail_templates mt LEFT JOIN global_settings gs ON mt.mail_templates_id=gs.variable_value WHERE variable="Forgot password"';
$res3 = $db->rq($query3);
$num_rows3 = $db->num_rows($res3);
if ($num_rows3 > 0) {
$row3 = $db->fetch($res3);
$query4 = 'SELECT * FROM global_settings WHERE section="mail_settings"';
$res4 = $db->rq($query4);
while (($row4 = $db->fetch($res4)) != FALSE) {
if ($row4['variable'] == 'mail_mandrill_host' && $row4['variable_value'] != '') {
$smtp_host = $row4['variable_value'];
}
if ($row4['variable'] == 'mail_mandrill_port' && $row4['variable_value'] != '') {
$smtp_port = $row4['variable_value'];
}
if ($row4['variable'] == 'mail_mandrill_user' && $row4['variable_value'] != '') {
$smtp_user = $row4['variable_value'];
}
if ($row4['variable'] == 'mail_mandrill_password' && $row4['variable_value'] != '') {
$smtp_password = $row4['variable_value'];
}
}
include 'nomad_mimemail.inc.php';
$mimemail = new nomad_mimemail();
$mimemail->set_charset("UTF-8");
if ($row3['mail_from'] != '') {
$mimemail->set_from($row3['mail_from_mail'], $row3['mail_from']);
$mimemail->set_reply_to($row3['mail_from_mail'], $row3['mail_from']);
} else {
$mimemail->set_from($row3['mail_from_mail']);
$mimemail->set_reply_to($row3['mail_from_mail']);
}
$search_for = array('{user_first_name}', '{user_last_name}', '{user_username}', '{user_password}', '{user_password_org}', '{user_account_num}', '{user_account_name}', '{user_admin_ref}', '{user_phone}', '{user_email}', '{user_mailing_address}', '{user_city}', '{user_state}', '{user_postal}', '{user_country}', '{user_advisor1}', '{user_advisor2}', '{user_app_date}');
$replace_with = array($row['user_firstname'], $row['user_lastname'], $row['user_username'], $row['user_password'], $row['user_password'], $row['user_account_num'], $row['user_account_name'], $row['user_ref'], $row['user_phone'], $row['user_email'], $row['user_mailing_address'], $row['user_city'], $row['user_state'], $row['user_postal'], $row['user_country'], $row['user_advisor1'], $row['user_advisor2'], $row['user_app_date']);
$row3['mail_html'] = str_replace($search_for, $replace_with, $row3['mail_html']);
$row3['mail_plain'] = str_replace($search_for, $replace_with, $row3['mail_plain']);
$t_search_for = array('{thanks}');
$t_replace_with_html = array(getLang('mails_thanks_html'));
$t_replace_with_plain = array(getLang('mails_thanks_plain'));
$row3['mail_html'] = str_replace($t_search_for, $t_replace_with_html, $row3['mail_html']);
$row3['mail_plain'] = str_replace($t_search_for, $t_replace_with_plain, $row3['mail_plain']);
$mimemail->set_subject($row3['mail_subject']);
$mimemail->set_html($row3['mail_html']);
$mimemail->set_text($row3['mail_plain']);
$mimemail->set_to($_POST['rform_email'], '' . $row['user_firstname'] . ' ' . $row['user_lastname'] . '');
if ($row3['mail_bcc']) {
$mimemail->set_bcc($row3['mail_bcc']);
}
$mimemail->set_smtp_host($smtp_host, $smtp_port);
$mimemail->set_smtp_auth($smtp_user, $smtp_password);
$mimemail->send();
}
$db->close();
$return['success'] = getLang('rform_newpass');
} else {
$return['error'] = getLang('reset_noemail');
}
}
} else {
//.........这里部分代码省略.........
示例6: addNewTradeShort
//.........这里部分代码省略.........
$totalRelated=0;
$query2='SELECT trade_details, stock_trades.trade_ref FROM trades_related tr LEFT JOIN stock_trades ON tr.trade_ref=stock_trades.trade_ref WHERE trade_ref_relatedto="'.array_get($_POST, 'trade_ref').'"';
$res2=$db->rq($query2);
$totalRelated=$db->num_rows($res2);
if ($totalRelated>0){
$pcontent.='
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Related Trades</legend><br />';
while (($row2=$db->fetch($res2))!=FALSE){
$pcontent.='<div class="ui-state-default trade-details"><a href="strades.php?action=edit_sell&tref='.$row2['trade_ref'].'" style="display:block;">'.$row2['trade_details'].'</a></div><br />';
}
$pcontent.='
</fieldset>';
}
$pcontent.='
</div>
<div class="left">
<fieldset class="mainFormHolder left">
<legend>Prices</legend>
<div class="formsLeft">Price/share:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="trade_price_share" id="trade_price_share" value="'.array_get($_POST, 'trade_price_share').'"'.$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="'.array_get($_POST, 'trade_value').'" readonly />
</div>
<br />
<div class="formsLeft">Fees:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="trade_fees" id="trade_fees" value="'.array_get($_POST, 'trade_fees').'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Total Invoiced:</div>
<div class="formsRight">
<input class="text-input align-right ui-state-default" type="text" name="trade_invoiced" id="trade_invoiced" value="'.array_get($_POST, 'trade_invoiced').'" />
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Settings</legend>
<div class="formsLeft">Value date:</div>
<div class="formsRight">
<input class="text-input" type="text" name="trade_date" id="trade_date" value="'.array_get($_POST, 'trade_date').'" />
</div>
<br />
<div class="formsLeft">Status:</div>
<div class="formsRight">
<select name="trade_status" class="text-input">';
foreach ($tradesStatuses as $StatusID=>$StatusName){
$pcontent.='<option value="'.$StatusID.'"'.(($StatusID==array_get($_POST, 'trade_status'))?' selected':'').'>'.$StatusName.'</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<div class="mainFormHolder left btnsHolder">';
if ($totalRelated==0){
$pcontent.='
<input type="hidden" name="_form_submit" value="1" />
<input type="hidden" name="_add_short" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />';
if ($tradesSell_id){
$pcontent.='
<input type="hidden" name="tref" value="'.$tradesSell_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 BUY?\')) location=\'?action=delete_buy&buyid='.($_POST['trade_ref']).'\';" />';
}
}else{
$pcontent.='
<div class="ui-state-error bold" style="width:300px; margin:auto; padding:5px;">
These BUY trade have been partially or totally sold and therefore cannot be updated.
</div>';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'strades.php\';" />
</div>
</div>
</form>
</div>';
$db->close();
return $pcontent;
}
示例7: addNewTradeSell
//.........这里部分代码省略.........
<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>
<br />
<div class="formsLeft">Fees:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="trade_fees" id="trade_fees" value="'.$_POST['trade_fees'].'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Total Invoiced:</div>
<div class="formsRight">
<input class="text-input align-right ui-state-default" type="text" name="trade_invoiced" id="trade_invoiced" value="'.$_POST['trade_invoiced'].'" />
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Settings</legend>
<div class="formsLeft">Value date:</div>
<div class="formsRight"><input class="text-input" type="text" name="trade_date" id="trade_date" value="'.$_POST['trade_date'].'" /></div>
<br />
<div class="formsLeft">Status:</div>
<div class="formsRight">
<select name="trade_status" class="text-input">';
foreach ($tradesSellStatuses as $StatusID=>$StatusName){
$pcontent.='<option value="'.$StatusID.'"'.(($StatusID==$_POST['trade_status'])?' selected':'').'>'.$StatusName.'</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<div class="mainFormHolder left btnsHolder">
<input type="hidden" name="_form_submit" value="1" />
<input type="hidden" name="_add_sell" value="1" />
<input type="hidden" name="trid" value="'.$tradesSell_id.'">
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />
<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 SELL?\')) location=\'?action=delete_sell&sellid='.($_POST['trade_ref']).'\';" />
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'trades.php\';" />
</div>
</div>
</form>
</div>';
$db->close();
return $pcontent;
}
示例8: 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');
}
}
}
示例9: addNewWithdraw
//.........这里部分代码省略.........
<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>
<div class="formsRight">
<textarea class="text-area" name="tr_bank_moredetails" id="tr_bank_moredetails">'.array_get($_POST, 'tr_bank_moredetails').'</textarea>
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Notes</legend>
<div class="formsRight" style="height:105px;">
<textarea class="text-area-big" style="height:95px;" name="tr_notes" id="user_notes">'.array_get($_POST, 'tr_notes').'</textarea>
</div>
</fieldset>
</div>
<div class="left">
<fieldset class="mainFormHolder left">
<legend>Transfer</legend>
<div class="formsLeft">Withdraw:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="tr_value" id="tr_value" value="'.array_get($_POST, 'tr_value').'"'.$JSCripts.' autocomplete="off" />
</div>
<br />
<div class="formsLeft">Fees:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="tr_fees" id="tr_fees" value="'.array_get($_POST, 'tr_fees').'"'.$JSCripts.' />
</div>
<br />
<div class="formsLeft">Total Withdraw:</div>
<div class="formsRight">
<input class="text-input align-right" type="text" name="tr_total" id="tr_total" value="'.array_get($_POST, 'tr_total').'" readonly />
</div>
<br />
<div class="formsLeft">Value date:</div>
<div class="formsRight"><input class="text-input" type="text" name="tr_date" id="trade_date" value="'.array_get($_POST, 'tr_date').'" /></div>
<br />
<div class="formsLeft">Status:</div>
<div class="formsRight">
<select name="tr_status" class="text-input">';
foreach ($depositOptions as $StatusID=>$StatusName){
$pcontent.='<option value="'.$StatusID.'"'.(($StatusID==array_get($_POST, 'tr_status'))?' selected':'').'>'.$StatusName.'</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<div class="mainFormHolder left btnsHolder">
<input type="hidden" name="_add_withdraw" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />';
if ($transferID){
$pcontent.='
<input type="hidden" name="trid" value="'.$transferID.'">
<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 withdraw?\')) location=\'?action=delete_withdraw&wtrid='.($_POST['tr_ref']).'\';" />';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="'.((array_get($_GET, 'uid', 0) > 0)?'location=\'users.php\'':'location=\'transfers.php\'').';" />
</div>
</div>
</form>
</div>';
$db->close();
return $pcontent;
}
示例10: addNewUser
//.........这里部分代码省略.........
<input class="text-input" type="text" name="user_bank_code" id="user_bank_code" value="'.$_POST['user_bank_code'].'" />
</div>
<br />
<div class="formsLeft">More Bank Details:</div>
<div class="formsRight">
<textarea class="text-area" name="user_bank_moredetails" id="user_bank_moredetails">'.$_POST['user_bank_moredetails'].'</textarea>
</div>
</span>
</fieldset>
</div>
<div class="left">
<fieldset class="mainFormHolder left minHeight200">
<legend>Account Information</legend>
<div class="formsLeft">Admin Reference:</div>
<div class="formsRight">
<input class="text-input-smaller" type="text" name="user_ref" id="user_ref" value="'.(($_POST['user_ref']!='')?''.$_POST['user_ref'].'':''.$_SESSION['admin']['refnum'].'').'" readonly />
<input class="text-input-small" type="text" name="user_refid" id="user_refid" value="'.(($UserNID!='')?''.$UserNID.'':''. NID.'').'" readonly />
</div>
<br />
<div class="formsLeft">Account Number:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_account_num" id="user_account_num" value="'.(($users_id!='')?''.$users_id.'':''. NID.'').'" readonly />
</div>
<br />
<div class="formsLeft">Account Name:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_account_name" id="user_account_name" value="'.$_POST['user_account_name'].'" />
</div>
<br />
<div class="formsLeft">Username:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_username" id="user_username" value="'.$_POST['user_username'].'" />
</div>
<br />
<div class="formsLeft">Password:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_password" id="user_password" value="'.$_POST['user_password'].'" />
</div>
<br />
<div class="formsLeft">Secret question:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_secret_question" id="user_secret_question" value="'.$_POST['user_secret_question'].'" />
</div>
<br />
<div class="formsLeft">Secret answer:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_secret_answer" id="user_secret_answer" value="'.$_POST['user_secret_answer'].'" />
</div>
<br />
<div class="formsLeft">Application Date:</div>
<div class="formsRight">
<input class="text-input" type="text" name="user_app_date" id="user_app_date" value="'.$_POST['user_app_date'].'" />
</div>
<br />
<div class="formsLeft">Status:</div>
<div class="formsRight">
<select name="user_status" class="text-input">';
foreach ($userStatuses AS $StatusID=>$StatusName) {
$pcontent.='<option value="'.$StatusID.'"'.(($StatusID==$_POST['user_status'])?' selected':'').'>'.$StatusName.'</option>';
}
$pcontent.='
</select>
</div>
</fieldset>
<div class="clear"></div>
<fieldset class="mainFormHolder left">
<legend>Notes</legend>
<div class="formsRight">
<textarea class="text-area-big" name="user_notes" id="user_notes">'.$_POST['user_notes'].'</textarea>
</div>
</fieldset>
<div class="clear"></div>
<div class="mainFormHolder left btnsHolder">
<input type="hidden" name="_form_submit" value="1" />
<input type="submit" name="_submit" value="'.getLang('sform_savebtn').'" class="submitBtn ui-state-default" />';
if($users_id) {
$pcontent.='
<input type="hidden" name="usid" value="'.$users_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 user?\')) location=\'?action=delete&uid='.($_POST['user_uid']).'\';" />
<input type="button" name="_logs" value="'.getLang('sform_logsbtn').'" class="submitBtn ui-state-default" onclick="location=\'?action=logs&uid='.($_POST['user_uid']).'\';" />';
}
$pcontent.='
<input type="button" name="_cancel" value="'.getLang('sform_backbtn').'" class="submitBtn ui-state-default" onclick="location=\'users.php\';" />
</div>
</div>
</form>
</div>';
$db->close();
return $pcontent;
}
示例11: page_header
//.........这里部分代码省略.........
<a href="stocks.php?action=new_value">Add New Values</a> |
<a href="stocks.php?action=list_dates">Edit Values</a> |
<a href="stocks_edit.php">Edit All Values</a> |
<a href="stocks.php?action=new_stock">Add New Stock</a> |
<a href="stocks.php">List all stocks</a> |
<a href="stocks.php?action=force_update">Force Update Values</a>
</div>
<div id="TC-70">
<a href="transfers.php?action=new_deposit">Add new Deposit</a> |
<a href="transfers.php?action=new_withdraw">Add new Withdraw</a> |
<a href="transfers.php">View all transfers</a>
</div>
<div id="TC-85">
<a href="users_advisors.php">List all</a> |
<a href="users_advisors.php?action=new">Add new</a>
</div>
<div id="TC-93">
<a href="logs_show.php">Overview</a>
</div>';
if ($adminType == 'owner') {
echo '
<div id="TC-80">
<a href="settings_css.php">CSS Styles</a> |
<a href="settings_translations.php">Translations</a> |
<a href="commodities.php">Commodities</a> |
<a href="commodities_groups.php">Commodities - groups</a> |
<a href="expiry_dates.php">Commodities - exp. dates</a> |
<a href="settings_pdf.php">PDF Settings</a> |
<a href="pdf_templates.php">PDF Templates</a>
</div>
<div id="TC-81">
<a href="settings_header_front.php">Custom Header</a> |
<a href="settings_footer_front.php">Custom Footer</a> |
<a href="settings_css_front.php">CSS Styles</a> |
<a href="settings_translations_front.php">Translations</a> |
<a href="settings_deposit_text.php">Deposit\'s Text</a> |
<a href="settings_other.php">Other settings</a>
</div>
<div id="TC-90">
<a href="users_admins.php">List all</a> |
<a href="users_admins.php?action=new">Add new</a>
</div>
<div id="TC-92">
<a href="mails_smtp_settings.php">Mail Settings</a> |
<a href="mails_templates.php">Templates</a> |
<a href="mails_assigns.php">Mail Assigns</a> |
<a href="mails_mass.php">Mass mail</a> |
<a href="mails_outbox.php">Outbox Queue'.$mailsToSend.'</a>
</div>
';
}
echo '
</div>
</div>';
}
echo '
<div class="MainContainer">';
}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 class="LoginContainer"><h3>'.getLang('lform_publicbanmessage').'</h3></div>';
}else{
echo '
<div class="LoginContainer">
<h3>'.getLang('aform_title').'</h3>
'.((array_get($_GET, 'error') == 1)?'<div class="errorsHolder">Invalid username or password</div>':'').'
<form name="login_form" method="post">
<div style="float:left;">
<div class="labels">'.getLang('lform_username').':</div><br />
<div class="labels">'.getLang('lform_password').':</div>
</div>
<div style="float:left;">
<input type="text" name="l_username" class="tinputs"><br />
<input type="password" name="l_password" class="tinputs">
</div>
<input type="hidden" id="nonce" name="nonce" value="'. ulNonce::Create('login') .'" />
<br />
<input type="submit" name="_login" class="submitBtn" value="'.getLang('lform_submitbtn').'">
</form>';
}
}
}
示例12: addNewMailTemplate
function addNewMailTemplate($mail_templates_id=0) {
$db=new DBConnection();
if($mail_templates_id&&!$_POST['_form_submit']) {
$_SESSION['admin']['uedit']=$mail_templates_id;
$query='SELECT * FROM mail_templates WHERE mail_templates_id='.($mail_templates_id+0).'';
$res=$db->rq($query);
foreach ($db->fetch($res) AS $RowName=>$RowValue) {
$_POST[$RowName]=$RowValue;
}
}
$settingsModel = new App\Model\Settings($db, 'mail_settings');
$settings = $settingsModel->getAll();
$API_KEY = $settings['sendwithus_key'];
$options = array();
$api = new API($API_KEY, $options);
$response = $api->emails();
$tags = explode(',', trim($settings['sendwithus_tags']));
$selectTemplateHtml = '<option value="">Empty</option>';
foreach($response as $template)
{
$matched = count(array_filter($tags)) == 0;
foreach($tags as $tag){
if (isset($template->tags) && in_array(trim($tag), $template->tags)) {
$matched = true;
break;
}
}
if($matched){
$selectTemplateHtml .= "<option value='". $template->id ."' ".(isset($_POST['mail_external_id']) && $_POST['mail_external_id'] == "$template->id" ? "selected='selected'" : "") .">". $template->name ."</option>";
}
}
// End
$db->close();
$templateVariables = Array(
'mail_template_title',
'user_first_name',
'user_username',
'user_last_name',
'user_account_num',
'user_password',
'user_password_org',
'trade_details',
'trade_date',
'trade_sell_status',
'trade_buy_status',
'trade_value',
'transfer_value',
'transfer_date',
'thanks',
'company_name',
'site_url',
'funding_overviews',
'trading_overviews',
'trade_ref',
'user_account_name',
'user_admin_ref',
'user_phone',
'user_email',
'user_mailing_address',
'user_city',
'user_state',
'user_postal',
'user_country',
'user_advisor1',
'user_advisor2',
'user_app_date'
);
sort($templateVariables);
$templateVariablesContent = '';
if(count($templateVariables) == 0){
$templateVariablesContent = '<p>Variables are not defined for this template type.</p>';
}else{
$templateVariablesContent .= '<ul class="variable_list">';
foreach($templateVariables as $var){
$templateVariablesContent .= "<li>{{$var}}</li>";
}
$templateVariablesContent .= '</ul>';
}
$pcontent='';
$pcontent.='
<div class="mainHolder">
<div class="hintHolder ui-state-default"><b>'.(($mail_templates_id>0)?'Editing':'Creating New').' Mail Template</b></div>
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js/jquery.simplemodal-1.3.3.min.js"></script>
<link type="text/css" href="css/basic.css" rel="stylesheet" media="screen" />
<script type="text/javascript">
//.........这里部分代码省略.........
示例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: 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();
}