public function __construct($registry) { parent::__construct(); $this->config = $registry->get('config'); $this->customer = $registry->get('customer'); $this->session = $registry->get('session'); $this->tax = $registry->get('tax'); $this->weight = $registry->get('weight'); $this->language_id = intval($this->config->get('config_language_id')); }
public function __construct($registry) { parent::__construct(); $this->request = $registry->get('request'); $this->session = $registry->get('session'); if (isset($this->session->data['user_id'])) { $this->permission = $this->_get_permission($this->session->data['user_group_id']); if (empty($this->permission)) { $this->logout(); } $this->user_id = $this->session->data['user_id']; $this->username = $this->session->data['username']; } }
public function __construct($registry) { parent::__construct(); $this->config = $registry->get('config'); $this->language = $registry->get('language'); $this->request = $registry->get('request'); $this->currencies = $this->hash_sql("SELECT * FROM " . DB_PREFIX . "currency", 'code'); if (isset($this->request->get['currency']) && isset($this->currencies[$this->request->get['currency']])) { $this->set($this->request->get['currency']); } elseif (isset($this->request->cookie['currency']) && isset($this->currencies[$this->request->cookie['currency']])) { $this->set($this->request->cookie['currency']); } else { $this->set($this->config->get('config_currency')); } }
/** * @param $registry Registry */ public function __construct($registry) { parent::__construct(); $this->registry = $registry; $this->tax = $registry->get('tax'); $this->url = $registry->get('url'); $this->log = $registry->get('log'); $this->load = $registry->get('load'); $this->config = $registry->get('config'); $this->request = $registry->get('request'); $this->session = $registry->get('session'); $this->response = $registry->get('response'); $this->language = $registry->get('language'); $this->currency = $registry->get('currency'); $this->document = $registry->get('document'); $this->customer = $registry->get('customer'); $this->tplname = $this->config->get('config_template'); }
public function __construct($registry) { parent::__construct(); $this->config = $registry->get('config'); $this->request = $registry->get('request'); $this->session = $registry->get('session'); if (isset($this->session->data['customer_id'])) { $ures = $this->mem_sql("SELECT * FROM " . DB_PREFIX . "customer WHERE customer_id = '{$this->session->data['customer_id']}' AND status = '1'"); if (!empty($ures)) { $this->customer_id = $ures['customer_id']; $this->firstname = $ures['firstname']; $this->lastname = $ures['lastname']; $this->email = $ures['email']; $this->telephone = $ures['telephone']; $this->fax = $ures['fax']; $this->newsletter = $ures['newsletter']; $this->customer_group_id = $ures['customer_group_id']; $this->address_id = $ures['address_id']; } else { $this->logout(); } } }
/** * 获取系统语言 * * @param modules_mem $mem_cls 缓冲对象 * @param bool $all 获取所有系统语言 * @return mixed */ function get_languages($mem_cls, $all = false) { $sql = "SELECT * FROM " . DB_PREFIX . "language WHERE " . ($all ? '1' : "status = '1'"); $languages = $mem_cls->hash_sql($sql, 'code'); return $languages; }