get() public method

public get ( $key )
示例#1
0
	public function confirm($order_id) {
		$this->load->model('checkout/order');

		$order_info = $this->model_checkout_order->getOrder($order_id);

		if ($order_info) {
			$this->load->model('localisation/language');

			$language = new Language($order_info['language_directory']);
			$language->load($order_info['language_filename']);
			$language->load('mail/voucher');

			$voucher_query = $this->db->query("SELECT *, vtd.name AS theme FROM `" . DB_PREFIX . "voucher` v LEFT JOIN " . DB_PREFIX . "voucher_theme vt ON (v.voucher_theme_id = vt.voucher_theme_id) LEFT JOIN " . DB_PREFIX . "voucher_theme_description vtd ON (vt.voucher_theme_id = vtd.voucher_theme_id) AND vtd.language_id = '" . (int)$order_info['language_id'] . "' WHERE v.order_id = '" . (int)$order_id . "'");

			foreach ($voucher_query->rows as $voucher) {
				// HTML Mail
				$template = new Template();

				$template->data['title'] = sprintf($language->get('text_subject'), $voucher['from_name']);

				$template->data['text_greeting'] = sprintf($language->get('text_greeting'), $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']));
				$template->data['text_from'] = sprintf($language->get('text_from'), $voucher['from_name']);
				$template->data['text_message'] = $language->get('text_message');
				$template->data['text_redeem'] = sprintf($language->get('text_redeem'), $voucher['code']);
				$template->data['text_footer'] = $language->get('text_footer');

				if (file_exists(DIR_IMAGE . $voucher['image'])) {
					$template->data['image'] = $this->config->get('config_url') . 'image/' . $voucher['image'];
				} else {
					$template->data['image'] = '';
				}

				$template->data['store_name'] = $order_info['store_name'];
				$template->data['store_url'] = $order_info['store_url'];
				$template->data['message'] = nl2br($voucher['message']);

				if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/voucher.tpl')) {
					$html = $template->fetch($this->config->get('config_template') . '/template/mail/voucher.tpl');
				} else {
					$html = $template->fetch('default/template/mail/voucher.tpl');
				}

				$mail = new Mail();
				$mail->protocol = $this->config->get('config_mail_protocol');
				$mail->parameter = $this->config->get('config_mail_parameter');
				$mail->hostname = $this->config->get('config_smtp_host');
				$mail->username = $this->config->get('config_smtp_username');
				$mail->password = $this->config->get('config_smtp_password');
				$mail->port = $this->config->get('config_smtp_port');
				$mail->timeout = $this->config->get('config_smtp_timeout');
				$mail->setTo($voucher['to_email']);
				$mail->setFrom($this->config->get('config_email'));
				$mail->setSender($order_info['store_name']);
				$mail->setSubject(html_entity_decode(sprintf($language->get('text_subject'), $voucher['from_name']), ENT_QUOTES, 'UTF-8'));
				$mail->setHtml($html);
				$mail->send();
			}
		}
	}
示例#2
0
 public function editOrder($order_id, $data)
 {
     $this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id = '" . (int) $data['order_status_id'] . "', date_modified = NOW() WHERE order_id = '" . (int) $order_id . "'");
     $this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int) $order_id . "', order_status_id = '" . (int) $data['order_status_id'] . "', notify = '" . (isset($data['notify']) ? (int) $data['notify'] : 0) . "', comment = '" . $this->db->escape(strip_tags($data['comment'])) . "', date_added = NOW()");
     if (isset($data['notify'])) {
         $query = $this->db->query("SELECT *, os.name AS status, l.code AS language FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_status os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) LEFT JOIN " . DB_PREFIX . "language l ON (o.language_id = l.language_id) WHERE o.order_id = '" . (int) $order_id . "'");
         if ($query->num_rows) {
             $language = new Language($query->row['language']);
             $language->load('customer/order');
             $subject = sprintf($language->get('mail_subject'), html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'), $order_id);
             $message = $language->get('mail_order') . ' ' . $order_id . "\n";
             $message .= $language->get('mail_date_added') . ' ' . date($language->get('date_format_short'), strtotime($query->row['date_added'])) . "\n\n";
             $message .= $language->get('mail_order_status') . "\n\n";
             $message .= $query->row['status'] . "\n\n";
             $message .= $language->get('mail_invoice') . "\n";
             $message .= html_entity_decode(HTTP_CATALOG . 'index.php?route=account/invoice&order_id=' . $order_id, ENT_QUOTES, 'UTF-8') . "\n\n";
             if (isset($data['comment'])) {
                 $message .= $language->get('mail_comment') . "\n\n";
                 $message .= strip_tags(html_entity_decode($data['comment'], ENT_QUOTES, 'UTF-8')) . "\n\n";
             }
             $message .= $language->get('mail_footer');
             $mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password'), ENT_QUOTES, 'UTF-8'), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
             $mail->setTo($query->row['email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender(html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'));
             $mail->setSubject($subject);
             $mail->setText($message);
             $mail->send();
         }
     }
 }
示例#3
0
文件: charge.php 项目: noikiy/travel
	/**
	 * 充值添加
	 */
	public function addOp(){
		if (!chksubmit()){
		    //信息输出
		    Tpl::output('menu_sign','predepositrecharge');
		    Tpl::output('menu_sign_url','index.php?act=predeposit');
		    Tpl::output('menu_sign1','predeposit_rechargeadd');
		    Tpl::showpage('charge_pd.add');
		    exit();
		}
		$pdr_amount = abs(floatval($_POST['pdr_amount']));
		if ($pdr_amount <= 0) {
		    showMessage(Language::get('predeposit_recharge_add_pricemin_error'),'','html','error');
		}
        $model_pdr = Model('predeposit');
        $data = array();
        $data['pdr_sn'] = $pay_sn = $model_pdr->makeSn();
        $data['pdr_member_id'] = $_SESSION['member_id'];
        $data['pdr_member_name'] = $_SESSION['member_name'];
        $data['pdr_amount'] = $pdr_amount;
        $data['pdr_add_time'] = TIMESTAMP;
        $insert = $model_pdr->addPdRecharge($data);
        if ($insert) {
            //转向到商城支付页面
            redirect('index.php?act=buy&op=pd_pay&pay_sn='.$pay_sn);
        }
	}
示例#4
0
 public function __construct() {
     parent::__construct();
     //检查是否开启
     if (intval(C('promotion_allow')) !== 1) {
         showMessage(Language::get('promotion_unavailable'), urlShop('seller_center', 'index'),'','error');
     }
 }
示例#5
0
文件: flea.php 项目: noikiy/ejia
	/**
	 * 闲置市场首页
	 */
	public function __construct(){
		parent::__construct();
		Language::read('home_flea_index');
		if($GLOBALS['setting_config']['flea_isuse']!='1'){
			showMessage(Language::get('flea_index_unable'),'index.php','','error');
		}
	}
示例#6
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     //  folder cache
     $dir = ROOT_PATH . DATA_FOLDER . 'cache/';
     if (\File::makeDirectory($dir)) {
         $this->cache_dir = $dir;
         $this->cache_expire = self::$cfg->get('cache_expire', 5);
         // clear old cache every day
         $d = is_file($dir . 'index.php') ? file_get_contents($dir . 'index.php') : 0;
         if ($d != date('d')) {
             $this->clear();
             $f = @fopen($dir . 'index.php', 'wb');
             if ($f) {
                 fwrite($f, date('d'));
                 fclose($f);
             } else {
                 $message = sprintf(\Language::get('The file or folder %s can not be created or is read-only, please create or adjust the chmod it to 775 or 777.'), 'cache/index.php');
                 log_message('Warning', $message, __FILE__, __LINE__);
             }
         }
     } else {
         $message = sprintf(\Language::get('The file or folder %s can not be created or is read-only, please create or adjust the chmod it to 775 or 777.'), 'cache/');
         log_message('Warning', $message, __FILE__, __LINE__);
     }
 }
示例#7
0
 /**
  * 分类列表
  */
 public function indexOp()
 {
     Language::read('home_category_index');
     $lang = Language::getLangContent();
     //得到分类类型
     $type = trim($_GET['type']);
     switch ($type) {
         case 'store':
             $model_sc = Model('store_class');
             $sc_list = $model_sc->getTreeList();
             //导航
             $nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_store_class']));
             $model_store = Model('store');
             //推荐店铺
             $recommend_store = $model_store->getRecommendStore(5);
             Tpl::output('recommend_store', $recommend_store);
             //最新店铺
             $new_store = $model_store->getNewStore(5);
             Tpl::output('new_store', $new_store);
             Tpl::output('nav_link_list', $nav_link);
             Tpl::output('sc_list', $sc_list);
             Tpl::showpage('category_store');
             break;
         default:
             //导航
             $nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SiteUrl . '/index.php'), '1' => array('title' => $lang['category_index_goods_class']));
             //分类
             $show_goods_class = ($g = F('goods_class')) ? $g : H('goods_class', true, 'file');
             Tpl::output('nav_link_list', $nav_link);
             Tpl::output('gc_list', $show_goods_class);
             Tpl::output('html_title', C('site_name') . ' - ' . Language::get('category_index_goods_class'));
             Tpl::showpage('category_goods');
             break;
     }
 }
示例#8
0
 protected function showTip($msg, $url = '', $show_type = 'html', $msg_type = 'succ', $is_show = 1, $time = 2000)
 {
     /**
      * 如果默认为空,则跳转至上一步链接
      */
     $url = $url != '' ? $url : getReferer();
     $msg_type = in_array($msg_type, array('succ', 'error')) ? $msg_type : 'error';
     if (is_array($url)) {
         foreach ($url as $k => $v) {
             $url[$k]['url'] = $v['url'] ? $v['url'] : getReferer();
         }
     }
     /**
      * 读取信息布局的语言包
      */
     Language::read("msg");
     /**
      * html输出形式
      * 指定为指定项目目录下的error模板文件
      */
     Tpl::setDir('');
     Tpl::output('html_title', Language::get('nc_html_title'));
     Tpl::output('msg', $msg);
     Tpl::output('url', $url);
     Tpl::output('msg_type', $msg_type);
     Tpl::output('is_show', $is_show);
     Tpl::showpage('msg', $this->layout, $time);
     exit;
 }
示例#9
0
	/**
	 * 用户中心右边,小导航
	 *
	 * @param string	$menu_type	导航类型
	 * @param string 	$menu_key	当前导航的menu_key
	 * @param array 	$array		附加菜单
	 * @return
	 */
	private function profile_menu($menu_key='') {
		$menu_array = array(
			1=>array('menu_key'=>'voucher_list','menu_name'=>Language::get('nc_myvoucher'),'menu_url'=>'index.php?act=member_voucher&op=voucher_list'),
		);
		Tpl::output('member_menu',$menu_array);
		Tpl::output('menu_key',$menu_key);
    }
示例#10
0
文件: client.php 项目: neevan1e/Done
 function save()
 {
     $this->import_parameters();
     //we need to determine if this is a new client before we do the initial save (it won't be new once we do the
     //initial save
     $is_new = $this->is_new();
     //unset params that aren't saved to the db
     $this->unset_param('primary_contact_name');
     $this->unset_param('primary_contact_image');
     $result = parent::save();
     if ($is_new == true) {
         $primary_contact = new User($_POST['client']);
         $primary_contact->set('client_id', $this->id);
         $primary_contact->validate();
         if ($primary_contact->validation_passed()) {
             $primary_contact->save();
             //set the client email and the primary contact id
             $this->set('email', $primary_contact->email);
             $this->set('primary_contact_id', $primary_contact->id);
             parent::save();
         } else {
             $this->set_error('first_name', Language::get('errors.saving_primary_contact'));
             return false;
         }
     }
     return $result;
 }
示例#11
0
 /**
  * 分享接口数组
  */
 public function getApps()
 {
     $app_arr = array();
     $app_arr['qqweibo'] = array('name' => Language::get('nc_shareset_qqweibo'), 'url' => "http://t.qq.com", 'applyurl' => 'http://dev.t.qq.com');
     $app_arr['sinaweibo'] = array('name' => Language::get('nc_shareset_sinaweibo'), 'url' => "http://www.weibo.com", 'applyurl' => 'http://open.weibo.com/developers');
     return $app_arr;
 }
示例#12
0
 /**
  * 编辑保存
  */
 public function payment_saveOp()
 {
     $payment_id = intval($_POST["payment_id"]);
     $data = array();
     $data['payment_state'] = intval($_POST["payment_state"]);
     switch ($_POST['payment_code']) {
         case 'alipay':
             $payment_config = array('alipay_account' => $_POST['alipay_account'], 'alipay_key' => $_POST['alipay_key'], 'alipay_partner' => $_POST['alipay_partner']);
             break;
         case 'wxpay':
             $payment_config = array('wxpay_appid' => $_POST['wxpay_appid'], 'wxpay_mch_id' => $_POST['wxpay_mch_id'], 'wxpay_appsecret' => $_POST['wxpay_appsecret'], 'wxpay_key' => $_POST['wxpay_key']);
             break;
         case 'unionpay':
             $payment_config = array('unionpay_account' => $_POST['unionpay_account'], 'cert_passwd' => $_POST['cert_passwd']);
             break;
         default:
             showMessage(L('param_error'), '');
     }
     $data['payment_config'] = $payment_config;
     $model_mb_payment = Model('mb_payment');
     $result = $model_mb_payment->editMbPayment($data, array('payment_id' => $payment_id));
     if ($result) {
         showMessage(Language::get('nc_common_save_succ'), urlAdmin('mb_payment', 'payment_list'));
     } else {
         showMessage(Language::get('nc_common_save_fail'), urlAdmin('mb_payment', 'payment_list'));
     }
 }
示例#13
0
 /**
  * 修改密码
  */
 public function modifypwOp()
 {
     if (chksubmit()) {
         if (trim($_POST['new_pw']) !== trim($_POST['new_pw2'])) {
             //showMessage('两次输入的密码不一致,请重新输入');
             showMessage(Language::get('index_modifypw_repeat_error'));
         }
         $admininfo = $this->getAdminInfo();
         //查询管理员信息
         $admin_model = Model('admin');
         $admininfo = $admin_model->getOneAdmin($admininfo['id']);
         if (!is_array($admininfo) || count($admininfo) <= 0) {
             showMessage(Language::get('index_modifypw_admin_error'));
         }
         //旧密码是否正确
         if ($admininfo['admin_password'] != md5(trim($_POST['old_pw']))) {
             showMessage(Language::get('index_modifypw_oldpw_error'));
         }
         $new_pw = md5(trim($_POST['new_pw']));
         $result = $admin_model->updateAdmin(array('admin_password' => $new_pw, 'admin_id' => $admininfo['admin_id']));
         if ($result) {
             showMessage(Language::get('index_modifypw_success'));
         } else {
             showMessage(Language::get('index_modifypw_fail'));
         }
     } else {
         Language::read('admin');
         Tpl::showpage('admin.modifypw');
     }
 }
示例#14
0
 /**
  * 分享保存
  **/
 public function share_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $share_id = intval($_POST['share_id']);
     $share_type = $_GET['type'];
     if ($share_id <= 0 || empty($share_type) || mb_strlen($_POST['commend_message']) > 140) {
         showDialog(Language::get('wrong_argument'), 'reload', 'fail', '');
     }
     if (!empty($_SESSION['member_id'])) {
         $model = Model('cms_' . $share_type);
         $model->modify(array($share_type . '_share_count' => array('exp', $share_type . '_share_count+1')), array($share_type . '_id' => $share_id));
         //分享内容
         if (isset($_POST['share_app_items'])) {
             $info['commend_message'] = $_POST['commend_message'];
             $info['share_title'] = $_POST['share_title'];
             $info['share_image'] = $_POST['share_image'];
             if (empty($info['commend_message'])) {
                 $info['commend_message'] = Language::get('share_text');
             }
             $info['url'] = CMS_SITE_URL . DS . "index.php?act={$_GET['type']}&op={$_GET['type']}_detail&{$_GET['type']}_id=" . $_POST['share_id'];
             self::share_app_publish($info);
         }
         showDialog(Language::get('nc_common_save_succ'), '', 'succ', '');
     } else {
         showDialog(Language::get('no_login'), 'reload', 'fail', '');
     }
 }
示例#15
0
 /**
  * 编辑
  */
 public function editOp()
 {
     $model_payment = Model('payment');
     if (chksubmit()) {
         $payment_id = intval($_POST["payment_id"]);
         $data = array();
         $data['payment_state'] = intval($_POST["payment_state"]);
         $payment_config = '';
         $config_array = explode(',', $_POST["config_name"]);
         //配置参数
         if (is_array($config_array) && !empty($config_array)) {
             $config_info = array();
             foreach ($config_array as $k) {
                 $config_info[$k] = trim($_POST[$k]);
             }
             $payment_config = serialize($config_info);
         }
         $data['payment_config'] = $payment_config;
         //支付接口配置信息
         $model_payment->editPayment($data, array('payment_id' => $payment_id));
         showMessage(Language::get('nc_common_save_succ'), 'index.php?act=payment&op=index');
     }
     $payment_id = intval($_GET["payment_id"]);
     $payment = $model_payment->getPaymentInfo(array('payment_id' => $payment_id));
     if ($payment['payment_config'] != '') {
         Tpl::output('config_array', unserialize($payment['payment_config']));
     }
     Tpl::output('payment', $payment);
     Tpl::showpage('payment.edit');
 }
示例#16
0
 public function detailOp()
 {
     $personal_id = intval($_GET['personal_id']);
     if ($personal_id <= 0) {
         header('location: ' . MICROSHOP_SITE_URL);
         die;
     }
     $model_personal = Model('micro_personal');
     $condition = array();
     $condition['personal_id'] = $personal_id;
     $detail = $model_personal->getOneWithUserInfo($condition);
     if (empty($detail)) {
         header('location: ' . MICROSHOP_SITE_URL);
         die;
     }
     //点击数加1
     $update = array();
     $update['click_count'] = array('exp', 'click_count+1');
     $model_personal->modify($update, $condition);
     Tpl::output('detail', $detail);
     //侧栏
     self::get_sidebar_list($detail['commend_member_id']);
     //获得分享app列表
     self::get_share_app_list();
     Tpl::output('comment_id', $detail['personal_id']);
     Tpl::output('comment_type', 'personal');
     Tpl::output('html_title', $detail['commend_message'] . '-' . Language::get('nc_microshop_personal') . '-' . Language::get('nc_microshop') . '-' . C('site_name'));
     Tpl::showpage('personal_detail');
 }
示例#17
0
 /**
  * 设置下载地址
  *
  */
 public function mb_appOp()
 {
     $model_setting = Model('setting');
     $mobile_apk = $model_setting->getRowSetting('mobile_apk');
     $mobile_content = $model_setting->getRowSetting('mobile_content');
     $mobile_apk_version = $model_setting->getRowSetting('mobile_apk_version');
     $mobile_ios = $model_setting->getRowSetting('mobile_ios');
     if (chksubmit()) {
         $update_array = array();
         $update_array['mobile_apk'] = $_POST['mobile_apk'];
         $update_array['mobile_apk_version'] = intval($_POST['mobile_apk_version']);
         $update_array['mobile_content'] = $_POST['mobile_content'];
         $update_array['mobile_ios'] = $_POST['mobile_ios'];
         $state = $model_setting->updateSetting($update_array);
         if ($state) {
             $this->log('设置手机端下载地址');
             showMessage(Language::get('nc_common_save_succ'), 'index.php?act=mb_app&op=mb_app');
         } else {
             showMessage(Language::get('nc_common_save_fail'));
         }
     }
     Tpl::output('mobile_apk', $mobile_apk);
     Tpl::output('mobile_version', $mobile_apk_version);
     Tpl::output('mobile_ios', $mobile_ios);
     Tpl::output('mobile_content', $mobile_content);
     Tpl::showpage('mb_app.edit');
 }
示例#18
0
文件: brand.php 项目: noikiy/ejia
	public function indexOp(){
		//读取语言包
		Language::read('home_brand_index');
		//分类导航
		$nav_link = array(
			0=>array(
				'title'=>Language::get('homepage'),
				'link'=>SHOP_SITE_URL
			),
			1=>array(
				'title'=>Language::get('brand_index_all_brand')
			)
		);
		Tpl::output('nav_link_list',$nav_link);

        //获得品牌列表
        $model = Model();
        $brand_c_list = $model->table('brand')->where(array('brand_apply'=>'1'))->order('brand_sort asc')->select();
        $brands = $this->_tidyBrand($brand_c_list);
        extract($brands);
        Tpl::output('brand_c',$brand_listnew);
        Tpl::output('brand_class',$brand_class);
        Tpl::output('brand_r',$brand_r_list);
        Tpl::output('html_title',Language::get('brand_index_brand_list'));

		//页面输出
		Tpl::output('index_sign','brand');
		Model('seo')->type('brand')->show();
		Tpl::showpage('brand');
	}
示例#19
0
文件: activity.php 项目: noikiy/nc-1
 /**
  * 单个活动信息页
  */
 public function indexOp()
 {
     //读取语言包
     Language::read('home_activity_index');
     //得到导航ID
     $nav_id = intval($_GET['nav_id']) ? intval($_GET['nav_id']) : 0;
     Tpl::output('index_sign', $nav_id);
     //查询活动信息
     $activity_id = intval($_GET['activity_id']);
     if ($activity_id <= 0) {
         showMessage(Language::get('para_error'), 'index.php', 'html', 'error');
         //'缺少参数:活动编号'
     }
     $activity = Model('activity')->getOneById($activity_id);
     if (empty($activity) || $activity['activity_type'] != '1' || $activity['activity_state'] != 1 || $activity['activity_start_date'] > time() || $activity['activity_end_date'] < time()) {
         showMessage(Language::get('activity_index_activity_not_exists'), 'index.php', 'html', 'error');
         //'指定活动并不存在'
     }
     Tpl::output('activity', $activity);
     //查询活动内容信息
     $list = array();
     $list = Model('activity_detail')->getGoodsList(array('order' => 'activity_detail.activity_detail_sort asc', 'activity_id' => "{$activity_id}", 'goods_show' => '1', 'activity_detail_state' => '1'));
     Tpl::output('list', $list);
     Tpl::output('html_title', C('site_name') . ' - ' . $activity['activity_title']);
     Tpl::showpage('activity_show');
 }
示例#20
0
 /**
  * 分享保存
  **/
 public function share_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $share_id = intval($_POST['share_id']);
     $share_type = self::get_channel_type($_GET['type']);
     if ($share_id <= 0 || empty($share_type) || mb_strlen($_POST['commend_message']) > 140) {
         showDialog(Language::get('wrong_argument'), 'reload', 'fail', '');
     }
     if (!empty($_SESSION['member_id'])) {
         $model = Model("micro_{$_GET['type']}");
         //分享内容
         if (isset($_POST['share_app_items'])) {
             $condition = array();
             $condition[$share_type['type_key']] = $_POST['share_id'];
             if ($_GET['type'] == 'store') {
                 $info = $model->getOneWithStoreInfo($condition);
             } else {
                 $info = $model->getOne($condition);
             }
             $info['commend_message'] = $_POST['commend_message'];
             if (empty($info['commend_message'])) {
                 $info['commend_message'] = Language::get('microshop_share_default_message');
             }
             $info['type'] = $_GET['type'];
             $info['url'] = MICROSHOP_SITE_URL . DS . "index.php?act={$_GET['type']}&op=detail&{$_GET['type']}_id=" . $_POST['share_id'];
             self::share_app_publish('share', $info);
         }
         showDialog(Language::get('nc_common_save_succ'), '', 'succ', '');
     } else {
         showDialog(Language::get('no_login'), 'reload', 'fail', '');
     }
 }
示例#21
0
 public function unbindOp()
 {
     //修改密码
     $model_member = Model('member');
     $update_arr = array();
     if ($_POST['is_editpw'] == 'yes') {
         /**
          * 填写密码信息验证
          */
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["new_password"], "require" => "true", "validator" => "Length", "min" => 6, "max" => 20, "message" => Language::get('member_qqconnect_password_null')), array("input" => $_POST["confirm_password"], "require" => "true", "validator" => "Compare", "operator" => "==", "to" => $_POST["new_password"], "message" => Language::get('member_qqconnect_input_two_password_again')));
         $error = $obj_validate->validate();
         if ($error != '') {
             showMessage($error, '', 'html', 'error');
         }
         $update_arr['member_passwd'] = md5(trim($_POST['new_password']));
     }
     $update_arr['member_qqopenid'] = '';
     $update_arr['member_qqinfo'] = '';
     $edit_state = $model_member->updateMember($update_arr, $_SESSION['member_id']);
     if (!$edit_state) {
         showMessage(Language::get('member_qqconnect_password_modify_fail'), 'html', 'error');
     }
     session_unset();
     session_destroy();
     showMessage(Language::get('member_qqconnect_unbind_success'), 'index.php?act=login&ref_url=' . urlencode('index.php?act=member_qqconnect&op=qqbind'));
 }
示例#22
0
 /**
  * 店铺详细页
  */
 public function detailOp()
 {
     $store_id = intval($_GET['store_id']);
     if ($store_id <= 0) {
         header('location: ' . MICROSHOP_SITE_URL);
         die;
     }
     $model_store = Model('store');
     $model_goods = Model('goods');
     $model_microshop_store = Model('micro_store');
     $store_info = $model_microshop_store->getOneWithStoreInfo(array('microshop_store_id' => $store_id));
     if (empty($store_info)) {
         header('location: ' . MICROSHOP_SITE_URL);
     }
     //点击数加1
     $update = array();
     $update['click_count'] = array('exp', 'click_count+1');
     $model_microshop_store->modify($update, array('microshop_store_id' => $store_id));
     Tpl::output('detail', $store_info);
     $condition = array();
     $condition['store_id'] = $store_info['shop_store_id'];
     $goods_list = $model_goods->getGoodsListByColorDistinct($condition, 'goods_id,store_id,goods_name,goods_image,goods_price,goods_salenum', 'goods_id asc', 39);
     Tpl::output('comment_type', 'store');
     Tpl::output('comment_id', $store_id);
     Tpl::output('list', $goods_list);
     Tpl::output('show_page', $model_goods->showpage());
     //获得分享app列表
     self::get_share_app_list();
     Tpl::output('html_title', $store_info['store_name'] . '-' . Language::get('nc_microshop_store') . '-' . Language::get('nc_microshop') . '-' . C('site_name'));
     Tpl::showpage('store_detail');
 }
示例#23
0
	/**
	 * 用户中心右边,小导航
	 *
	 * @param string	$menu_type	导航类型
	 * @param string 	$menu_key	当前导航的menu_key
	 * @return
	 */
	private function profile_menu($menu_key) {
		$menu_array	= array(
			1=>array('menu_key'=>'store_callcenter','menu_name'=>Language::get('nc_member_path_store_callcenter'),'menu_url'=>'index.php?act=store_callcenter'),
		);
		Tpl::output('member_menu',$menu_array);
		Tpl::output('menu_key',$menu_key);
	}
示例#24
0
 public function indexOp()
 {
     //读取语言包
     Language::read('home_store_list');
     //分类导航
     $nav_link = array(0 => array('title' => Language::get('homepage'), 'link' => 'index.php'), 1 => array('title' => Language::get('brand_index_all_brand')));
     Tpl::output('nav_link_list', $nav_link);
     $model_store = Model('store');
     //店铺列表
     //         $store_list = $model_store->getStoreList($condition, 10);
     $store_list = $model_store->getShowList(true, true);
     Tpl::output('store', $store_list);
     //         Tpl::output('brand_class',$brand_class);
     //         Tpl::output('brand_r',$brand_r_list);
     //         Tpl::output('html_title',Language::get('brand_index_brand_list'));
     //分页头
     Tpl::output('show_page1', $model_store->showpage(4));
     //分页尾
     Tpl::output('show_page', $model_store->showpage(5));
     //加载 shop/framework/function/search.php
     loadfunc('search');
     //页面输出
     Tpl::output('index_sign', 'store');
     Model('seo')->type('store')->show();
     Tpl::showpage('store_list');
 }
示例#25
0
 public function __construct()
 {
     parent::__construct();
     Language::read('flea_class');
     if ($GLOBALS['setting_config']['flea_isuse'] != '1') {
         showMessage(Language::get('flea_isuse_off_tips'), 'index.php?act=dashboard&op=welcome');
     }
 }
示例#26
0
	public function testDelete()
	{
		$l = Language::get('nl');
		$this->assertNotNull($l);
		$l->delete();
		
		$this->assertNull(Language::get('nl'));
	}
示例#27
0
文件: project.php 项目: neevan1e/Done
 function evaluate_date_difference($from, $to)
 {
     $difference = $to - $from;
     $difference_in_days = abs(round($difference / 86400));
     $difference_direction = $to > $from ? Language::get('project.increased') : Language::get('project.decreased');
     $days_text = $difference_in_days > 1 ? Language::get('project.days') : Language::get('project.day');
     return array('difference' => $difference, 'difference_in_days' => $difference_in_days, 'difference_direction' => $difference_direction, 'days_text' => $days_text);
 }
示例#28
0
 public function indexOp()
 {
     $model_xianshi_goods = Model('p_xianshi_goods');
     $model_goods = Model('goods');
     $condition = array();
     $condition['state'] = 1;
     $condition['start_time'] = array('elt', TIMESTAMP);
     $condition['end_time'] = array('gt', TIMESTAMP);
     if ($_GET['gc_id']) {
         $condition['gc_id_1'] = intval($_GET['gc_id']);
     }
     $goods_list = $model_xianshi_goods->getXianshiGoodsExtendList($condition, self::PAGESIZE, 'xianshi_goods_id desc');
     $total_page = pagecmd('gettotalpage');
     if (intval($_GET['curpage'] > $total_page)) {
         exit;
     }
     $xs_goods_list = array();
     foreach ($goods_list as $k => $goods_info) {
         $xs_goods_list[$goods_info['goods_id']] = $goods_info;
         $xs_goods_list[$goods_info['goods_id']]['image_url_240'] = cthumb($goods_info['goods_image'], 240, $goods_info['store_id']);
         $xs_goods_list[$goods_info['goods_id']]['down_price'] = $goods_info['goods_price'] - $goods_info['xianshi_price'];
     }
     $condition = array('goods_id' => array('in', array_keys($xs_goods_list)));
     $goods_list = $model_goods->getGoodsOnlineList($condition, 'goods_id,gc_id_1,evaluation_good_star,store_id,store_name', 0, '', self::PAGESIZE, null, false);
     foreach ($goods_list as $k => $goods_info) {
         $xs_goods_list[$goods_info['goods_id']]['evaluation_good_star'] = $goods_info['evaluation_good_star'];
         $xs_goods_list[$goods_info['goods_id']]['store_name'] = $goods_info['store_name'];
         if ($xs_goods_list[$goods_info['goods_id']]['gc_id_1'] != $goods_info['gc_id_1']) {
             //兼容以前版本,如果限时商品表没有保存一级分类ID,则马上保存
             $model_xianshi_goods->editXianshiGoods(array('gc_id_1' => $goods_info['gc_id_1']), array('xianshi_goods_id' => $xs_goods_list[$goods_info['goods_id']]['xianshi_goods_id']));
         }
     }
     //查询商品评分信息
     $goodsevallist = Model("evaluate_goods")->getEvaluateGoodsList(array('geval_goodsid' => array('in', array_keys($xs_goods_list))));
     $eval_list = array();
     if (!empty($goodsevallist)) {
         foreach ($goodsevallist as $v) {
             if ($v['geval_content'] == '' || count($eval_list[$v['geval_goodsid']]) >= 2) {
                 continue;
             }
             $eval_list[$v['geval_goodsid']][] = $v;
         }
     }
     Tpl::output('goodsevallist', $eval_list);
     Tpl::output('goods_list', $xs_goods_list);
     if (!empty($_GET['curpage'])) {
         Tpl::showpage('promotion.item', 'null_layout');
     } else {
         //导航
         $nav_link = array(0 => array('title' => Language::get('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => '限时折扣'));
         Tpl::output('nav_link_list', $nav_link);
         //查询商品分类
         $goods_class = Model('goods_class')->getGoodsClassListByParentId(0);
         Tpl::output('goods_class', $goods_class);
         Tpl::output('total_page', pagecmd('gettotalpage'));
         Tpl::showpage('promotion');
     }
 }
示例#29
0
 public function indexOp()
 {
     //读取语言包
     Language::read('home_brand_index');
     //分类导航
     $nav_link = array(0 => array('title' => Language::get('homepage'), 'link' => 'index.php'), 1 => array('title' => Language::get('brand_index_all_brand')));
     Tpl::output('nav_link_list', $nav_link);
     //处理排序
     $order = 'goods_id desc';
     if (in_array($_GET['key'], array('1', '2', '3'))) {
         $sequence = $_GET['order'] == '1' ? 'asc' : 'desc';
         $order = str_replace(array('1', '2', '3'), array('goods_salenum', 'goods_click', 'goods_price'), $_GET['key']);
         $order .= ' ' . $sequence;
     }
     if (intval($_GET['count']) > 0) {
         $where['brand_count'] = intval($_GET['count']);
     }
     loadfunc('search');
     //获取国家
     $count = Model()->table('count')->order('count_id asc')->select();
     $page = new Page();
     $page->setEachNum(16);
     //获得品牌列表
     $model = Model();
     //$brand_c_list = $model->table('brand')->where(array('brand_apply'=>'1'))->order('brand_sort asc')->select();
     $where = array();
     $where['brand_apply'] = 1;
     if (intval($_GET['count']) > 0) {
         $where['brand_count'] = $_GET['count'];
     }
     $brand_c_list = Model('brand')->getBrandList($where, $page);
     /**获取品牌国籍*/
     if ($brand_c_list) {
         foreach ($brand_c_list as $key => $value) {
             $brand_c_list[$key]['brand_count'] = Model('count')->getCount($value['brand_count']);
         }
     }
     if (intval($_GET['count']) > 0) {
         //获取国家值
         $dbs = Model('count')->getCountInfo(array('count_id' => $_GET['count']), 'count_name');
         $count_name = $dbs['count_name'];
     } else {
         $count_name = '国家';
     }
     Tpl::output('count_name', $count_name);
     $brands = $this->_tidyBrand($brand_c_list);
     extract($brands);
     Tpl::output('count', $count);
     Tpl::output('brand_c', $brand_listnew);
     Tpl::output('brand_class', $brand_class);
     Tpl::output('brand_r', $brand_r_list);
     Tpl::output('html_title', Language::get('brand_index_brand_list'));
     Tpl::output('show_page', $page->show('6'));
     //页面输出
     Tpl::output('index_sign', 'shang');
     Model('seo')->type('brand')->show();
     Tpl::showpage('brand');
 }
示例#30
0
 public function __construct()
 {
     parent::__construct();
     Language::read('region,flea_index');
     if ($GLOBALS['setting_config']['flea_isuse'] != 1) {
         showMessage(Language::get('flea_index_unable'), 'index.php?act=dashboard&op=welcome');
         // showMessage(Language::get('admin_ztc_unavailable'),'index.php?act=dashboard&op=welcome');
     }
 }