示例#1
0
function current_partner($gid = '0')
{
    $a = array('/partner/index.php' => '所有');
    foreach (option_category('partner') as $id => $name) {
        $a["/partner/index.php?gid={$id}"] = $name;
    }
    $l = "/partner/index.php?gid={$gid}";
    if (!$gid) {
        $l = "/partner/index.php";
    }
    return current_link($l, $a, true);
}
示例#2
0
文件: index.php 项目: yunsite/hhzuitu
function current_teamcategory($gid = '0')
{
    global $city;
    $a = array('/team/index.php' => '所有');
    foreach (option_category('group') as $id => $name) {
        $a["/team/index.php?gid={$id}"] = $name;
    }
    $l = "/team/index.php?gid={$gid}";
    if (!$gid) {
        $l = "/team/index.php";
    }
    return current_link($l, $a, true);
}
示例#3
0
function get_city($ip = null)
{
    $cities = option_category('city', false, true);
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $location = ip_location_youdao($ip);
    if ($location) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($location, $one['name'])) {
                return $one;
            }
        }
    }
    return array();
}
示例#4
0
function get_city($ip = null)
{
    $cities = option_category('city', false, true);
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $url = "http://open.baidu.com/ipsearch/s?wd={$ip}&tn=baiduip";
    $res = mb_convert_encoding(Utility::HttpRequest($url), 'UTF-8', 'GBK');
    if (preg_match('#来自:<b>(.+)</b>#Ui', $res, $m)) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($m[1], $one['name'])) {
                return $one;
            }
        }
    }
    return array();
}
示例#5
0
文件: manage.php 项目: noikiy/mdwp
             $clear++;
         } else {
             $unclear++;
         }
     }
     log_admin('system', '清空模板缓存' . $clear . '个');
     json("操作成功,清空缓存文件{$clear}个,未清空{$unclear}个", 'alert');
 } else {
     if ('refundview' == $action) {
         $order = Table::Fetch('order', $id);
         $user = Table::Fetch('user', $order['user_id']);
         $team = Table::Fetch('team', $order['team_id']);
         //find coupons
         $coupons = DB::LimitQuery('coupon', array('condition' => array('order_id' => $order['id'], 'user_id' => $user['id'])));
         if ($team['delivery'] == 'express') {
             $option_express = option_category('express');
             $order['express_name'] = $option_express[$order['express_id']];
         }
         $payservice = array('alipay' => '支付宝', 'tenpay' => '财付通', 'chinabank' => '网银在线', 'credit' => '余额付款', 'cash' => '线下支付', 'yeepay' => '易宝', 'sdopay' => '盛付通', 'cmpay' => '手机支付', 'paypal' => 'Paypal');
         $paystate = array('unpay' => '<font color="green">未付款</font>', 'pay' => '<font color="red">已付款</font>');
         if ($team['delivery'] == 'coupon') {
             $option_refund = array('norefund' => '审核未通过', 'credit' => '退款到账户余额', 'online' => '其他途径已退款');
         } else {
             $option_refund = array('credit' => '退款到账户余额', 'online' => '其他途径已退款');
         }
         $html = render('manage_ajax_dialog_refundview');
         json($html, 'dialog');
     } else {
         if ('refundcheck' == $action) {
             need_auth('admin');
             $rid = strtolower(strval($_GET['rid']));
示例#6
0
        $table->Set('group_id', abs(intval($_POST['group_id'])));
    }
    Session::Set('notice', '商户级别变更成功');
    redirect(WEB_ROOT . "/manage/partner/index.php");
}
$condition = array();
/* filter */
$ptitle = strval($_GET['ptitle']);
if ($ptitle) {
    $condition[] = "title LIKE '%" . mysql_escape_string($ptitle) . "%'";
}
$group_id = strval($_GET['group_id']);
if ($group_id) {
    $condition['group_id'] = $group_id;
}
$city_id = strval($_GET['city_id']);
if ($group_id) {
    $condition['city_id'] = $city_id;
}
$open = strval($_GET['open']);
if ($open) {
    $condition['open'] = $open;
}
/* filter end */
$count = Table::Count('partner', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$partners = DB::LimitQuery('partner', array('condition' => $condition, 'order' => 'ORDER BY head DESC, id DESC', 'size' => $pagesize, 'offset' => $offset));
$groups = option_category('partner');
$vips = option_category('vip');
$cities = option_category('city');
include template('manage_partner_index');
示例#7
0
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>商户</h2>
					<ul class="filter"><li><form method="get">商户名称:<input type="text" name="ptitle" class="h-input" value="<?php 
echo htmlspecialchars($ptitle);
?>
" >&nbsp;<select name="open" class="h-input"><?php 
echo Utility::Option($option_open, $open, '全部秀');
?>
</select>&nbsp;<select name="city_id" class="h-input"><?php 
echo Utility::Option(option_category('city'), $city_id, '全部城市');
?>
</select>&nbsp;<select name="group_id" class="h-input"><?php 
echo Utility::Option(option_category('partner'), $group_id, '全部分类');
?>
</select>&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/><form></li></ul>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="40">ID</th><th width="320">名称</th><th width="60">分类</th><th width="120">联系人</th><th width="130">电话号码</th><th width="60">商户秀</th><th width="120">操作</th></tr>
					<?php 
if (is_array($partners)) {
    foreach ($partners as $index => $one) {
        ?>
					<tr <?php 
        echo $index % 2 ? '' : 'class="alt"';
        ?>
 id="team-list-id-<?php 
        echo $one['id'];
示例#8
0
						<div class="field">
							<label>门店展示</label>
							<input type="text" size="30" name="open" id="partner-edit-open" class="number" value="<?php echo $store['open']; ?>" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:前台门店展示 N:不参与前台门店展示</span>
						</div>
						<div class="field">
                            <label>排序字段</label>
                            <input type="text" size="10" name="head" value="<?php echo abs(intval($store['head'])); ?>" class="number"/><span class="inputtip">数字大的排的靠前</span>
						</div>
						<div class="field">
							<label>所属商家</label>
							<select name="partner_id" id="partner_select" class="f-input f-hint" style="width:360px;"><?php echo Utility::Option($partners, $store['partner_id'], '------ 请选择商户 ------'); ?></select>
							<input type="text" size="30" name="p_id" id="partner_id" class="partner f-f-input" />
						</div>
						<div class="field">
							<label>城市</label>
							<select name="city_id" class="f-input f-hint" style="width:160px;"><?php echo Utility::Option(option_category('city'), $store['city_id'], '-选择城市-'); ?></select>  行政区  <select name="region" style="float:none; width:160px;" class="f-input f-hint" style="width:160px;"><?php echo Utility::Option(option_category('store'), $store['group_id']); ?></select>
						</div>
                        <div class="field">
                            <label>地图坐标</label>
                            <input type="text" size="30" name="longlat" style="width:300px;cursor:point;" class="f-input f-hint" id="inputlonglat"  value="<?php echo $store['longlat']; ?>" />
                            <span class="inputtip">
                            	<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">查坐标</a>
                            </span>
						</div>
						<div class="wholetip clear"><h3>3、基本信息</h3></div>
                        <div class="field">
                            <label>门店品类</label>
                            <input type="text" size="30" name="type" id="partner-create-homepage" class="f-input f-hint" value="<?php echo $store['type']; ?>"/>
                        </div>
                        <div class="field">
                            <label>门店电话</label>
示例#9
0
                        <div class="field password">
                            <label>登录密码</label>
                            <input type="password" size="30" name="password" id="settings-password" class="f-input" require="true" datatype="require" />
                        </div>
						<div class="field password">
                            <label for="create-password-confirm">确认密码</label>
                            <input type="password" size="30" name="password2" id="create-password" class="f-input" require="true" datatype="compare" compare="settings-password" />
                        </div>
						<div class="wholetip clear"><h3>2、标注信息</h3></div>
						<div class="field">
							<label>城市及分类</label>
							<select name="city_id" class="f-input" style="width:160px;"><?php 
echo Utility::Option(option_category('city'), $partner['city_id'], '-选择城市-');
?>
</select>&nbsp;<select name="group_id" class="f-input" style="width:160px;"><?php 
echo Utility::Option(option_category('partner'), $partner['group_id']);
?>
</select>
						</div>
						<div class="field">
							<label>商家图片</label>
							<input type="file" size="30" name="upload_image" id="partner-create-image" class="f-input" />
							<span class="hint">至少要上传一张商家图片, 高质量的商家图片有利于卖家更详细的了解您.</span>
						</div>
						<div class="field">
							<label>商家图片1</label>
							<input type="file" size="30" name="upload_image1" id="partner-create-image1" class="f-input" />
						</div>
						<div class="field">
							<label>商家图片2</label>
							<input type="file" size="30" name="upload_image2" id="partner-create-image2" class="f-input" />
示例#10
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
header('Content-Type: application/xml; charset=UTF-8');
$daytime = strtotime(date('Y-m-d'));
$condition = array('team_type' => 'normal', "begin_time <= {$daytime}", "end_time > {$daytime}", "audit" => 1);
$teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY sort_order DESC, id DESC'));
$groups = option_category('group', false, false);
$oa = array();
$si = array('sitename' => $INI['system']['sitename'], 'wwwprefix' => $INI['system']['wwwprefix'], 'imgprefix' => $INI['system']['imgprefix']);
foreach ($teams as $one) {
    $city = Table::Fetch('category', $one['city_id']);
    $group = Table::Fetch('category', $one['group_id']);
    $item = array();
    $item['loc'] = $si['wwwprefix'] . "/team.php?id={$one['id']}";
    $item['data'] = array();
    $item['data']['display'] = array();
    $o = array();
    $o['website'] = $INI['system']['sitename'];
    $o['siteurl'] = $INI['system']['wwwprefix'];
    ($o['city'] = $city['name']) || ($o['city'] = '全国');
    $o['title'] = $one['title'];
    $o['class'] = $groups[$one['group_id']];
    $o['image'] = $si['imgprefix'] . '/static/' . $one['image'];
    $o['startTime'] = $one['begin_time'];
    $o['endTime'] = $one['end_time'];
    $o['value'] = $one['market_price'];
    $o['price'] = $one['team_price'];
    if ($one['market_price'] > 0) {
        $o['rebate'] = moneyit(10 * $one['team_price'] / $one['market_price']);
    } else {
示例#11
0
         if ($tcount) {
             json('本类下存在团购项目', 'alert');
         }
     } elseif ($category['zone'] == 'express') {
         $tcount = Table::Count('order', array('express_id' => $id));
         if ($tcount) {
             json('本类下存在订单项目', 'alert');
         }
     } elseif ($category['zone'] == 'public') {
         $tcount = Table::Count('topic', array('public_id' => $id));
         if ($tcount) {
             json('本类下存在讨论区话题', 'alert');
         }
     }
     Table::Delete('category', $id);
     option_category($category['zone']);
     Session::Set('notice', '删除分类成功');
     json(null, 'refresh');
 } else {
     if ('teamcoupon' == $action) {
         need_auth('team');
         $team = Table::Fetch('team', $id);
         team_state($team);
         if ($team['now_number'] < $team['min_number']) {
             json('团购未结束或未达到最低成团人数', 'alert');
         }
         /* all orders */
         $all_orders = DB::LimitQuery('order', array('condition' => array('team_id' => $id, 'state' => 'pay')));
         $all_orders = Utility::AssColumn($all_orders, 'id');
         $all_order_ids = Utility::GetColumn($all_orders, 'id');
         $all_order_ids = array_unique($all_order_ids);
示例#12
0
文件: edit.php 项目: yunsite/hhzuitu
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('admin');
$id = abs(intval($_REQUEST['id']));
$category = Table::Fetch('category', $id);
$table = new Table('category', $_POST);
$table->letter = strtoupper($table->letter);
$uarray = array('zone', 'ename', 'letter', 'name', 'czone', 'sort_order');
if (!$_POST['name'] || !$_POST['ename'] || !$_POST['letter']) {
    Session::Set('error', '中文名称、英文名称、首字母均不能为空');
    Utility::Redirect(null);
}
if ($category) {
    if ($flag = $table->update($uarray)) {
        Session::Set('notice', '编辑分类成功');
    } else {
        Session::Set('error', '编辑分类失败');
    }
    option_category($category['zone'], true);
} else {
    if ($flag = $table->insert($uarray)) {
        Session::Set('notice', '新建分类成功');
    } else {
        Session::Set('error', '新建分类失败');
    }
}
option_category($table->zone, true);
Utility::Redirect(null);
示例#13
0
	<div class="dashboard" id="dashboard">
		<ul><?php echo mcurrent_user('index'); ?></ul>
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>用户列表
                    <a style="font-size:12px;color:#000000" href="/manage/user/create.php">新建会员</a>
                    </h2>
                    <div class="sect" style="padding:10px 10px;">
						<form action="/manage/user/index.php" method="get">
							用户名:<input type="text" name="uname" class="f-input" style="width:90px" value="<?php echo htmlspecialchars($uname); ?>" >
							邮件:<input type="text" name="like" class="f-input" value="<?php echo htmlspecialchars($like); ?>" >
							<select name="ucity" style="width:110px;"><?php echo Utility::Option(option_category('city'), $ucity, '所有城市'); ?></select>
							<br/>
							手机:<input type="text" name="mobile" class="f-input" value="<?php echo htmlspecialchars($mobile); ?>" >
							购买次数大于<input type="text" name="numbers" class="f-input" value="<?php echo $numbers; ?>" style="width:20px">
							购买金额大于<input type="text" name="prices" class="f-input" value="<?php echo $prices; ?>" style="width:30px">
							余额大于<input type="text" name="havemoney" class="f-input" value="<?php echo $havemoney; ?>" style="width:20px">
							<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/>
						<form>
					</div>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="50">ID</th><th width="200">Email/用户名</th><th width="100" nowrap>姓名/城市</th><th width="40">余额</th><th width="40">邮编</th><th width="120">注册IP/注册时间</th></th><th width="90">联系电话</th><th width="130">操作</th></tr>
					<?php if(is_array($users)){foreach($users AS $index=>$one) { ?>
					<tr <?php echo $index%2?'':'class="alt"'; ?> id="team-list-id-<?php echo $one['id']; ?>">
						<td><?php echo $one['id']; ?></td>
示例#14
0
    }
    $condition = array('service' => $service, 'state' => $state, 'team_id' => $team_id);
    $orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC'));
    if (!$orders) {
        die('-ERR ERR_NO_DATA');
    }
    $team = Table::Fetch('team', $team_id);
    $name = 'order_' . date('Ymd');
    $kn = array('id' => '订单号', 'pay_id' => '支付号', 'service' => '支付方式', 'price' => '单价', 'quantity' => '数量', 'fare' => '运费', 'origin' => '总金额', 'money' => '支付款', 'credit' => '余额付款', 'state' => '支付状态', 'remark' => '备注', 'express' => '快递信息', 'username' => '用户名', 'useremail' => '用户邮箱', 'usermobile' => '用户手机');
    if ($team['delivery'] == 'express') {
        $kn = array_merge($kn, array('realname' => '收件人', 'mobile' => '手机号码', 'zipcode' => '邮政编码', 'address' => '送货地址'));
    }
    $pay = array('alipay' => '支付宝', 'tenpay' => '财付通', 'chinabank' => '网银在线', 'credit' => '余额付款', 'cash' => '现金支付', '' => '其他');
    $state = array('unpay' => '未支付', 'pay' => '已支付');
    $eorders = array();
    $expresses = option_category('express');
    $users = Table::Fetch('user', Utility::GetColumn($orders, 'user_id'));
    foreach ($orders as $one) {
        $oneuser = $users[$one['user_id']];
        $one['username'] = $oneuser['username'];
        $one['useremail'] = $oneuser['email'];
        $one['usermobile'] = $oneuser['mobile'];
        $one['fare'] = $one['delivery'] == 'express' ? $one['fare'] : 0;
        $one['service'] = $pay[$one['service']];
        $one['price'] = $team['market_price'];
        $one['state'] = $state[$one['state']];
        $one['express'] = $one['express_id'] && $one['express_no'] ? $expresses[$one['express_id']] . ":" . $one['express_no'] : "";
        $eorders[] = $one;
    }
    down_xls($eorders, $kn, $name);
}
示例#15
0
function option_hotcategory($zone = 'city', $force = false, $all = false)
{
    $cates = option_category($zone, $force, true);
    $r = array();
    foreach ($cates as $id => $one) {
        if ('Y' == strtoupper($one['display'])) {
            $r[$id] = $one;
        }
    }
    return $all ? $r : Utility::OptionArray($r, 'id', 'name');
}
示例#16
0
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>用户列表</h2>
                    <ul class="filter">
						<li><form action="/manage/user/index.php" method="get">用户名:<input type="text" name="uname" class="h-input" style="width:90px" value="<?php 
echo htmlspecialchars($uname);
?>
" >&nbsp;邮件:<input type="text" name="like" class="h-input" value="<?php 
echo htmlspecialchars($like);
?>
" >&nbsp;<select name="ucity" style="width:110px;"><?php 
echo Utility::Option(option_category('city'), $ucity, '所有城市');
?>
</select>&nbsp;购买次数大于<input type="text" name="numbers" class="h-input" value="<?php 
echo $numbers;
?>
" style="width:20px">&nbsp;购买金额大于<input type="text" name="prices" class="h-input" value="<?php 
echo $prices;
?>
" style="width:30px">&nbsp;余额大于<input type="text" name="havemoney" class="h-input" value="<?php 
echo $havemoney;
?>
" style="width:20px">&nbsp;&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/><form></li>
					</ul>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
示例#17
0
<?php include template("manage_header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	<div class="dashboard" id="dashboard">
		<ul><?php echo mcurrent_store('index'); ?></ul>
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>门店</h2>
					<ul class="filter"><li><form method="get">门店名称:<input type="text" name="ptitle" class="h-input" value="<?php echo htmlspecialchars($ptitle); ?>" >&nbsp;<select name="open" class="h-input"><?php echo Utility::Option($option_open, $open, '展示'); ?></select>&nbsp;<select name="city_id" class="h-input"><?php echo Utility::Option(option_category('city'), $city_id, '全部城市'); ?></select>&nbsp;<select name="partner_id" style="width:280px;" class="h-input"><?php echo Utility::Option($partners, $partner_id, '全部商家'); ?></select>&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/><form></li></ul>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="40">ID</th><th width="320">名称</th><!--<th width="60">分类</th>--><th width="120">联系人</th><th width="130">电话号码</th><th width="60">展示</th><th width="40">排序</th><th width="100">操作</th></tr>
					<?php if(is_array($stores)){foreach($stores AS $index=>$one) { ?>
					<tr <?php echo $index%2?'':'class="alt"'; ?> id="team-list-id-<?php echo $one['id']; ?>">
						<td><?php echo $one['id']; ?></td>
						<td style="text-align:left;"><a class="deal-title" href="/manage/store/edit.php?id=<?php echo $one['id']; ?>"><?php echo $one['name']; ?></a></td>
						<!--<td nowrap><?php echo $groups[$one['group_id']]; ?><br/><?php echo $cities[$one['city_id']]; ?></td>-->
						<td nowrap><?php echo $one['contact']; ?></td>
						<td nowrap><?php echo $one['telphone']; ?></td>
						<td nowrap><?php echo $one['open']; ?></td>
						<td nowrap><?php echo $one['head']; ?></td>
						<td class="op" nowrap><a href="/manage/store/edit.php?id=<?php echo $one['id']; ?>">编辑</a>|<a href="/ajax/manage.php?action=storeremove&id=<?php echo $one['id']; ?>" class="ajaxlink" ask="确定删除本商户?">删除</a></td>
					</tr>
					<?php }}?>
示例#18
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_open(option_yes('navforum'));
$publics = option_category('public');
$id = abs(intval($_GET['id']));
$condition = array('parent_id' => 0);
if ($id && ($public = Table::Fetch('category', $id))) {
    $condition['public_id'] = $id;
} else {
    if ($id) {
        redirect(WEB_ROOT . '/forum/public.php');
    } else {
        $condition[] = 'public_id > 0';
    }
}
$count = Table::Count('topic', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$topics = DB::LimitQuery('topic', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY head DESC, last_time DESC'));
$user_ids = Utility::GetColumn($topics, 'user_id');
$luser_ids = Utility::GetColumn($topics, 'last_user_id');
$user_ids = array_merge($user_ids, $luser_ids);
$users = Table::Fetch('user', $user_ids);
$public = Table::Fetch('category', $id);
$pagetitle = $public ? "{$public['name']}讨论区" : '公共讨论区';
include template('forum_public');
示例#19
0
</tr>
<tr>
<td height="35">
自定密码特征:
</td>
<td>
<input type=text name=extraChars size=20>
</td>
</tr>
</table> 
                      </div>

						<div class="wholetip clear"><h3>2、标注信息</h3></div>
						<div class="field">
							<label>城市及分类</label>
							<select name="city_id" class="f-input f-hint" style="width:160px;"><?php echo Utility::Option(option_category('city'), $partner['city_id'], '-选择城市-'); ?></select><select name="group_id" class="f-input f-hint" style="width:160px;"><?php echo Utility::Option(option_category('partner'), $partner['group_id']); ?></select>
						</div>
                        <div class="field">
                            <label>排序字段</label>
                            <input type="text" size="10" name="head" value="<?php echo abs(intval($partner['head'])); ?>" class="number"/><span class="inputtip">数字大的排的靠前</span>
						</div>
						<div class="field">
                            <label>结算周期</label>
                            <input type="text" size="10" name="cycle_calculate" value="<?php echo abs(intval($partner['cycle_calculate'])); ?>" class="number"/><span class="inputtip">结算周期,到时自动提醒</span>
						</div>
						<div class="field">
							<label>首页展示</label>
							<input type="text" size="30" name="display" id="partner-edit-display" class="number" value="<?php echo $partner['display']; ?>" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:首页商户展示 N:不参与首页商户展示</span>
						</div>
						<div class="field">
							<label>商户展示</label>
示例#20
0
$condition = array("begin_time <= {$daytime}", "end_time > {$daytime}");
/* city filter */
$ename = strval($_GET['ename']);
if ($ename && $ename != 'none') {
    $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'ename' => $ename), 'one' => true));
}
if ($ename || $city) {
    $city_id = abs(intval($city['id']));
    $condition[] = "((city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or city_id in(0,{$city_id}))";
}
/* end city filter */
$teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY sort_order DESC, id DESC'));
$oa = array();
$si = array('sitename' => $INI['system']['sitename'], 'wwwprefix' => $INI['system']['wwwprefix'], 'imgprefix' => $INI['system']['imgprefix']);
$cities = option_category('city');
$groups = option_category('group');
foreach ($teams as $one) {
    $city = $cities[$one['city_id']];
    $group = $groups[$one['group_id']];
    $item = array();
    $item['loc'] = $si['wwwprefix'] . "/team.php?id={$one['id']}";
    $item['data'] = array();
    $item['data']['display'] = array();
    $item['data']['shops']['shop'] = array();
    $o = array();
    $o['website'] = $INI['system']['sitename'];
    $o['identifier'] = $one['id'];
    $o['siteurl'] = $INI['system']['wwwprefix'];
    ($o['city'] = $city) || ($o['city'] = '全国');
    ($o['tag'] = $group) || ($o['tag'] = '无');
    $o['title'] = $one['title'];
示例#21
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
header('Content-Type:text/xml;charset=utf-8');
$data = array();
$data['website'] = $INI['system']['sitename'];
$data['siteurl'] = $INI['system']['wwwprefix'];
$data['items'] = array();
//团购信息
$teams = DB::LimitQuery('team', array('condition' => array('`begin_time` < ' . time(), '`end_time` > ' . time()), 'order' => 'ORDER BY id DESC'));
$data['items'] = $teams;
//城市信息
$citys = option_category('city', true);
//商家信息
$allPartners = DB::LimitQuery('partner', array('condition' => array('id>0')));
$partners = array();
foreach ($allPartners as $v) {
    $partners[$v['id']]['title'] = $v['title'];
    $partners[$v['id']]['phone'] = $v['phone'];
    $partners[$v['id']]['address'] = $v['address'];
}
$output = get_team($data);
echo $output;
unset($output);
//$team 包含公共信息和每个团购的数据
function get_team($team)
{
    if (!$team) {
        return '';
    }
    $xmlitems = '';
示例#22
0
$currefer = uencode(strval($_SERVER['REQUEST_URI']));
/* session,cache,configure,webroot register */
Session::Init();
$INI = ZSystem::GetINI();
/* end */
/* date_zone */
if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set($INI['system']['timezone']);
}
/* end date_zone */
/* biz logic */
$currency = $INI['system']['currency'];
$login_user_id = ZLogin::GetLoginId();
$login_user = Table::Fetch('user', $login_user_id);
$hotcities = option_hotcategory('city', false, true);
$allcities = option_category('city', false, true);
$city = cookie_city(null);
if (!isset($_COOKIE['referer'])) {
    setcookie('referer', $_SERVER['HTTP_REFERER']);
}
/* not allow access app.php */
if ($_SERVER['SCRIPT_FILENAME'] == __FILE__) {
    redirect(WEB_ROOT . '/index.php');
}
/* end */
$AJAX = 'XMLHttpRequest' == @$_SERVER['HTTP_X_REQUESTED_WITH'];
if (false == $AJAX) {
    header('Content-Type: text/html; charset=UTF-8');
    run_cron();
} else {
    header("Cache-Control: no-store, no-cache, must-revalidate");
示例#23
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
header('Content-Type: application/xml; charset=GBK');
/* city filter */
$ename = strval($_GET['ename']);
if ($ename && $ename != 'none') {
    $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'ename' => $ename), 'one' => true));
}
$city_id = abs(intval($city['id']));
$team = current_team($city_id);
$option_city = option_category('city');
$option_group = option_category('group');
$oa = array();
$oa['provider'] = $INI['system']['sitename'];
$oa['version'] = '1.0';
$oa['dataServiceId'] = '1_1';
$item = array();
$item['keyword'] = "{$INI['system']['sitename']} {$team['product']}";
$item['url'] = "{$INI['system']['wwwprefix']}/team.php?id={$team['id']}";
$item['creator'] = $_SERVER['HTTP_HOST'];
$item['title'] = "{$INI['system']['sitename']} {$team['product']}";
$item['publishdate'] = date('Y-m-d', $team['begin_time']);
$item['imageaddress1'] = team_image($team['image'], true);
$item['imagealt1'] = $team['title'];
$item['imagelink1'] = "{$INI['system']['wwwprefix']}/team.php?id={$team['id']}";
$item['content1'] = $team['product'];
$item['linktext1'] = $team['title'];
$item['linktarget1'] = "{$INI['system']['wwwprefix']}/team.php?id={$team['id']}";
$item['content2'] = "{$team['market_price']}元";
$item['content3'] = "{$team['team_price']}元";