本文整理汇总了PHP中getSetting函数的典型用法代码示例。如果您正苦于以下问题:PHP getSetting函数的具体用法?PHP getSetting怎么用?PHP getSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: transferSettingsToTable
function transferSettingsToTable()
{
$settings_section = db_get_row("SELECT section_id FROM ?:settings_sections WHERE type = 'ADDON' AND name = 'hybrid_auth'");
$settings = db_get_array("SELECT * FROM ?:settings_objects WHERE section_id = " . $settings_section['section_id']);
$companies = db_get_array("SELECT company_id FROM ?:companies;");
$_settings = array();
foreach ($settings as $setting) {
$_settings[$setting['name']] = $setting;
}
$settings = $_settings;
if (!empty($settings)) {
foreach ($settings as $setting) {
if (strpos($setting['name'], '_status')) {
$provider_id = str_replace('_status', '', $setting['name']);
foreach ($companies as $company_data) {
list($status, $is_vendor) = getStatus($provider_id, $settings, $company_data['company_id']);
if ($status == 'Y') {
$app_id = getSetting($provider_id, 'id', $settings, $company_data['company_id'], $is_vendor);
if (empty($app_id)) {
$app_id = getSetting($provider_id, 'key', $settings, $company_data['company_id'], $is_vendor);
}
$secret_key = getSetting($provider_id, 'secret', $settings, $company_data['company_id'], $is_vendor);
$public_key = getSetting($provider_id, 'public', $settings, $company_data['company_id'], $is_vendor);
db_query("INSERT INTO ?:hybrid_auth_providers SET " . "provider = '" . $provider_id . "'" . ", company_id = " . $company_data['company_id'] . ", app_id = '" . $app_id . "'" . ", app_secret_key = '" . $secret_key . "'" . ", app_public_key = '" . $public_key . "'" . ", status = 'A'" . " ON DUPLICATE KEY UPDATE provider_id = VALUES(provider_id)");
}
}
}
}
}
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:30,代码来源:hybrid_auth_functions.php
示例2: getCategoryOrderedapiArray
public function getCategoryOrderedapiArray($data)
{
$db = $this->db;
$db->select('cat_id,cat_image,cat_name,cat_title');
$db->from(CATEGORY);
$db->where(array("cat_active" => "1"));
if (isset($data['lastrequesttime']) && isset($data['isinitialrequest'])) {
$time = $data['lastrequesttime'];
if ($data['isinitialrequest'] == 0) {
$db->where(array("cat_modified_date >" => $time));
}
}
if (isset($data['location']) && $data['location'] != '' && stripos($data['location'], "gujarat") === false) {
$location = $data['location'];
} else {
$location = '';
}
$query = $db->get();
$categories = $query->result_array();
$cat_array = array();
foreach ($categories as $category) {
$category['cat_thumb_image'] = image(category_img_path() . @$category['cat_image'], 'cat_icon');
$category['cat_main_image'] = category_img_path() . @$category['cat_image'];
$cat_id = $category['cat_id'] . "-";
$category['cat_ad_count'] = $this->common_model->getAdscount($cat_id, $location);
$cat_array[$category['cat_id']] = $category;
}
$order = json_decode(getSetting("cat_order", true), true);
return $this->orderCategoriesapi($cat_array, $order, $location);
}
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:30,代码来源:api_model.php
示例3: __construct
public function __construct()
{
parent::__construct('formRouting', 'Update Routing');
$routes = getSetting('routes');
$this->addElement(new ElementTextbox('routes', 'Routes', $routes));
$this->addDefaultButtons();
}
开发者ID:jamesread,项目名称:hacky-repository-manager,代码行数:7,代码来源:routing.php
示例4: on_install
function on_install()
{
$query = DB::query('SHOW TABLES');
$tables = array();
while ($table = DB::fetch($query)) {
$tables[] = implode('', $table);
}
if (!in_array('x_meizi_a', $tables)) {
DB::query("create table if not exists x_meizi_a(id int(10) unsigned not null auto_increment primary key,uid int(10) unsigned not null,votetype tinyint(1) unsigned not null,userid int(12) unsigned NOT NULL,fid int(12) unsigned not null,name varchar(32) not null,kw varchar(128) not null,statue text not null) ENGINE=InnoDB DEFAULT CHARSET=utf8");
DB::query("create table if not exists x_meizi_b(id int(10) unsigned not null auto_increment primary key,uid int(10) unsigned not null,islogin tinyint(1) not null default 0,userid int(12) unsigned not null,name varchar(32) not null,cookie text not null,voted tinyint(1) unsigned not null default 0) ENGINE=InnoDB DEFAULT CHARSET=utf8");
DB::query("create table if not exists x_meizi_log(id int(10) unsigned not null,uid int(10) unsigned NOT NULL, date int(11) not null DEFAULT 0, status tinyint(1) NOT NULL DEFAULT 0, success int(4) NOT NULL DEFAULT 0, failed int(4) NOT NULL DEFAULT 0,UNIQUE KEY id (id,date),KEY uid (uid)) ENGINE=InnoDB DEFAULT CHARSET=utf8");
DB::query("replace into cron (`id`, `enabled`, `nextrun`, `order`) values ('x_meizi_daily',1,0, 96),('x_meizi_vote',1,0,97)");
saveSetting('x_mz_nowid', '0');
saveSetting('x_mz_nextrun', '0');
saveSetting('x_meizi', $this->nowversion);
showmessage("妹纸刷票插件" . substr($this->nowversion, 0, 5) . "版安装成功");
}
$version = getSetting('x_meizi');
switch ($version) {
case '0.1.0_13-12-03':
DB::query("alter table x_meizi_a add votetype tinyint(1) unsigned not null default 1");
DB::query("alter table x_meizi_log_a add votenum int(4) NOT NULL DEFAULT 0");
case '0.1.1_13-12-04':
DB::query("drop table x_meizi_log_b");
DB::query("alter table x_meizi_log_a rename to x_meizi_log");
DB::query("alter table x_meizi_log change votenum success int(4) not null default 0");
DB::query("alter table x_meizi_log add failed int(4) not null default 0");
DB::query("alter table x_meizi_b add voted tinyint(1) unsigned not null default 0");
case '0.1.2_13-12-05':
saveSetting('x_mz_nextrun', '0');
default:
saveSetting('x_meizi', $this->nowversion);
showmessage('妹纸刷票插件已升级到' . substr($this->nowversion, 0, 5) . '版!');
}
}
开发者ID:myhloli,项目名称:Tieba_Sign,代码行数:35,代码来源:plugin.class.php
示例5: add_custom_form_fields
protected function add_custom_form_fields()
{
?>
<div class="medium_label"><?php
echo $GLOBALS['locImportStatementMarkPaidInvoicesArchived'];
?>
</div>
<div class="field">
<input type="checkbox" id="archive" name="archive" value="1" <?php
echo getSetting('invoice_auto_archive') ? 'checked="checked"' : '';
?>
>
</div>
<div class="medium_label"><?php
echo $GLOBALS['locBiller'];
?>
</div>
<div class="field">
<?php
echo htmlSQLListBox('base_id', 'SELECT id, name FROM {prefix}base WHERE deleted=0', '', 'medium');
?>
</div>
<div class="medium_label"><?php
echo $GLOBALS['locImportStatementAcceptPartialPayments'];
?>
</div>
<div class="field">
<input type="checkbox" id="partial_payments" name="partial_payments" value="1">
</div>
<?php
}
开发者ID:jahau,项目名称:MLInvoice,代码行数:31,代码来源:import_statement.php
示例6: __construct
function __construct()
{
$sender = getSetting('mail_class');
$file = SYSTEM_ROOT . "./class/mail/{$sender}.php";
if (file_exists($file)) {
require_once $file;
$this->obj = new $sender();
}
}
开发者ID:istobran,项目名称:Tieba_Sign,代码行数:9,代码来源:mail.php
示例7: on_config
function on_config()
{
if ($_POST['limit']) {
saveSetting('ip_reglimit', $_POST['limit']);
showmessage('设置已经保存!');
} else {
return '<p>单个 IP 注册上限:<input type="text" name="limit" value="' . getSetting('ip_reglimit') . '" /></p>';
}
}
开发者ID:dfc643,项目名称:tieba-sign-mod,代码行数:9,代码来源:plugin.class.php
示例8: __construct
public function __construct()
{
$this->feed = new XMLight('feed');
$this->feed->registerNamespaces(['http://www.w3.org/2005/Atom']);
/* Add generic atom head with feed logo */
$this->feed->importArray(array('title' => getSetting('website_doctitle', true), 'subtitle' => getSetting('website_description', true), 'updated' => Atom::formatDate(time()), 'logo' => get_system_image_url(getSetting('favicon_image')), 'id' => 'tag:' . $_SERVER['SERVER_NAME'] . ',2005:' . G\url_to_relative(G\get_current_url()), 'generator' => 'Chevereto Feeds::Atom v' . Atom::getVersion() . '(with XMLight v' . XMLight::getVersion() . ')'));
/* Add self atom link */
$this->feed->appendNode('link', '', array('href' => G\get_current_url(), 'rel' => 'self'));
$this->feed->appendNode('link', '', array('href' => G\get_base_url()));
}
开发者ID:denpamusic,项目名称:chv_feeds,代码行数:10,代码来源:class.atom.php
示例9: addReminderFees
function addReminderFees($intInvoiceId)
{
$strAlert = '';
$strQuery = 'SELECT inv.due_date, inv.state_id, inv.print_date ' . 'FROM {prefix}invoice inv ' . 'WHERE inv.id = ?';
$intRes = mysqli_param_query($strQuery, [$intInvoiceId]);
if ($row = mysqli_fetch_assoc($intRes)) {
$intStateId = $row['state_id'];
$strDueDate = dateConvDBDate2Date($row['due_date']);
$strPrintDate = $row['print_date'];
} else {
return $GLOBALS['locRecordNotFound'];
}
$intDaysOverdue = floor((time() - strtotime($strDueDate)) / 60 / 60 / 24);
if ($intDaysOverdue <= 0) {
$strAlert = addslashes($GLOBALS['locInvoiceNotOverdue']);
} elseif ($intStateId == 3 || $intStateId == 4) {
$strAlert = addslashes($GLOBALS['locWrongStateForReminderFee']);
} else {
// Update invoice state
if ($intStateId == 1 || $intStateId == 2) {
$intStateId = 5;
} elseif ($intStateId == 5) {
$intStateId = 6;
}
mysqli_param_query('UPDATE {prefix}invoice SET state_id=? where id=?', [$intStateId, $intInvoiceId]);
// Add reminder fee
if (getSetting('invoice_notification_fee')) {
// Remove old fee from same day
mysqli_param_query('UPDATE {prefix}invoice_row SET deleted=1 WHERE invoice_id=? AND reminder_row=2 AND row_date = ?', [$intInvoiceId, date('Ymd')]);
$strQuery = 'INSERT INTO {prefix}invoice_row (invoice_id, description, pcs, price, row_date, vat, vat_included, order_no, reminder_row) ' . 'VALUES (?, ?, 1, ?, ?, 0, 0, -2, 2)';
mysqli_param_query($strQuery, [$intInvoiceId, $GLOBALS['locReminderFeeDesc'], getSetting('invoice_notification_fee'), date('Ymd')]);
}
// Add penalty interest
$penaltyInterest = getSetting('invoice_penalty_interest');
if ($penaltyInterest) {
// Remove old penalty interest
mysqli_param_query('UPDATE {prefix}invoice_row SET deleted=1 WHERE invoice_id=? AND reminder_row=1', [$intInvoiceId]);
// Add new interest
$intTotSumVAT = 0;
$strQuery = 'SELECT ir.pcs, ir.price, ir.discount, ir.vat, ir.vat_included, ir.reminder_row ' . 'FROM {prefix}invoice_row ir ' . 'WHERE ir.deleted=0 AND ir.invoice_id=?';
$intRes = mysqli_param_query($strQuery, [$intInvoiceId]);
while ($row = mysqli_fetch_assoc($intRes)) {
if ($row['reminder_row']) {
continue;
}
list($rowSum, $rowVAT, $rowSumVAT) = calculateRowSum($row['price'], $row['pcs'], $row['vat'], $row['vat_included'], $row['discount']);
$intTotSumVAT += $rowSumVAT;
}
$intPenalty = $intTotSumVAT * $penaltyInterest / 100 * $intDaysOverdue / 360;
$strQuery = 'INSERT INTO {prefix}invoice_row (invoice_id, description, pcs, price, discount, row_date, vat, vat_included, order_no, reminder_row) ' . 'VALUES (?, ?, 1, ?, 0, ?, 0, 0, -1, 1)';
mysqli_param_query($strQuery, [$intInvoiceId, $GLOBALS['locPenaltyInterestDesc'], $intPenalty, date('Ymd')]);
}
}
return $strAlert;
}
开发者ID:jahau,项目名称:MLInvoice,代码行数:55,代码来源:add_reminder_fees.php
示例10: setSetting
function setSetting($key, $value)
{
// security check:
$test = getSetting($key, "ERROR");
if ($test == "ERROR" || $test == false) {
// key didn't exist!
return false;
} else {
return daoSetSetting($key, $value);
}
}
开发者ID:arewold,项目名称:calcuttagutta,代码行数:11,代码来源:settingsService.php
示例11: slct
function slct($err = "")
{
$defwhid = getSetting("DEF_WH");
$warehouses = qryWarehouse();
$whs = db_mksel($warehouses, "whid", $defwhid, "#whid", "(#whno) #whname");
$stockcats = qryStockCat();
$cats = db_mksel($stockcats, "catid", false, "#catid", "(#catcod) #cat");
$stockclass = qryStockClass();
$class = db_mksel($stockclass, "clasid", false, "#clasid", "#classname");
$view = "\n\t\t\t\t<h3>Stock Sales Report</h3>\n\t\t\t\t{$err}\n\t\t\t\t<table cellpadding='5'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t\t\t<form action='" . SELF . "' method=post name=form>\n\t\t\t\t\t\t\t\t<input type=hidden name=key value=view>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th colspan='2'>Store</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t<td align=center colspan=2>{$whs}</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th colspan='2'>By Category</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t<td align='center'>{$cats}</td>\n\t\t\t\t\t\t\t\t\t<td valign='bottom'><input type=submit name=cat value='View'></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th colspan='2'>By Classification</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t<td align='center'>{$class}</td>\n\t\t\t\t\t\t\t\t\t<td valign='bottom'><input type='submit' name='class' value='View'></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th colspan='2'>All Categories and Classifications</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t<td align='center' colspan='2'><input type='submit' name='all' value='View All'></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<p>\n\t\t\t\t<table border=0 cellpadding='2' cellspacing='1' width='15%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Quick Links</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td><a href='stock-add.php'>Add Stock</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td><a href='main.php'>Main Menu</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>";
return $view;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:12,代码来源:stock-sales-rep-stk.php
示例12: storeSettingIpAddress
/**
* This file is part of the SysCP project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <[email protected]>
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
function storeSettingIpAddress($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'ipaddress') {
$mysql_access_host_array = array_map('trim', explode(',', getSetting('system', 'mysql_access_host')));
$mysql_access_host_array[] = $newfieldvalue;
$mysql_access_host_array = array_unique(array_trim($mysql_access_host_array));
$mysql_access_host = implode(',', $mysql_access_host_array);
correctMysqlUsers($mysql_access_host_array);
saveSetting('system', 'mysql_access_host', $mysql_access_host);
}
return $returnvalue;
}
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:27,代码来源:function.storeSettingIpAddress.php
示例13: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
$stdout = getSetting($args);
}
else
{
$stdout = "Usage: sget [settingname]\n";
$stdout .= "Example: sget TITLE";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:14,代码来源:sget.php
示例14: __construct
public function __construct()
{
$this->feed = new XMLight('rss', array('version' => '2.0'));
$this->feed->registerNamespaces(['atom' => 'http://www.w3.org/2005/Atom', 'media' => 'http://search.yahoo.com/mrss/']);
$this->channel = $this->feed->appendNode('channel');
$now = Rss::formatDate(time());
$website_description = getSetting('website_description', true);
$website_doctitle = getSetting('website_doctitle', true);
$website_url = G\get_base_url();
$website_logo = get_system_image_url(getSetting('favicon_image'));
/* Add generic RSS 2.0 channel head with feed logo */
$this->channel->importArray(array('title' => $website_doctitle, 'link' => $website_url, 'description' => $website_description, 'pubDate' => $now, 'lastBuildDate' => $now, 'generator' => 'Chevereto Feeds::MRSS v' . Rss::getVersion() . '(with XMLight v' . XMLight::getVersion() . ')', 'ttl' => 60, 'image' => array('url' => $website_logo, 'title' => $website_doctitle, 'link' => $website_url)));
/* Add self atom link */
$this->channel->appendNode('link', '', array('href' => G\get_current_url(), 'rel' => 'self', 'type' => 'application/rss+xml'), 'atom');
}
开发者ID:denpamusic,项目名称:chv_feeds,代码行数:15,代码来源:class.rss.php
示例15: edit
function edit($listid)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>-" . $e["msg"] . "</li>";
}
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM pricelist WHERE listid = '{$listid}' AND div = '" . USER_DIV . "'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$vattype = getSetting("SELAMT_VAT") == 'inc' ? "Including Vat" : "Excluding Vat";
$enter = "\r\n\t\t<h3>Price List</h3>\r\n\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Field</th>\r\n\t\t\t\t<th>Value</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>Price list</td>\r\n\t\t\t\t<td align='center'>{$list['listname']}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2'><h3>Prices</h3><td>\r\n\t\t\t<tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Item</th>\r\n\t\t\t\t<th>Price Amount</th>\r\n\t\t\t</tr>";
# Query server
$i = 0;
db_conn('exten');
$sql = "SELECT * FROM plist_prices WHERE listid = '{$listid}' AND div = '" . USER_DIV . "' AND show='Yes' ORDER BY stkid ASC";
$stkpRslt = db_exec($sql) or errDie("Unable to retrieve stock items from database.");
if (pg_numrows($stkpRslt) < 1) {
return "<li class='err'> There are no stock item on the selected pricelist.</li>";
}
while ($stkp = pg_fetch_array($stkpRslt)) {
db_connect();
# get stock details
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkp['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
$enter .= "\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td>\r\n\t\t\t\t\t<td align='right'>" . CUR . " " . sprint($stkp['price']) . " {$vattype}</td>\r\n\t\t\t\t</tr>";
}
$enter .= "\r\n\t\t\t</table>";
$OUTPUT = $enter;
require "temp.xls.php";
Stream("Pricelist", $OUTPUT);
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:48,代码来源:pricelist-xls.php
示例16: storeSettingDefaultIp
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <[email protected]> (2003-2009)
* @author Froxlor team <[email protected]> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
*
*/
function storeSettingDefaultIp($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'defaultip') {
global $db;
$customerstddomains_result = $db->query('SELECT `standardsubdomain` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `standardsubdomain` <> \'0\'');
$ids = array();
while ($customerstddomains_row = $db->fetch_array($customerstddomains_result)) {
$ids[] = (int) $customerstddomains_row['standardsubdomain'];
}
if (count($ids) > 0) {
$db->query('UPDATE `' . TABLE_PANEL_DOMAINS . '` SET `ipandport`=\'' . (int) $newfieldvalue . '\' WHERE `id` IN (\'' . implode('\',\'', $ids) . '\') AND `ipandport` = \'' . $db->escape(getSetting('system', 'defaultip')) . '\'');
}
}
return $returnvalue;
}
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:32,代码来源:function.storeSettingDefaultIp.php
示例17: storeSettingApsPhpExtensions
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <[email protected]> (2003-2009)
* @author Froxlor team <[email protected]> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
*
*/
function storeSettingApsPhpExtensions($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'php-extension') {
$newfieldvalue_array = explode(',', $newfieldvalue);
if (in_array('mcrypt', $newfieldvalue_array)) {
$functions = 'mcrypt_encrypt,mcrypt_decrypt';
} else {
$functions = '';
}
if ($functions != getSetting('aps', 'php-function')) {
saveSetting('aps', 'php-function', $functions);
}
}
return $returnvalue;
}
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:32,代码来源:function.storeSettingApsPhpExtensions.php
示例18: storeSettingHostname
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <[email protected]> (2003-2009)
* @author Froxlor team <[email protected]> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
*
*/
function storeSettingHostname($fieldname, $fielddata, $newfieldvalue)
{
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'hostname') {
global $db, $idna_convert;
$newfieldvalue = $idna_convert->encode($newfieldvalue);
$customerstddomains_result = $db->query('SELECT `standardsubdomain` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `standardsubdomain` <> \'0\'');
$ids = array();
while ($customerstddomains_row = $db->fetch_array($customerstddomains_result)) {
$ids[] = (int) $customerstddomains_row['standardsubdomain'];
}
if (count($ids) > 0) {
$db->query('UPDATE `' . TABLE_PANEL_DOMAINS . '` SET `domain` = REPLACE(`domain`, \'' . $db->escape(getSetting('system', 'hostname')) . '\', \'' . $db->escape($newfieldvalue) . '\') WHERE `id` IN (\'' . implode('\',\'', $ids) . '\')');
}
}
return $returnvalue;
}
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:33,代码来源:function.storeSettingHostname.php
示例19: __construct
function __construct()
{
parent::__construct();
$this->load->helper("url");
$this->load->model('classifiedm');
$this->load->model('filecachemodel');
$this->load->library("pagination");
$this->user_session = $this->session->userdata('user_session');
$this->load->config("cat_params");
//$this->load->library('user_agent');
$this->otherFields = $this->config->item("otherParams");
$this->clad_ads = $this->session->userdata('clad_adsa');
//if ($this->agent->is_mobile())
// define('CLASSIFIEDAD_RECORD_PER_PAGE', 5);
//else
define('CLASSIFIEDAD_RECORD_PER_PAGE', getSetting('result_per_page'));
}
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:17,代码来源:classified.php
示例20: edit
function edit($listid)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>-" . $e["msg"] . "<br>";
}
return $confirm;
}
# Select Stock
db_conn("exten");
$sql = "SELECT * FROM spricelist WHERE listid = '{$listid}' AND div = '" . USER_DIV . "'";
$listRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($listRslt) < 1) {
return "<li> Invalid Price List ID.";
} else {
$list = pg_fetch_array($listRslt);
}
$vattype = getSetting("SELAMT_VAT") == 'inc' ? "Including Vat" : "Excluding Vat";
$enter = "<h3>Supplier Price List</h3>\r\n\t\t<form action='" . SELF . "' method=post>\r\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t\t<tr><th>Field</th><th>Value</th></tr>\r\n\t\t<tr class='bg-odd'><td>Price list</td><td align=center>{$list['listname']}</td></tr>\r\n\t\t<tr><td><br></td></tr>\r\n\t\t<tr><td colspan=2><h3>Prices</h3><td><tr>\r\n\t\t<tr><th>Item</th><th>Price Amount</th></tr>";
# Query server
$i = 0;
db_conn('exten');
$sql = "SELECT * FROM splist_prices WHERE listid = '{$listid}' AND div = '" . USER_DIV . "' ORDER BY stkid ASC";
$stkpRslt = db_exec($sql) or errDie("Unable to retrieve stock items from database.");
if (pg_numrows($stkpRslt) < 1) {
return "<li class=err> There are no stock item on the selected pricelist.";
}
while ($stkp = pg_fetch_array($stkpRslt)) {
db_connect();
# get stock details
$sql = "SELECT stkid, stkcod, stkdes FROM stock WHERE stkid = '{$stkp['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql) or errDie("Unable to retrieve stocks from database.");
$stk = pg_fetch_array($stkRslt);
$enter .= "<tr class='" . bg_class() . "'><td>{$stk['stkcod']} - " . extlib_rstr($stk['stkdes'], 30) . "</td><td align=right>" . CUR . " {$stkp['price']} {$vattype}</td></tr>";
}
$enter .= "\r\n\t\t</table></form>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t<tr><th>Quick Links</th></tr>\r\n\t\t<tr class='bg-odd'><td><a href='sup-pricelist-view.php'>View Supplier Price Lists</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
return $enter;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:45,代码来源:sup-pricelist-det.php
注:本文中的getSetting函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论