function html( $data ) { switch (mocod()) { case 'buy.checkout': if ($data['type'] != 'stuff') return; handler('template')->load('@html/express_selector'); break; case 'buy.order': if ($data['product']['type'] != 'stuff') return; $EID = $data['expresstype']; if(!$EID){ $express_list = logic('express')->GetList($data['addressid'], $data['productid']); if($express_list){ foreach($express_list as $key => $val){ if($data['product']['weightsrc'] <= $val['firstunit']){ $express_list[$key]['price'] = $val['firstprice']; }else{ $express_list[$key]['price'] = $val['firstprice'] + ceil(($data['product']['weightsrc']-$val['firstunit'])/$val['continueunit'])*$val['continueprice']; } $express_list[$key]['unit1'] = ($val['firstunit'] >= 1000) ? 'kg' : 'g'; $express_list[$key]['firstunit'] *= ($express_list[$key]['unit1'] == 'kg') ? 0.001 : 1; $express_list[$key]['unit2'] = ($val['continueunit'] >= 1000) ? 'kg' : 'g'; $express_list[$key]['continueunit'] *= ($express_list[$key]['unit2'] == 'kg') ? 0.001 : 1; } } $ordertprice = $data['totalprice']; } include handler('template')->file('@html/express_displayer'); break; } }
public function modify() { $this->CheckAdminPrivs('article'); $id = get('id', 'int'); $article = logic('article')->get_one($id); include handler('template')->file('@admin/article_modify'); }
public function vlist() { $this->CheckAdminPrivs('styles'); $default = ini('styles.default'); $styles = ui('style')->get_all(); include handler('template')->file('@admin/styles_list'); }
function Process() { $this->CheckAdminPrivs('refund'); $id = get('id', 'number'); $order = logic('order')->GetOne($id); if (!$order) { $this->Messager(__('找不到相关订单!'), '?mod=order'); } $user = user($order['userid'])->get(); $payment = logic('pay')->SrcOne($order['paytype']); $paylog = logic('pay')->GetLog($order['orderid'], $order['userid']); $coupons = logic('coupon')->SrcList($order['userid'], $order['orderid'], TICK_STA_ANY); $express = logic('express')->SrcOne($order['expresstype']); $address = logic('address')->GetOne($order['addressid']); $refund = logic('refund')->GetOne($order['orderid']); $order['ypaymoney'] = ($order['totalprice'] > $order['paymoney']) ? number_format(($order['totalprice'] - $order['paymoney']),2) : 0; $order['tpaymoney'] = $order['totalprice']; if($order['product']['type'] == 'ticket'){ $coupo = logic('coupon')->SrcList($order['userid'], $id); if($order['productnum'] != count($coupo) && $coupo[0]['mutis'] == 1){ $order['tpaymoney'] = count($coupo)*$order['productprice']; $order['tmsg'] = array( 'money' => $order['paymoney'], 'tnum' => $order['productnum'], 'num' => $order['productnum']-count($coupo) ); } } include handler('template')->file('@admin/refund_process'); }
public function load($idx) { $map = ini('isearcher.map'); $fidString = ini('isearcher.idx.'.$idx); $fids = explode(',', $fidString); $filter = ini('isearcher.filter'); $ffsString = ini('isearcher.frc.'.$idx); $frcs = explode(',', $ffsString); $timev = ini('isearcher.timev'); $tvString = ini('isearcher.tvs.'.$idx); $tvss = explode(',', $tvString); $tvinputs = array(); foreach ($tvss as $tvsk) { if (isset($_GET['iscp_tvbegin_'.$tvsk])) { $tvinputs[$tvsk]['begin'] = get('iscp_tvbegin_'.$tvsk, 'txt'); } if (isset($_GET['iscp_tvfinish_'.$tvsk])) { $tvinputs[$tvsk]['finish'] = get('iscp_tvfinish_'.$tvsk, 'txt'); } } $iscp_input_value = ($_GET['iscp_input_value'] ? $_GET['iscp_input_value'] : $_POST['iscp_input_value']); include handler('template')->file('@html/isearcher/index'); }
public function inputer($category) { $category || $category = 0; $category && $master = logic('catalog')->GetOne($category); $catalog = logic('catalog')->Navigate(2); include handler('template')->file('@html/catalog/inputer'); }
public function view() { $id = get('id', 'int'); $article = logic('article')->get_one($id); $this->Title = $article['title']; include handler('template')->file('article_view'); }
public function water($image_source, $image_dest, $config) { if ($config['type'] == 'image') { handler('image')->setSrcImg($image_source); handler('image')->setDstImg($image_dest); handler('image')->setMaskImg($config['image']); handler('image')->setMaskPosition($config['position']); handler('image')->createImg(100); } elseif ($config['type'] == 'text') { if (ENC_IS_GBK) { $config['text'] = ENC_G2U($config['text']); } $config['text'] = mb_convert_encoding($config['text'], 'html-entities', 'UTF-8'); $r = array(); $r[] = handler('image')->setSrcImg($image_source); $r[] = handler('image')->setDstImg($image_dest); $r[] = handler('image')->setMaskFont(ROOT_PATH.'static/images/watermark/'.$config['font']); $r[] = handler('image')->setMaskFontColor('#ffffff'); $r[] = handler('image')->setMaskFontSize($config['fontsize'] ? $config['fontsize'] : 13); $r[] = handler('image')->setMaskWord($config['text']); $r[] = handler('image')->setMaskPosition($config['position']); $r[] = handler('image')->createImg(100); } }
function shut() { $error = error_get_last(); if ($error && $error['type'] & E_FATAL) { handler($error['type'], $error['message'], $error['file'], $error['line']); } }
public function get_all() { $tpl_root = handler('template')->TemplateRootPath.'themes/'; $styles_io = handler('io')->ReadDir($tpl_root); $styles_lc = ini('styles.local'); $styles_lc || $styles_lc = array(); $styles_ms = $styles_lc; foreach ($styles_io as $i => $style_name) { $style_name = str_replace($tpl_root, '', $style_name); if (isset($styles_lc[$style_name])) { unset($styles_ms[$style_name]); } else { $styles_lc[$style_name] = array( 'name' => '新增皮肤', 'enabled' => false ); } } foreach ($styles_ms as $style_name => $style_data) { $styles_lc[$style_name] = array( 'name' => $style_data['name'].'[已失效]', 'enabled' => false ); } return $styles_lc; }
public function edit() { $this->CheckAdminPrivs('privs'); $action = 'admin.php?mod=privs&code=save'; unset($privs_list); include(CONFIG_PATH . 'admin_privs.php'); $uid = get('uid', 'int'); if($uid == '1'){ $this->Messager("您不能对此管理员的权限进行任何操作"); } $userinfo = dbc(DBCMax)->query('select uid,username,role_id,role_type,privs from '.table('members').' where uid='.$uid)->limit(1)->done(); if(!$userinfo){ $this->Messager("该用户不存在"); } if(!in_array($userinfo['role_type'],array('admin','seller'))){ $this->Messager("您不能设置该用户的后台操作权限"); } if($userinfo && $privs_list && is_array($privs_list)){ foreach($privs_list as $key => $val){ if($val['sub_priv_list'] && is_array($val['sub_priv_list'])){ $sub_privgroup = array(); foreach($val['sub_priv_list'] as $k => $v){ if($userinfo['uid'] == '1' || $userinfo['privs'] == 'all' || in_array($v['priv'],explode(',',$userinfo['privs']))){ $privs_list[$key]['sub_priv_list'][$k]['check'] = ' checked'; } $sub_privgroup[] = $v['priv']; } $privs_list[$key]['privgroup'] = implode(',',$sub_privgroup); } } } include handler('template')->file('@admin/privs_list'); }
function customShutdownHandler() { $error = error_get_last(); if ($error && ($error['type'] & 'E_FATAL')) { handler($error['type'], $error['message'], $error['file'], $error['line']); } }
public function main() { $this->Title = '下载手机版享更多优惠'; $android_url = ini('settings.site_url').'/get-last-apk.php'; $iphone = ini('iphone'); $iphone_url = $iphone['url']; $referer_url = referer('index.php?'); if(false !== strpos($referer_url, '?')) { $referer_url .= '&ignore_jump=1'; } else { $referer_url .= '/ignore_jump-1'; } $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stripos($user_agent, 'MicroMessenger') === false) { if( false != preg_match("/(iphone|android|mobile)/i",$_SERVER['HTTP_USER_AGENT']) ) { include handler('template')->file('downapp_mobile'); } else { include handler('template')->file('downapp'); } } else { include handler('template')->file('downapp_weixin'); } }
public function order() { $this->CheckAdminPrivs('cashorder'); $orderid = get('orderid', 'number'); if($orderid) { $order = logic('cash')->GetOne($orderid); if($order){ if($order['status'] =='doing'){ $action = "?mod=cash&code=order&op=save"; } $order_log = logic('cash')->Getlog($orderid); }else{ $this->Messager('操作错误!'); } } else { $paystatus = get('paystatus'); if (in_array($paystatus,array('no','yes','doing','error'))) { $where = "status = '{$paystatus}'"; } else { $where = '1'; } $list = logic('cash')->GetList($where); } include handler('template')->file('@admin/cash_order'); }
function login() { $this->_fix_failedlogins(); if(MEMBER_ID < 1) { $this->Messager("请先在前台进行<a href='index.php?mod=account&code=login'><b>登录</b></a>",null); } $loginperm = $this->_logincheck(); if(!$loginperm) { $this->Messager("累计 5 次错误尝试,15 分钟内您将不能登录。",null); } $this->Title="用户登录"; if ($this->CookieHandler->GetVar('referer')=='') { $this->CookieHandler->Setvar('referer',referer()); } $action="admin.php?mod=login&code=dologin"; $question_select=FormHandler::Select('question',ConfigHandler::get('member','question_list'),0); $role_type_select=FormHandler::Radio('role_type',ConfigHandler::get('member','role_type_list'),'normal'); ob_clean(); include(handler('template')->file("@admin/login")); }
function Main() { $clientUser = get('u', 'int'); if ( $clientUser != '' ) { handler('cookie')->setVar('finderid', $clientUser); handler('cookie')->setVar('findtime', time()); } $data = logic('product')->display(); if (!$data && get('page', 'int') == 0) { header('Location: '.rewrite('?mod=subscribe&code=mail')); exit; } $product = $data['product']; $this->Title = $data['mutiView'] ? '' : $product['name']; $data['mutiView'] || mocod('product.view'); $data['mutiView'] || productCurrentView($product); $favorited = logic('favorite')->get_one($product['id']); if(INDEX_DEFAULT === true && ini('settings.template_path') == 'meituan'){ $new_product = logic('product')->GetNewList(10, true); if(empty($new_product)) { $new_product = logic('product')->GetNewList(10); } } include handler('template')->file($data['file']); }
function load( $area = '' ) { if ($area == '') { $area = str_replace('.', '_', mocod()); } $pox = 'widget.'.$area.'.blocks'; $list = ini($pox); if ( false === $list ) { if (substr($area, 0, 5) == 'html_') { $html = logic('html')->query(substr($area, 5)); ini('widget.'.$area, array('name' => $html['title'], 'blocks' => array())); } else { ini('widget.~@config.listener.enabled') && ini($pox, array()); } return; } echo '<!'.'-- widget @ [ '.$area.' ] --'.'>'; foreach ( $list as $name => $one ) { if (isset($one['enabled']) && $one['enabled']) { handler('template')->load('@widget/' . $name); } } }
public function load($block) { $masterFile = handler('template')->TemplateRootPath.'html/ad/'.$block.'.html'; if (!is_file($masterFile)) return; if (!ini('ad.'.$block.'.enabled')) return; $cfg = ini('ad.'.$block.'.config'); include handler('template')->file('@html/ad/'.$block); }
function Import() { $flag = get('flag', 'txt'); if (!$flag || !ini('alipay.address.import.source.'.$flag)) exit('ERROR: no Import Source'); $html = logic('address')->import()->linker($flag); logic('address')->import()->referer($_SERVER['HTTP_REFERER']); include handler('template')->file('@address/import/redirect'); }
public function seller_multis($sid, $iids) { if(false == is_array($iids)) { $iids = explode(',', $iids); } $iids = (array) $iids; include handler('template')->file('@html/iimager/'.$this->style.'/seller_multis'); }
function _file_put_contents($file, $s) { $r = @file_put_contents($file, $s); if (!$r) { handler('io')->initPath($file); @file_put_contents($file, $s); } }
/** *This function catches unhandles errors * *@param null *@return void */ function shut() { //get record for the last error that led to this shutdown instance $error = error_get_last(); //check if the error type is one of those defined in 'E_FATAL' constant if ($error && $error['type'] & E_FATAL) { handler($error['type'], $error['message'], $error['file'], $error['line']); } }
function main() { $this->CheckAdminPrivs('appmanage'); $iphone = ini('iphone'); $app_img_d = base64_decode('aHR0cDovL3NlcnZlci50dHR1YW5nb3UubmV0L3FyY29kZS8/ZGF0YT0=') . urlencode(ini('settings.site_url').'/index.php?mod=downapp&code=down'); $app_img_x = base64_decode('aHR0cDovL3NlcnZlci50dHR1YW5nb3UubmV0L3FyY29kZS8/c2l6ZT1zbWFsbCZkYXRhPQ==') . urlencode(ini('settings.site_url').'/index.php?mod=downapp&code=down'); $from = 'app'; include handler('template')->file('@admin/app_config'); }
function View() { $pid = get('pid', 'int'); $pid || exit('.O O. I need the Product-ID...'); $prizes = logic('prize')->GetList($pid, user()->get('id')); $product = logic('product')->GetOne($pid); $product || exit('> _ < Product-ID invaid'); $this->Title = $product['name']; include handler('template')->file('prize_view'); }
public function html($uid = 0, $type = 'default') { $uid = (0 === $uid ? user()->get('id') : $uid); if($uid < 1) { return ; } $pays = self::get($uid); $type = (in_array($type, array('default', 'index')) ? $type : 'default'); include handler('template')->file('@html/payfrom/' . $type); }
public function watermark_save_test() { $this->CheckAdminPrivs('watermark'); $this->watermark_save('test'); $cfg = ini('image.watermark_test'); $image_test = str_replace('mark.png', 'test.jpg', $cfg['image']); $image_wmd = str_replace('mark.png', 'test_wmd.jpg', $cfg['image']); logic('upload')->Watermark(ROOT_PATH.$image_test, ROOT_PATH.$image_wmd, $cfg); include handler('template')->file('@admin/image_watermark_test'); }
function Modify() { $this->CheckAdminPrivs('link'); $link_list=array(); $current_domain=preg_replace("~^www\.~i","",$_SERVER['HTTP_HOST']); if(@include($this->configPath.'link.php')) { $link_list=$config['link']; } include(handler('template')->file('@admin/link')); }
function edit() { $this->CheckAdminPrivs('htmlset'); $flag = get('flag'); if (!logic('html')->page_exists($flag)) { $this->Messager('静态页面不存在,请重新选择并编辑!', '?mod=html&code=front'); } $html = logic('html')->query($flag); include handler('template')->file('@admin/html_file_edit'); }
function Show(){ $this->CheckAdminPrivs('rebate'); $action = '?mod=rebate_setting&code=save'; $cfg = ini('rebate_setting'); if( empty($cfg) || count($cfg)<0 ){ $profit = array( array('pre'=>5, 'text'=>'每月15号结算') ); }else{ extract($cfg); } include(handler('template')->file("@admin/setting_rebate")); }
public function main() { $this->CheckAdminPrivs('ulogin'); $is_allow_url_fopen = ini_get("allow_url_fopen") == '' ? false : true; $openssl_open = function_exists('openssl_open') === false ? false : true; $session_start = function_exists('session_start') === false ? false : true; $file = DATA_PATH.'ulogin.qq.php'; if (file_exists($file)) $data = file_get_contents($file); $data = json_decode($data); include handler('template')->file('@admin/ulogin'); }