Example #1
0
function json($data, $type = 'eval')
{
    $type = strtolower($type);
    $allow = array('eval', 'alert', 'updater', 'dialog', 'mix', 'refresh');
    if (false == in_array($type, $allow)) {
        return false;
    }
    Output::Json(array('data' => $data, 'type' => $type));
}
Example #2
0
function json($data, $type = 'eval')
{
    $type = strtolower($type);
    $allow = array('eval', 'alert', 'right', 'notice', 'sucsses');
    if (false == in_array($type, $allow)) {
        return false;
    }
    Output::Json(array('data' => $data, 'type' => $type));
}
 function user_email()
 {
     $email = $this->_request("v");
     $users = D("CmsUsers")->getByEmail($email);
     if ($users) {
         Output::Json(null, 1);
     } else {
         Output::Json(0);
     }
 }
 function check_email()
 {
     $v = $this->_request("v");
     $user_id = $this->_request("n");
     $user_id = str_replace("id-", "", $user_id);
     $u = M("Users")->getByEmail($v);
     if (empty($u) || $u['id'] == $user_id) {
         Output::Json(0);
     } else {
         Output::Json(null, 1);
     }
 }
Example #5
0
    $o = array();
    $o['id'] = $one['id'];
    $o['link'] = "{$si['site_url']}/team.php?id={$one['id']}";
    $o['large_image_url'] = team_image($one['image']);
    $o['small_image_url'] = team_image($one['image'], true);
    $o['title'] = $one['title'];
    $o['product'] = $one['product'];
    $o['team_price'] = $one['team_price'];
    $o['market_price'] = $one['market_price'];
    $o['rebate'] = team_discount($one);
    $o['start_date'] = date('c', $one['begin_time']);
    $o['end_date'] = date('c', $one['end_time']);
    $o['state'] = $one['state'];
    $o['tipped'] = $one['reach_time'] > 0;
    $o['tipped_date'] = date('c', $one['reach_time']);
    $o['tipping_point'] = abs(intval($one['min_number']));
    $o['current_point'] = abs(intval($one['now_number']));
    $co = array();
    $co['limited_quantity'] = $one['per_number'] > 0;
    $co['maximum_purchase'] = abs(intval($one['per_number']));
    $co['expiration_date'] = date('c', $one['expire_time']);
    $o['conditions'] = $co;
    $o['city'] = $city['name'];
    $o['group'] = $group['name'];
    $oa[$one['id']] = $o;
}
$o = array('site' => $si, 'teams' => $oa);
//if ('json'===strtolower(strval($_GET['s'])))
Output::Json($o);
//header('Content-Type: application/xml; charset=UTF-8');
//Output::Xml($o);
Example #6
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
cookieset('newbie', 'N');
Output::Json(0);
Example #7
0
	$city = $cityList[$one['city']];
	$group = $city;
	$o = array();
	$o['pid'] = $one['id'];
	$o['url'] = "{$si['url']}/?view={$one['id']}";
	$o['image_large'] = imager($one['img']);
	$o['image_small'] = imager($one['img'], IMG_Small);
	$o['title'] = $one['name'];
	$o['intro'] = $one['intro'];
	$o['now_price'] = $one['nowprice'];
	$o['price'] = $one['price'];
	$o['discount'] = $one['discount'];
	$o['begin_date'] = date('Y-m-d H:i:s', $one['begintime']);
	$o['finish_date'] = date('Y-m-d H:i:s', $one['overtime']);
	$o['status'] = $one['status'];

	$co = array();
	$co['maximum'] = abs(intval($one['oncemax']));
	$co['deadline'] = date('Y-m-d H:i:s', $one['perioddate']);
	$o['conditions'] = $co;

	$o['city'] = $city;
	$oa[$one['id']] = $o;
}
$o = array( 'site' => $si, 'products' => $oa );
if (ENC_IS_GBK) $o = array_iconv('GBK', 'UTF-8', $o);
if ('json'===strtolower(strval($_GET['s']))) Output::Json($o);
header('Content-Type: application/xml; charset=UTF-8');
Output::Xml($o);

?>