Beispiel #1
0
/**

 * 编辑活动

 * @author abei<*****@*****.**>

 */

require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_log');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



$condition['activity_id'] = $activity_id;

$count = Table::Count('activity_record', $condition);

list($pagesize, $offset, $pagestring) = pagestring($count, 20);
Beispiel #2
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('user_manager_auth');

$action = $_GET['action'];

//	添加一个角色
if($action == 'add_role'){
	if($_POST){
		$role = $_POST['role'];
		$check = true;
		if(empty($role['name'])){
			$check = false;
			Session::Set('error', '角色名称不能为空');	
		}

		if($check == true){
			$role['create_time'] = time();
			DB::Insert('rbac_auth_role',$role);
			Session::Set('notice', '添加角色成功');	
			redirect( WEB_ROOT . "/manage/user/auth.php");
		}

	}
	include template('manage_user_auth_add_role');
}

elseif($action == 'del'){
	$role_id = $_GET['id'];
Beispiel #3
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('order_index');

$t_con = array(
	'begin_time < '.time(),
	'end_time > '.time(),
);
$teams = DB::LimitQuery('team', array('condition'=>$t_con));
$t_id = Utility::GetColumn($teams, 'id');

$condition = array(
	'team_id' => $t_id,
	'team_id > 0',
);
/* filter */
$uemail = strval($_GET['uemail']);
if ($uemail) {
	$field = strpos($uemail, '@') ? 'email' : 'username';
	//$field = is_numeric($uemail) ? 'id' : $field;
	$uuser = Table::Fetch('user', $uemail, $field);
	if($uuser) $condition['user_id'] = $uuser['id'];
	else $uemail = null;
}
$id = abs(intval($_GET['id'])); if ($id) $condition['id'] = $id;
$team_id = abs(intval($_GET['team_id']));
if ($team_id && in_array($team_id, $t_id)) {
	$condition['team_id'] = $team_id;
} else { $team_id = null; 
Beispiel #4
0
<?php 
/**
 * 统一送U币功能
 * @author abei <*****@*****.**>
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('credit_song');
if($_POST){
	$date = $_POST['date'];
	$score = $_POST['score'];
	
	if(empty($date) or empty($score)){
		Session::Set('error', '时间和积分不能为空');
	}else{
		ZCredit::SongMultiByDate($score, strtotime($date));
		
		Session::Set('notice', '送分成功');
		redirect( WEB_ROOT . "/manage/credit/song.php");
	}
}

$cond = array(
	'action'=>'multi',			
);
$logList = DB::LimitQuery('credit',array('condition'=>$cond,'order'=>'order by id desc'));

include template('manage_credit_song');
?>
Beispiel #5
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_store_edit_create');

$id = abs(intval($_GET['id']));
$store = Table::Fetch('store', $id);

if ( $_POST && $id==$_POST['id'] && $store) {
	$table = new Table('store', $_POST);
	$table->SetStrip('location', 'other');
	$table->region = abs(intval($table->region));
	$table->city_id = abs(intval($table->city_id));
	$table->open = (strtoupper($table->open)=='Y') ? 'Y' : 'N';
	
	$table->store_logo = upload_image('store_logo',$store['store_logo'],'team');
	$table->store_bg = upload_image('store_bg',$store['store_bg'],'team');
	$table->store_banner = upload_image('store_banner',$store['store_banner'],'team');
	$table->store_small_logo = upload_image('store_small_logo',$store['store_small_logo'],'team');
	$table->image = upload_image('image',$store['image'],'team');
	
	$up_array = array(
			'name', 'brand', 'city_id', 'longlat', 'region', 'partner_id',
		'type', 'telphone', 'address', 'create_time', 'businesszone',
		'location', 'other', 'open', 'longlat','head', 'contact','jtxl','yysj','mcard_bizer_no',
		'store_logo','store_bg','store_banner','store_small_logo','car_yh','image'
			);

	$flag = $table->update( $up_array );
	if ( $flag ) {
Beispiel #6
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('coupon_consume');

$daytime = strtotime(date('Y-m-d'));
$condition = array(
	'consume' => 'Y',
);

/* fiter */
$tid = strval($_GET['tid']);
$coupon = strval($_GET['coupon']);
$uname = strval($_GET['uname']);
/**
 * 添加分店搜索
 * @author <abei>
 */
$store = strval($_GET['store']);
if($store){
	$condition['store_id'] = $store;
}


if ($tid) { $condition['team_id'] = $tid; } else { $tid = null; }
if ($coupon) {
	$condition[] = "id like '%".mysql_escape_string($coupon)."%'";
}
if ($uname) {
	$ucon = array( "email like '%".mysql_escape_string($uname)."%' OR username like '%".$uname."%'");
Beispiel #7
0
		$goods = Table::Fetch('goods', $id);
		if (!$goods) json('无数据', 'alert');
	}
	$html = render('manage_ajax_dialog_goodsedit');
	json($html, 'dialog');
}
elseif ( 'remove' == $action ) {
	need_rbac_auth('credit_goods',true);
	$goods = Table::Fetch('goods', $id);
	if (!$goods) json('无数据', 'alert');
	Table::Delete('goods', $id);
	Session::Set('notice', '删除商品成功');
	json(null, 'refresh');
}
elseif ( 'disable' == $action ) {
	need_rbac_auth('credit_goods',true);
	$goods = Table::Fetch('goods', $id);
	if (!$goods) json('无数据', 'alert');
	
	$enable = ($goods['enable'] == 'Y') ? 'N' : 'Y';
	$enablestring = ($goods['enable']=='Y') ? '禁用' : '启用';
	Table::UpdateCache('goods', $id, array(
		'enable' => $enable,
	));
	Session::Set('notice', "{$enablestring}兑换商品成功");
	json(null, 'refresh');
}
elseif ( 'view' == $action ) {
	
  	$credit = Table::Fetch('credit', $id);
        $goods_id = Utility::GetColumn($credit, 'detail_id');
Beispiel #8
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
//require_once(dirname(__FILE__) . '/current.php');

need_manager();
need_rbac_auth('news_edit_create');

$id = abs(intval($_GET['id']));
$news  = Table::Fetch('news', $id);

if ( is_get() && empty($news) ) {
	$news = array();
	$news['id'] = 0;
	$news['begin_time'] = strtotime('+0 days');

}
else if ( is_post() ) {
	$news = $_POST;
	$insert = array(
		'title', 
		'begin_time', 
		'detail',
		);
	
	$news['begin_time'] = strtotime($news['begin_time']);
	$insert = array_unique($insert);
	$table = new Table('news', $news);
	$table->SetStrip('detail');

	if ( $news['id'] && $news['id'] == $id ) {
		$table->SetPk('id', $id);
Beispiel #9
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_readycalculate');

$condition = array('fid'=>0, 'last_account+cycle_calculate*3600*24 <= '.time(),);

/* 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(
Beispiel #10
0
<?php



require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_state');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



if($_POST){

	$state = $_POST['state'];

	DB::Update('activity',$activity_id,array('state'=>$state));

	

	Session::Set('notice', '设置活动状态成功!');

	redirect( WEB_ROOT . "/manage/activity/index.php");
Beispiel #11
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('coupon_paycard');
$usage = array( 'Y' => '已用', 'N' => '未用' );
$condition = array();

/* filter */
if (strval($_GET['tid'])!=='') {
	$tid = abs(intval($_GET['tid']));
	$condition['id'] = $tid;
}
if (strval($_GET['state'])) {
	$state = strval($_GET['state']);
	$condition['consume'] = $state;
}
/* end */

$count = Table::Count('paycard', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 50);
if ( strval($_GET['download'])) { $offset = 0; $pagesize = 100000; }

$cards = DB::LimitQuery('paycard', array(
	'condition' => $condition,
	'size' => $pagesize,
	'offset' => $offset,
	'order' => 'ORDER BY consume DESC, expire_time DESC',
));
$user_ids = Utility::GetColumn($cards, 'user_id');
$users = Table::Fetch('user', $user_ids);
Beispiel #12
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('mltad_search');
/**
$now = time();
$condition = array();
$count = Table::Count('search_log', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$searchItemList = DB::LimitQuery('search_log', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));
 */
 
$sql = "SELECT name,count(id) as num,is_top,id FROM `search_log` group by `name` LIMIT 100";
$result = DB::GetQueryResult($sql,false); 



$selector = 'search';
include template('manage_mltad_search');
Beispiel #13
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('credit_setting');

if (is_post()){
	$action = strval($_POST['action']);

	if ( 'charge' == $action ) {
		$username = strval($_POST['username']);
		$credit = intval($_POST['credit']);
		if (is_numeric($username)) $u = Table::Fetch('user', $username);
		elseif (strpos($username, '@')) $u = Table::Fetch('user', $username, 'email');
		else $u = Table::Fetch('user', $username, 'username');
		if ($u && $credit) {
			ZCredit::Create($credit, $u['id'], 'charge', 0);
            log_admin('credit', $u['username'].'用户积分充值',$u);
			redirect(null, '用户积分充值成功!');
		}
	}
	else if ( 'settings' == $action ) {
		$INI['credit']['register'] = abs(intval($_POST['credit']['register']));
		$INI['credit']['login'] = abs(intval($_POST['credit']['login']));
		$INI['credit']['invite'] = abs(intval($_POST['credit']['invite']));
		$INI['credit']['buy'] = abs(intval($_POST['credit']['buy']));
		$INI['credit']['pay'] = 0 + ($_POST['credit']['pay']);
		$INI['credit']['charge'] = 0 + ($_POST['credit']['charge']);
        $INI['credit']['comment'] = abs(intval($_POST['credit']['comment']));
		configure_save('credit');
        log_admin('credit', '设置积分规则',$_POST);
Beispiel #14
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();

$name = $_GET['name'];
need_rbac_auth('mltad_delete');

DB::Delete("search_log",array('name'=>$name));

Session::Set('notice', '删除成功');
redirect( WEB_ROOT . "/manage/mltad/search.php");
Beispiel #15
0
         Session::Set('notice', "邮件地址:{$subscribe['email']}退订成功");
     }
     json(null, 'refresh');
 } else {
     if ('smssubscriberemove' == $action) {
         need_auth('admin');
         $subscribe = Table::Fetch('smssubscribe', $id);
         if ($subscribe) {
             log_admin('misc', '手机号码退订:' . $subscribe['mobile'], $subscribe);
             ZSMSSubscribe::Unsubscribe($subscribe['mobile']);
             Session::Set('notice', "手机号码:{$subscribe['mobile']}退订成功");
         }
         json(null, 'refresh');
     } else {
         if ('partnerremove' == $action) {
             need_rbac_auth('partner_delete', true);
             $partner = Table::Fetch('partner', $id);
             $count = Table::Count('team', array('partner_id' => $id));
             if ($partner && $count == 0) {
                 Table::Delete('partner', $id);
                 Session::Set('notice', "商户:{$id} 删除成功");
                 json(null, 'refresh');
             }
             if ($count > 0) {
                 json('商户有团购项目,删除失败', 'alert');
             }
             json('商户删除失败', 'alert');
         } else {
             if ('storeremove' == $action) {
                 need_auth('market');
                 $store = Table::Fetch('store', $id);
Beispiel #16
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('user_manager_index');

if (is_post()) {
	if ($_POST['action'] == 'authorization') {
		$user_id = $_POST['id'];
		$roles = $_POST['role'];
		
		DB::Delete('rbac_manage_role_relation',array('user_id'=>$user_id));
		
		foreach($roles as $role){
			$arr = array('user_id'=>$user_id,'role_id'=>$role,'create_time'=>time());
			DB::Insert('rbac_manage_role_relation',$arr);
		}
	}
	Session::Set('notice', '管理员授权成功');
	redirect($_SERVER['HTTP_REFERERE']);
}

/* build condition */
$condition = array('manager'=>'Y',);
$count = Table::Count('user', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$users = DB::LimitQuery('user', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
Beispiel #17
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
$daytime = strtotime(date('Y-m-d'));
need_rbac_auth('team_wait');

$now = time();
$condition = array(
	'system' => 'Y',
	"end_time > {$now}",
    "begin_time > '{$daytime}'",
);

/* filter start */
$team_type = strval($_GET['team_type']);
if ($team_type) { $condition['team_type'] = $team_type; }
/* filter end */

$count = Table::Count('team', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$teams = DB::LimitQuery('team', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));
$cities = Table::Fetch('category', Utility::GetColumn($teams, 'city_id'));
$groups = Table::Fetch('category', Utility::GetColumn($teams, 'group_id'));
$selector = 'dsj';
Beispiel #18
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('credit_goods');

$condition = array('action'=>'exchange');

$count = Table::Count('credit', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$credits = DB::LimitQuery('credit', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));

$user_ids = Utility::GetColumn($credits, 'user_id');
$users = Table::Fetch('user', $user_ids);

include template('manage_credit_records');
Beispiel #19
0
<?php
/**
 * 会员卡首页
 * @author abei<*****@*****.**>
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('card_index');

$count = Table::Count('mcard', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$mcards = DB::LimitQuery('mcard', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC', 
	'size' => $pagesize,
	'offset' => $offset,
));
$users = Table::Fetch('user', Utility::GetColumn($mcards, 'user_id'));


include template('manage_card_index');

Beispiel #20
0
/**

 * 编辑活动

 * @author abei<*****@*****.**>

 */

require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_ec');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



if($_POST){

	$update = $_POST['update'];

	$update['image'] = upload_image('image',$activity['image'],'activity');
Beispiel #21
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('team_download');

$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);

if ( $team['delivery']=='express' ) {
	$oc = array(
		'state' => 'pay',
		'team_id' => $id,
	);
	$orders = DB::LimitQuery('order', array(
		'condition' => $oc,
		'order' => 'ORDER BY pay_time DESC, id DESC',
	));
	$kn = array(
		'buy_id' => '支付序号',
		'username' => '用户名',
		'email' => '用户邮箱',
		'realname' => '姓名',
		'mobile' => '手机号码',
		'address' => '地址',
		'quantity' => '数量',
		'condbuy' => '选项',
		'remark' => '备注',
		'date' => '支付时间',
		'pay_id' => '交易单号',
	);
Beispiel #22
0
<?php
/**
 * 会员卡订单首页
 * @author abei<*****@*****.**>
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager(); 
need_rbac_auth('card_order');

$count = Table::Count('mcard_order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$orders = DB::LimitQuery('mcard_order', array(
	'condition' => $condition, 
	'order' => 'ORDER BY id DESC', 
	'size' => $pagesize,  
	'offset' => $offset,
));
$users = Table::Fetch('user', Utility::GetColumn($orders, 'user_id'));
foreach($orders as &$order){

	$store = DB::GetTableRow('store',array('mcard_bizer_no'=>$order['bizer_id'])); 
	
	$order['store'] = $store;
}

include template('manage_card_order');

Beispiel #23
0
<?php
/**
 * 
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_create_edit');

$id = abs(intval($_GET['id']));
$partner = Table::Fetch('partner', $id);

if ( $_POST && $id==$_POST['id'] && $partner) {
	$table = new Table('partner', $_POST);
	$table->SetStrip('location', 'other', 'psjjs');
	$table->group_id = abs(intval($table->group_id));
	$table->city_id = abs(intval($table->city_id));
	$table->open = (strtoupper($table->open)=='Y') ? 'Y' : 'N';
	$table->display = (strtoupper($table->display)=='Y') ? 'Y' : 'N';
	$table->image = upload_image('upload_image', $partner['image'], 'team', true);
	$table->image1 = upload_image('upload_image1', $partner['image1'], 'team');
	$table->image2 = upload_image('upload_image2', $partner['image2'], 'team');
	$table->image3 = upload_image('upload_image3', $partner['image3'], 'team');
	$table->image4 = upload_image('upload_image4', $partner['image4'], 'team');
	$table->image5 = upload_image('upload_image5', $partner['image5'], 'team');
	$table->image6 = upload_image('upload_image6', $partner['image6'], 'team');

	$up_array = array(
			'username', 'pass','title','yysj','skfs','jtxl', 'bank_name','bank_user_xm',  'bank_user', 'bank_no',
			'location', 'other','psjjs','homepage', 'contact', 'mobile', 'phone',
			'address', 'group_id', 'open', 'city_id', 'display','cycle_calculate',
Beispiel #24
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_index');

$condition = array('fid'=>0,);

/* 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(
Beispiel #25
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('caiwu_askrefund');


$partner_id = strval($_GET['partner_id']);
$team_id = strval($_GET['team_id']);
$id = abs(intval($_GET['id'])); 
$uemail = strval($_GET['uemail']);
$adminname = strval($_GET['adminname']);
$adminemail = strval($_GET['adminemail']);
$direction = strval($_GET['direction']);
$coupons= strval($_GET['coupons']);
$content= strval($_GET['content']);
$status = strval($_GET['status']);
$reasons = strval($_GET['reasons']);

if ( $login_user_id > 2){
	$condition = array(
		'type' => 'askrefund',
		'direction' => 'account',
	);
} else {
	$condition = array(
		'type' => 'askrefund',
	);
}

/* filter */
Beispiel #26
0
/**

 * 删除一个活动

 * @author abei <*****@*****.**>

 */

require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_delete');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



$conn = array(

	'activity_id'=>$activity_id

);
Beispiel #27
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();

need_rbac_auth('system_index');

$s = isset($_GET['s']) ? strval($_GET['s']) : null;
$ts = $s ? '_' . $s : null;

$system = Table::Fetch('system', 1);

if ($_POST) {
	need_manager(true);
	unset($_POST['commit']);
	$INI = Config::MergeINI($INI, $_POST);
	$INI = ZSystem::GetUnsetINI($INI);

	$INI['system']['gzip'] = abs(intval($INI['system']['gzip']>0));
	$INI['system']['partnerdown'] = abs(intval($INI['system']['partnerdown']>0));
	$INI['system']['conduser'] = abs(intval($INI['system']['conduser']>0));
	$INI['system']['currencyname'] = strtoupper($INI['system']['currencyname']);
	//2013.07.29
	$sorts = array('MO', 'NO', 'AF', 'NI');
	$sorts_key = array_search($INI['system']['sorttype'], $sorts);
	if(!$sorts_key) $sorts_key = 0;
	$INI['system']['sorttype'] = $sorts[($sorts_key + 1)%4];
	
	save_config();

	$value = Utility::ExtraEncode($INI);
Beispiel #28
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('team_success');

$now = time();
$condition = array(
	'system' => 'Y',
	"end_time < $now",
	"now_number >= min_number"
);

/* filter start */
$team_type = strval($_GET['team_type']);
if ($team_type) { $condition['team_type'] = $team_type; }
$team_id = abs(intval($_GET['team_id']));
if ($team_id) {
	$condition['id'] = $team_id;
} else { $team_id = null; }
$team_key = strval($_GET['team_key']);
if ($team_key ) {
	$condition[] = "title LIKE '%".mysql_escape_string($team_key)."%'";
}
/* filter end */

$count = Table::Count('team', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$teams = DB::LimitQuery('team', array(
	'condition' => $condition,
Beispiel #29
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
require_once(dirname(__FILE__) . '/current.php');

need_manager();
need_rbac_auth('team_create_edit');

$id = abs(intval($_GET['id']));
$team = $eteam = Table::Fetch('team', $id);

if ( is_get() && empty($team) ) {
	$team = array();
	$team['id'] = 0;
	$team['user_id'] = $login_user_id;
	$team['begin_time'] = strtotime('+1 days');
	$team['end_time'] = strtotime('+2 days');
	$team['expire_time'] = strtotime('+1 months +15 days');
	$team['min_number'] = 10;
	$team['per_number'] = 1;
    $team['permin_number'] = 1;
	$team['market_price'] = 1;
	$team['team_price'] = 1;
	$team['delivery'] = 'coupon';
	$team['address'] = $profile['address'];
	$team['mobile'] = $profile['mobile'];
	$team['fare'] = 5;
	$team['farefree'] = 0;
	$team['bonus'] = abs(intval($INI['system']['invitecredit']));
	$team['conduser'] = $INI['system']['conduser'] ? 'Y' : 'N';
	$team['buyonce'] = 'Y';
	$team['booking'] = empty($team['booking'])?0:1;
Beispiel #30
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('team_fail');

$now = time();
$condition = array(
	'system' => 'Y',
	"now_number < min_number",
	"end_time < $now",
);

/* filter start */
$team_type = strval($_GET['team_type']);
if ($team_type) { $condition['team_type'] = $team_type; }
$team_id = abs(intval($_GET['team_id']));
if ($team_id) {
	$condition['id'] = $team_id;
} else { $team_id = null; }
$team_key = strval($_GET['team_key']);
if ($team_key ) {
	$condition[] = "title LIKE '%".mysql_escape_string($team_key)."%'";
}
/* filter end */

$count = Table::Count('team', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$teams = DB::LimitQuery('team', array(
	'condition' => $condition,