Ejemplo n.º 1
0
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)");
                    }
                }
            }
        }
    }
}
 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);
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     parent::__construct('formRouting', 'Update Routing');
     $routes = getSetting('routes');
     $this->addElement(new ElementTextbox('routes', 'Routes', $routes));
     $this->addDefaultButtons();
 }
Ejemplo n.º 4
0
 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) . '版!');
     }
 }
Ejemplo n.º 5
0
    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 
    }
Ejemplo n.º 6
0
 function __construct()
 {
     $sender = getSetting('mail_class');
     $file = SYSTEM_ROOT . "./class/mail/{$sender}.php";
     if (file_exists($file)) {
         require_once $file;
         $this->obj = new $sender();
     }
 }
Ejemplo n.º 7
0
 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>';
     }
 }
Ejemplo n.º 8
0
 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()));
 }
Ejemplo n.º 9
0
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;
}
Ejemplo n.º 10
0
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);
    }
}
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;
}
/**
 * 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 <*****@*****.**>
 * @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;
}
Ejemplo n.º 13
0
	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;
	}
Ejemplo n.º 14
0
 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');
 }
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;
}
/**
 * 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 <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (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;
}
/**
 * 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 <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (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;
}
/**
 * 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 <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (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;
}
 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'));
 }
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;
}
/**
 * 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 <*****@*****.**>
 * @license    GPLv2 http://files.syscp.org/misc/COPYING.txt
 *
 * @version    $Id$
 */
function storeSettingApsWebserverModules($fieldname, $fielddata, $newfieldvalue)
{
    if (is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'webserver-module') {
        $newfieldvalue_array = explode(',', $newfieldvalue);
        if (in_array('mod_rewrite', $newfieldvalue_array)) {
            // Don't have to guess if we have to remove the leading comma as mod_rewrite is set anyways when we're here...
            $newfieldvalue .= ',mod_rewrite.c';
        }
        if (in_array('htaccess', $newfieldvalue_array)) {
            $htaccess = 'htaccess';
        } else {
            $htaccess = '';
        }
        if ($htaccess != getSetting('aps', 'webserver-htaccess')) {
            saveSetting('aps', 'webserver-htaccess', $htaccess);
        }
    }
    return storeSettingField($fieldname, $fielddata, $newfieldvalue);
}
 public static function createSiteSettings($mysqli)
 {
     // db retrieving function
     function getSetting($mysqli, $var)
     {
         $result = $mysqli->query("SELECT value FROM elrh_settings WHERE var='" . $var . "' LIMIT 1");
         $row = $result->fetch_array();
         if (!empty($row["value"])) {
             return $row["value"];
         } else {
             return "";
         }
     }
     $data["fb_image"] = getSetting($mysqli, "fb_image");
     $data["ga_id"] = getSetting($mysqli, "ga_id");
     $data["toplist_id"] = getSetting($mysqli, "toplist_id");
     $data["global_title"] = getSetting($mysqli, "global_title");
     $data["global_url"] = getSetting($mysqli, "global_url");
     $data["admin_mail"] = getSetting($mysqli, "admin_mail");
     $data["ads_left"] = getSetting($mysqli, "ads_left");
     $data["ads_right"] = getSetting($mysqli, "ads_right");
     return $data;
 }
function hire()
{
    extract($_REQUEST);
    // Invoice ----------------------------------------------------------------
    $deptid = "2";
    $salespn = "";
    $comm = "";
    $salespn = "";
    $chrgvat = getSetting("SELAMT_VAT");
    $odate = date("Y-m-d");
    $ordno = "";
    $delchrg = "0.00";
    $cordno = "";
    $terms = 0;
    $traddisc = 0;
    $SUBTOT = 0;
    $vat = 0;
    $total = 0;
    $vatnum = "";
    $cusacc = "";
    $telno = "";
    $collection = "";
    $custom_txt = "";
    // Retrieve the booking
    $sql = "SELECT * FROM hire.bookings WHERE id='{$id}'";
    $booking_rslt = db_exec($sql) or errDie("Unable to retrieve booking.");
    $booking_data = pg_fetch_array($booking_rslt);
    $cusnum = $booking_data["cust_id"];
    # insert invoice to DB
    $sql = "INSERT INTO hire.hire_invoices(deptid, cusnum, cordno, ordno,\r\n\t\tchrgvat, terms, traddisc, salespn, odate, delchrg, subtot, vat, total,\r\n\t\tbalance, comm, username, printed, done, prd, vatnum, cusacc, telno, div,\r\n\t\tcollection, custom_txt)\r\n\tVALUES('{$deptid}', '{$cusnum}',  '{$cordno}', '{$ordno}', '{$chrgvat}', '{$terms}',\r\n\t\t'{$traddisc}', '{$salespn}', '{$odate}', '{$delchrg}', '{$SUBTOT}', '{$vat}' ,\r\n\t\t'{$total}', '{$total}', '{$comm}', '" . USER_NAME . "', 'n', 'n', '" . PRD_DB . "',\r\n\t\t'{$vatnum}', '{$cusacc}', '{$telno}', '" . USER_DIV . "', '{$collection}', '{$custom_txt}')";
    $rslt = db_exec($sql) or errDie("Unable to insert invoice to Cubit.", SELF);
    # get next ordnum
    db_conn("hire");
    $invid = pglib_lastid("hire_invoices", "invid");
    header("Location:hire-invoice-new.php?invid={$invid}&bk_asset={$booking_data['asset_id']}&bk_id={$booking_data['id']}&bk_from={$booking_data['from_date']}&bk_to={$booking_data['to_date']}");
}
Ejemplo n.º 24
0
 public static function init()
 {
     global $_config;
     if ($_config['version']) {
         $current_version = $_config['version'];
     } else {
         $current_version = getSetting('version');
     }
     if ($current_version == VERSION) {
         return;
     }
     $version = $current_version;
     while ($version) {
         $filepath = SYSTEM_ROOT . "./function/updater/{$version}.php";
         if (file_exists($filepath)) {
             include $filepath;
             exit;
         } else {
             $version = substr($version, 0, strrpos($version, '.'));
         }
     }
     include SYSTEM_ROOT . './function/updater/fallback.php';
     exit;
 }
Ejemplo n.º 25
0
 private static function _get_id_and_key()
 {
     static $cached_request;
     if (isset($cached_request)) {
         return $cached_request;
     }
     $encrypted = getSetting('cloud');
     $cached_request = explode("\t", authcode($encrypted, 'DECODE', '-TiebaSignAPI-'));
     return $cached_request;
 }
<?php

$weightSymbol = getSetting('weight_symbol');
$weightSymbol = $weightSymbol ? $weightSymbol : 'lbs';
$priceSymbol = getSetting('price_symbol');
$priceSymbol = $priceSymbol ? $priceSymbol : '$';
function treeView($array, $id = 0, $allCategories, $productData)
{
    foreach ($array as $keyArray => $valueArray) {
        if ($array[$keyArray]->parent_category_id == $id) {
            $flag = array_search($array[$keyArray]->category_id, array_column(json_decode(json_encode($allCategories), true), 'parent_category_id'));
            if ($flag) {
                ?>
<optgroup
        label="<?php 
                echo $array[$keyArray]->display_name . $array[$keyArray]->category_name;
                ?>
">
    <?php 
                treeView($array, $array[$keyArray]->category_id, $allCategories, $productData);
                ?>
</optgroup>
<?php 
            } else {
                ?>
<option value="{{$array[$keyArray]->category_id }}" @if($array[$keyArray]->category_id == $productData['category_id']){{"selected"}}@endif>
    <?php 
                echo $array[$keyArray]->display_name . $array[$keyArray]->category_name;
                ?>
</option>
<?php 
Ejemplo n.º 27
0
 case 'invoice_state':
     $strTable = '{prefix}invoice_state';
     $astrSearchFields = [['name' => "name'", 'type' => 'TEXT']];
     $strPrimaryKey = 'id';
     $strDeletedField = 'deleted';
     $astrShowFields = [['name' => 'order_no', 'width' => 150, 'type' => 'TEXT', 'header' => $GLOBALS['locOrderNr']], ['name' => 'name', 'width' => 450, 'type' => 'TEXT', 'header' => $GLOBALS['locStatus'], 'translate' => true]];
     // array('order_no','name');
     $strMainForm = 'invoice_state';
     $strTitle = $GLOBALS['locInvoiceStates'];
     break;
 case 'product':
     $strTable = '{prefix}product';
     $astrSearchFields = [['name' => 'product_name', 'type' => 'TEXT'], ['name' => 'product_code', 'type' => 'TEXT']];
     $strPrimaryKey = 'id';
     $strDeletedField = 'deleted';
     $astrShowFields = [['name' => 'order_no', 'width' => 150, 'type' => 'TEXT', 'header' => $GLOBALS['locOrderNr']], ['name' => 'product_code', 'width' => 150, 'type' => 'TEXT', 'header' => $GLOBALS['locProductCode'], 'select' => true], ['name' => 'product_name', 'width' => 200, 'type' => 'TEXT', 'header' => $GLOBALS['locProductName'], 'select' => true], ['name' => 'product_group', 'width' => 150, 'type' => 'TEXT', 'header' => $GLOBALS['locProductGroup']], ['name' => 'unit_price', 'width' => 100, 'type' => 'CURRENCY', 'header' => $GLOBALS['locUnitPrice'], 'decimals' => getSetting('unit_price_decimals')], ['name' => 'stock_balance', 'width' => 100, 'type' => 'CURRENCY', 'header' => $GLOBALS['locStockBalance'], 'decimals' => 2]];
     $strMainForm = 'product';
     $strTitle = $GLOBALS['locProducts'];
     break;
 case 'row_type':
     $strTable = '{prefix}row_type';
     $astrSearchFields = [['name' => 'name', 'type' => 'TEXT']];
     $strPrimaryKey = 'id';
     $strDeletedField = 'deleted';
     $astrShowFields = [['name' => 'order_no', 'width' => 150, 'type' => 'TEXT', 'header' => $GLOBALS['locOrderNr']], ['name' => 'name', 'width' => 450, 'type' => 'TEXT', 'header' => $GLOBALS['locRowType'], 'translate' => true]];
     $strMainForm = 'row_type';
     $strTitle = $GLOBALS['locRowTypes'];
     break;
 case 'delivery_terms':
     $strTable = '{prefix}delivery_terms';
     $astrSearchFields = [['name' => 'name', 'type' => 'TEXT']];
Ejemplo n.º 28
0
 case 'invoice_state':
     $strTable = "{prefix}invoice_state";
     $astrSearchFields = array(array("name" => "name'", "type" => "TEXT"));
     $strPrimaryKey = "id";
     $strDeletedField = 'deleted';
     $astrShowFields = array(array("name" => "order_no", 'width' => 150, "type" => "TEXT", "header" => $GLOBALS['locOrderNr']), array("name" => "name", 'width' => 450, "type" => "TEXT", "header" => $GLOBALS['locStatus'], 'translate' => true));
     //array('order_no','name');
     $strMainForm = "invoice_state";
     $strTitle = $GLOBALS['locInvoiceStates'];
     break;
 case 'product':
     $strTable = '{prefix}product';
     $astrSearchFields = array(array("name" => "product_name", "type" => "TEXT"), array("name" => "product_code", "type" => "TEXT"));
     $strPrimaryKey = "id";
     $strDeletedField = 'deleted';
     $astrShowFields = array(array("name" => "order_no", 'width' => 150, "type" => "TEXT", "header" => $GLOBALS['locOrderNr']), array("name" => "product_code", 'width' => 150, "type" => "TEXT", "header" => $GLOBALS['locProductCode'], 'select' => true), array("name" => "product_name", 'width' => 200, "type" => "TEXT", "header" => $GLOBALS['locProductName'], 'select' => true), array("name" => "product_group", 'width' => 150, "type" => "TEXT", "header" => $GLOBALS['locProductGroup']), array("name" => "unit_price", 'width' => 100, "type" => "CURRENCY", "header" => $GLOBALS['locUnitPrice'], 'decimals' => getSetting('unit_price_decimals')), array("name" => "stock_balance", 'width' => 100, "type" => "CURRENCY", "header" => $GLOBALS['locStockBalance'], 'decimals' => 2));
     $strMainForm = "product";
     $strTitle = $GLOBALS['locProducts'];
     break;
 case 'row_type':
     $strTable = "{prefix}row_type";
     $astrSearchFields = array(array("name" => "name", "type" => "TEXT"));
     $strPrimaryKey = "id";
     $strDeletedField = 'deleted';
     $astrShowFields = array(array("name" => "order_no", 'width' => 150, "type" => "TEXT", "header" => $GLOBALS['locOrderNr']), array("name" => "name", 'width' => 450, "type" => "TEXT", "header" => $GLOBALS['locRowType'], 'translate' => true));
     $strMainForm = "row_type";
     $strTitle = $GLOBALS['locRowTypes'];
     break;
 case 'delivery_terms':
     $strTable = "{prefix}delivery_terms";
     $astrSearchFields = array(array("name" => "name", "type" => "TEXT"));
Ejemplo n.º 29
0
 /*************************************************************************************************************************
 	DO THE PROCESSING
 **************************************************************************************************************************/
 $filename = basename($_FILES['Filedata']['name']);
 $file_basename = substr($filename, 0, strripos($filename, '.'));
 // strip extention
 $file_ext = substr($filename, strripos($filename, '.'));
 $size = $_FILES['Filedata']['size'] / 1024;
 $sort_number = getUsortNumber('multimedia', 'ASC', 'feature_id', $feature_id);
 /*************************************************************************************************************************
 	CHECK THE MAX NUMBER OF PICS ALLOWED AND DELETE THE LAST ONE IF MAX NUMBER REACHED
 **************************************************************************************************************************/
 if (getSetting('max_upload', $feature_id) > 0) {
     $mySQL = "SELECT * FROM multimedia WHERE vignette_id = '{$vignette_id}' AND feature_id = '{$feature_id}' AND status >0";
     $recSET = mysql_query($mySQL) or die(mysql_error());
     if (mysql_num_rows($recSET) >= getSetting('max_upload', $feature_id)) {
         $mySQL = $mySQL . " ORDER BY usort DESC";
         $recSET = mysql_query($mySQL) or die(mysql_error());
         $recROW = mysql_fetch_assoc($recSET);
         $multimedia_id = $recROW['multimedia_id'];
         deleteMultimedia($multimedia_id);
     }
 }
 /*************************************************************************************************************************
 	INSERT A NEW RECORD IN THE MULTIMEDIA TABLE AND USE THE ID AS THE NAME FOR THE FILE
 **************************************************************************************************************************/
 $mySQL = "INSERT INTO multimedia (vignette_id, picture_type, multimedia_type, multimedia_name, size, extension, date, status, feature_id, usort) \r\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES ('{$vignette_id}', '{$target_large}', '{$multimedia_type}', '{$filename}', '{$size}', '{$file_ext}', now(), '3', '{$feature_id}', '{$sort_number}')";
 mysql_query($mySQL) or die(mysql_error());
 $name = mysql_insert_id() . "{$file_ext}";
 if (empty($_GET['vignette_id'])) {
     $name = session_id() . "{$file_ext}";
Ejemplo n.º 30
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
$extra_title = getSetting('extra_title');
$title = $extra_title ? "贴吧签到助手 - {$extra_title}" : '贴吧签到助手';
?>
<!DOCTYPE html>
<html>
<head>
<title><?php 
echo $title;
?>
</title>
<?php 
include template('widget/meta');
?>
</head>
<body>
<div class="wrapper" id="page_index">
<div id="append_parent"><div class="cover hidden"></div><div class="loading-icon"><img src="./template/default/style/loading.gif" /> 载入中...</div></div>
<div class="main-box clearfix">
<?php 
include template('widget/header');
?>

<div class="main-wrapper">
<div class="sidebar">
<?php 
include template('widget/sidebar');