当前位置: 首页>>代码示例>>PHP>>正文


PHP jsonExit函数代码示例

本文整理汇总了PHP中jsonExit函数的典型用法代码示例。如果您正苦于以下问题:PHP jsonExit函数的具体用法?PHP jsonExit怎么用?PHP jsonExit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了jsonExit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

    /**
     * 登录
     */
    public function login ()
    {
        $result = $this->_Model->checkLogin($this->getParam());

        if ($result === false) {
            jsonExit($this->_Model->getError(), false);    
        }

        jsonExit('ok', true);
    }
开发者ID:neil-chen,项目名称:NeilChen,代码行数:13,代码来源:LoginAction.class.php

示例2: add_comment

	public function add_comment (){
		//添加评论    
	    if(!empty ($_REQUEST['user_id']))
		{
	        $goods_id = !empty ($_REQUEST['goods_id'])?trim($_REQUEST['goods_id']):die;
	        $user_id =trim($_REQUEST['user_id']);
	        $user_name = !empty($_REQUEST['user_name'])?trim($_REQUEST['user_name']):$_SESSION['user_name'];
	        $content = trim($_REQUEST['content']);
	        $content = gbktoutf8($content);
			if(EC_CHARSET == 'utf-8'){
				$user_name = gbktoutf8($user_name);
				$content = gbktoutf8($content);
			}else{
				$user_name =  utf8togbk($user_name);
				$content = utf8togbk($content);
			}
	        $email = !empty($_REQUEST['email']) ? trim($_REQUEST['email']):$_SESSION['email'] ;
	        $email = htmlspecialchars($email);
	        $user_name = htmlspecialchars($user_name);	        $rank = !empty($_REQUEST['rank']) ? trim($_REQUEST['rank']):1 ;
	        $msg= zy_add_comment($goods_id,$user_id,$email,$user_name,$content,$rank);
	        jsonExit($msg);
	    }else
		{
	        $msg = rpcLang('goods.php', 'no_user_id');
	        $error['no_user_id'] = $msg;
	        jsonExit($error);
	    }
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:28,代码来源:comment.action.php

示例3: check_write_access

function check_write_access($listId = null)
{
    if (have_write_access($listId)) {
        return;
    }
    jsonExit(array('total' => 0, 'list' => array(), 'denied' => 1));
}
开发者ID:drupalconnect,项目名称:finsearches,代码行数:7,代码来源:common.php

示例4: memberinfo

 public function memberinfo()
 {
     $status = $this->_status;
     if ($this->_userid) {
         $memberinfo = array('userid' => $this->_userid, 'username' => $this->_username, 'groupid' => $this->_groupid, 'nickname' => $this->_nickname, 'status' => L('status' . $status, '', 'mydiy'));
         $status = array('status' => true, 'msg' => $memberinfo);
         jsonExit($status);
     } else {
         $memberinfo = array();
         $status = array('status' => false, 'msg' => $memberinfo);
         jsonExit($status);
     }
 }
开发者ID:shenhua4286,项目名称:gxw,代码行数:13,代码来源:index.php

示例5: recommendGoods

	public function recommendGoods () {
		$article_id = isset($_GET['id']) ? intval($_GET['id']) : 14;
		$article = array();
		if($article_id > 0)
		{
			//文章详细信息
			$article = get_article_info($article_id);
			//文章关联产品
			$article_related_goods = article_related_goods($article_id);		
			$articleArr = array('article'=>$article,'article_related_goods'=>$article_related_goods);
		}
		//var_dump($articleArr);exit;
		jsonExit($articleArr);
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:14,代码来源:article.action.php

示例6: adList

	public function adList () {
		$flashdb = array();
	    if (file_exists(ROOT_PATH .'data/flash_data.xml'))
	    {
	
	        // 兼容v2.7.0及以前版本
	        if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . 'data/flash_data.xml'), $t, PREG_SET_ORDER))
	        {
	            preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/', file_get_contents(ROOT_PATH . 'data/flash_data.xml'), $t, PREG_SET_ORDER);
	        }
	       
	        if (!empty($t))
	        {
	            foreach ($t as $key => $val)
	            {
	                $val[4] = isset($val[4]) ? $val[4] : 0;
	                $flashdb[] = array('src'=>$val[1],'url'=>$val[2],'text'=>$val[3],'sort'=>$val[4]);
	            }
	        }
	
	    } else {
	    	
	        // 兼容v2.7.0及以前版本
	        if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"/', file_get_contents(ROOT_PATH . 'data/cycle_image.xml'), $t, PREG_SET_ORDER))
	        {
	            preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"/', file_get_contents(ROOT_PATH . 'data/cycle_image.xml'), $t, PREG_SET_ORDER);
	        }
	       
	        if (!empty($t))
	        {
	            foreach ($t as $key => $val)
	            {
	                $val[4] = isset($val[4]) ? $val[4] : 0;
	                $flashdb[] = array('src'=>$val[1],'url'=>$val[2]);
	            }
	        }
	    	
	    }
	    jsonExit($flashdb); 
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:40,代码来源:ad.action.php

示例7: public_day

 public function public_day()
 {
     //获取当天日期代码
     $now = SYS_TIME;
     $year = date("Y", $now);
     $month = date("m", $now);
     $day = date("d", $now);
     $week = date("w", $now);
     switch ($week) {
         case 0:
             $week = "日";
             break;
         case 1:
             $week = "一";
             break;
         case 2:
             $week = "二";
             break;
         case 3:
             $week = "三";
             break;
         case 4:
             $week = "四";
             break;
         case 5:
             $week = "五";
             break;
         case 6:
             $week = "六";
             break;
     }
     $calendar = new Calendar();
     $arr = $calendar->Cal($year, $month, $day);
     $lunar = "农历" . $arr["month"] . $arr["day"];
     $solar = date("Y.m.d") . "周" . $week;
     $day = $day;
     $status = array('status' => 'true', 'msg' => array('lunar' => $lunar, 'solar' => $solar, 'day' => $day));
     jsonExit($status);
 }
开发者ID:shenhua4286,项目名称:gxw,代码行数:39,代码来源:index.php

示例8: elseif

} elseif (isset($_GET['setHideList'])) {
    check_write_access();
    $listId = (int) _post('list');
    $flag = (int) _post('hide');
    $bitwise = $flag == 0 ? 'taskview & ~4' : 'taskview | 4';
    $db->dq("UPDATE {mytinytodo_lists} SET taskview={$bitwise} WHERE id={$listId}");
    module_invoke_all('mytinytodo_set_hide_list', array('list' => $listId, 'flag' => $flag));
    jsonExit(array('total' => 1));
} elseif (isset($_GET['setShowCompletedTasks'])) {
    check_write_access();
    $listId = (int) _post('list');
    $flag = (int) _post('compl');
    $bitwise = $flag == 0 ? 'taskview & ~1' : 'taskview | 1';
    $db->dq("UPDATE {mytinytodo_lists} SET taskview={$bitwise} WHERE id={$listId}");
    module_invoke_all('mytinytodo_set_show_completed_tasks', array('list' => $listId, 'flag' => $flag));
    jsonExit(array('total' => 1));
}
###################################################################################################
function prepareTaskRow($r)
{
    $lang = Lang::instance();
    $dueA = prepare_duedate($r['duedate']);
    $c_date = prepare_duedate($r['c_date']);
    $reminderformat = Config::get('dateformat2');
    $reminderdate = formatTime($reminderformat, $r['r_date']);
    $formatCreatedInline = $formatCompletedInline = Config::get('dateformatshort');
    if (date('Y') != date('Y', $r['d_created'])) {
        $formatCreatedInline = Config::get('dateformat2');
    }
    if ($r['d_completed'] && date('Y') != date('Y', $r['d_completed'])) {
        $formatCompletedInline = Config::get('dateformat2');
开发者ID:drupalconnect,项目名称:finsearches,代码行数:31,代码来源:ajax.php

示例9: check_admin_access

function check_admin_access()
{
    if (!is_admin()) {
        jsonExit(array('total' => 0, 'list' => array(), 'denied' => 1));
    }
}
开发者ID:jmcclenon,项目名称:yourTinyTodo,代码行数:6,代码来源:ajax.php

示例10: zonghe_remind

 public function zonghe_remind()
 {
     $this->project_db = pc_base::load_model('project_model');
     $this->products_db = pc_base::load_model('products_model');
     $num1 = $this->project_db->count('status=1');
     $num2 = $this->products_db->count('status=1');
     $this->ststus['success'] = true;
     $this->ststus['msg'] = $num1 + $num2;
     jsonExit($this->ststus);
 }
开发者ID:shenhua4286,项目名称:gxw,代码行数:10,代码来源:index.php

示例11: utf8togbk

        $user_id =trim($_REQUEST['user_id']);
        $user_name = !empty($_REQUEST['user_name'])?trim($_REQUEST['user_name']):$_SESSION['user_name'];
        $user_name = utf8togbk($user_name);
        $email = !empty($_REQUEST['email']) ? trim($_REQUEST['email']):$_SESSION['email'] ;
        $email = htmlspecialchars($email);
        $user_name = htmlspecialchars($user_name);
        $content = trim($_REQUEST['content']);
        $content = utf8togbk($content);
        $rank = !empty($_REQUEST['rank']) ? trim($_REQUEST['rank']):1 ;
        $msg= zy_add_comment($goods_id,$user_id,$email,$user_name,$content,$rank);
        jsonExit($msg);
    }else
	{
        $msg = rpcLang('goods.php', 'no_user_id');
        $error['no_user_id'] = $msg;
        jsonExit($error);
    }
}


/**
 * 查询评论内容
 *
 * @access  public
 * @params  integer     $id
 * @params  integer     $type
 * @params  integer     $page
 * @params  integer     $size
 * @return  array
 */
function zy_assign_comment($id, $type, $page = 1, $size=3)
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:comment.php

示例12: cancel_order

	public function cancel_order () {
		require(RPC_ROOT . 'includes/lib_order.php');
	    include_once('includes/lib_transaction.php');	    
	    checkLogin();
	    $user_id = intval($_SESSION['user_id']);	    
	    $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0;
	    $msg = zy_cancel_order($order_id, $user_id);	    
	    jsonExit("{\"status\":\"$msg[0]\",\"code\":\"$msg[1]\"}");
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:9,代码来源:user.action.php

示例13: done

	public function done () {
		global $ecs,$db,$_CFG;
		include_once(RPC_ROOT.'includes/lib_clips_ec.php');
	    include_once(RPC_ROOT.'includes/lib_payment.php');
	
	    /* 取得购物类型 */
	    $flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
	
	    /* 检查购物车中是否有商品 */
	    $sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE session_id = '" . SESS_ID . "' " .
	           "AND parent_id = 0 AND is_gift = 0 AND rec_type = '$flow_type'";
	    
		if ($db->getOne($sql) == 0)
	    {
			$msg = rpcLang('flow.php', 'no_goods_in_cart');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	    /* 检查商品库存,如果使用库存,且下订单时减库存,则减少库存 */
	    if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE)
	    {
	        $cart_goods_stock = get_cart_goods();       
	        $_cart_goods_stock = array();        
	        foreach ($cart_goods_stock['goods_list'] as $value)
	        {
	            $_cart_goods_stock[$value['rec_id']] = $value['goods_number'];
	        }       
	        zy_flow_cart_stock($_cart_goods_stock);        
	        unset($cart_goods_stock, $_cart_goods_stock);
	    }
	
	    /*
	     * 检查用户是否已经登录
	     * 如果用户已经登录了则检查是否有默认的收货地址
	     * 如果没有登录则跳转到登录和注册页面
	     */
	    if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0)
	    {
	        /* 用户没有登录且没有选定匿名购物,转向到登录页面 */
	        $msg = rpcLang('user.php', 'nologin');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	    $consignee = get_consignee($_SESSION['user_id']);
	
	    /* 检查收货人信息是否完整 */
	    if (!check_consignee_info($consignee, $flow_type))
	    {
	        $msg = rpcLang('flow.php', 'user_address_not_full');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	
	    $_GET['how_oos']	  = isset($_GET['how_oos']) ? intval($_GET['how_oos']) : 0;
	    $_GET['card_message'] = isset($_GET['card_message']) ? htmlspecialchars($_GET['card_message']) : '';
	    $_GET['inv_type']     = !empty($_GET['inv_type']) ? htmlspecialchars($_GET['inv_type']) : '';
	    $_GET['inv_payee']    = isset($_GET['inv_payee']) ? htmlspecialchars($_GET['inv_payee']) : '';
	    $_GET['inv_content']  = isset($_GET['inv_content']) ? htmlspecialchars($_GET['inv_content']) : '';
	    $_GET['postscript']   = isset($_GET['postscript']) ? htmlspecialchars($_GET['postscript']) : '';
	
	    $referer = empty($_GET['referer']) ? 'Android':trim($_GET['referer']);
	    $order = array(
	        //'shipping_id'     => intval($_POST['shipping']),
	    	'shipping_id'     => intval($_GET['shipping']),//快递id
	        'pay_id'          => intval($_GET['payment']),//支付方式id
	        'pack_id'         => isset($_GET['pack']) ? intval($_GET['pack']) : 0,//包装
	        'card_id'         => isset($_GET['card']) ? intval($_GET['card']) : 0,//贺卡
	        'card_message'    => trim($_GET['card_message']),
	        'surplus'         => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
	        'integral'        => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
	        'bonus_id'        => isset($_GET['bonus']) ? intval($_GET['bonus']) : 0,
	        'need_inv'        => empty($_POST['need_inv']) ? 0 : 1,
	        'postscript'      => trim($_POST['postscript']),
	        'how_oos'         => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '',
	        'need_insure'     => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0,
	        'user_id'         => $_SESSION['user_id'],
	        'add_time'        => gmtime(),
	        'order_status'    => OS_UNCONFIRMED,
	        'shipping_status' => SS_UNSHIPPED,
	        'pay_status'      => PS_UNPAYED,
	        'agency_id'       => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']))
	        );
		if(EC_CHARSET == 'utf-8'){
			$order['inv_type'] = gbktoutf8($_GET['inv_type']);
			$order['inv_payee'] = gbktoutf8(trim($_GET['inv_payee']));
			$order['inv_content'] = gbktoutf8($_GET['inv_content']);
		}else{
			$order['inv_type'] = utf8togbk($_GET['inv_type']);
			$order['inv_payee'] = utf8togbk(trim($_GET['inv_payee']));
			$order['inv_content'] = utf8togbk($_GET['inv_content']);
		}
	
	    /* 扩展信息 */
	    if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS)
	    {
	        $order['extension_code'] = $_SESSION['extension_code'];
	        $order['extension_id'] = $_SESSION['extension_id'];
	    }
	    else
	    {
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:mdwp,代码行数:101,代码来源:flow.action.php

示例14: edit

    /**
     * 编辑合伙人保存
     */
    public function edit() {
        $param = $this->getParam();
        $param['openid'] = $this->_openId;

        $phone = $this->getParam('phone');
        $code = $this->getParam('code');
        if (!empty($phone) && !empty($code)) {
            //检查验证码是否正确
            $rcode = $this->model->checkCode($this->_openId, $phone, $code);
            if ($rcode ['code'] != $code) {
                jsonExit('验证码错误,请重新操作!', false);
            }
            $param ['phone'] = $this->getParam('phone');
        }

        //重新审核
        if ($this->getParam('recheck')) {
            $param['state'] = 0;
        }
        //合伙人
        $result = $this->model->updatePartner($param);

        if ($result === false) {
            jsonExit($this->model->getError(), false);
        }
        //重新审核
        if ($this->getParam('recheck')) {
            jsonExit('申请成功!', true);
        }
        jsonExit('修改成功!', true);
    }
开发者ID:neil-chen,项目名称:NeilChen,代码行数:34,代码来源:UserAction.class.php

示例15: isset

<?php

	/**
	  *	获取制定配置的信息LLX 2012.06.01 16:04:01
	  *	
	  *	@param  code
	  *	@return   value | NO
	  */

	define('IN_ECS', true);
	include_once ('./includes/init.php');

	$code = isset($_GET['code']) ? trim($_GET['code']) : 'shop_name';
	if(!empty($_CFG) && isset($_CFG[$code]))
	{
		$msg = "{\"code\":\"".$_CFG[$code]."\"}";
	}
	else
	{
		$msg = "{\"code\":\"no\"}";
	}

	jsonExit($msg);
开发者ID:noikiy,项目名称:mdwp,代码行数:23,代码来源:config.php


注:本文中的jsonExit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。