本文整理汇总了PHP中handler函数的典型用法代码示例。如果您正苦于以下问题:PHP handler函数的具体用法?PHP handler怎么用?PHP handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了handler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
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;
}
}
示例2: modify
public function modify()
{
$this->CheckAdminPrivs('article');
$id = get('id', 'int');
$article = logic('article')->get_one($id);
include handler('template')->file('@admin/article_modify');
}
示例3: vlist
public function vlist()
{
$this->CheckAdminPrivs('styles');
$default = ini('styles.default');
$styles = ui('style')->get_all();
include handler('template')->file('@admin/styles_list');
}
示例4: Process
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');
}
示例5: load
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');
}
示例6: inputer
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');
}
示例7: view
public function view()
{
$id = get('id', 'int');
$article = logic('article')->get_one($id);
$this->Title = $article['title'];
include handler('template')->file('article_view');
}
示例8: water
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);
}
}
示例9: shut
function shut()
{
$error = error_get_last();
if ($error && $error['type'] & E_FATAL) {
handler($error['type'], $error['message'], $error['file'], $error['line']);
}
}
示例10: get_all
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;
}
示例11: edit
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');
}
示例12: customShutdownHandler
function customShutdownHandler()
{
$error = error_get_last();
if ($error && ($error['type'] & 'E_FATAL')) {
handler($error['type'], $error['message'], $error['file'], $error['line']);
}
}
示例13: main
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');
}
}
示例14: order
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');
}
示例15: login
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"));
}