Example #1
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
$action = strval($_GET['action']);
$id = strval($_GET['id']);
$sec = strval($_GET['secret']);
if ($action == 'needlogin') {
    $html = render('ajax_dialog_needlogin');
    json($html, 'dialog');
} else {
    if ($action == 'authorization') {
        need_auth('super');
        $user = Table::Fetch('user', $id);
        $html = render('manage_ajax_dialog_authorization');
        json($html, 'dialog');
    } else {
        if ('locale' == $action) {
            $v = cookieget('locale', 'zh_cn');
            cookieset('locale', $v == 'zh_cn' ? 'zh_tw' : 'zh_cn');
            json(null, 'refresh');
        }
    }
}
Example #2
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('team');
if ($_POST) {
    $table = new Table('team', $_POST);
    Table::UpdateCache('team', $_POST['id'], array('now_number' => intval($_POST['now_number'])));
    Session::Set('notice', '修改团购人数成功');
    redirect(WEB_ROOT . "/manage/team/buy_num.php");
}
include template('manage_team_buynum_edit');
Example #3
0
<?php
/**
 * 新增一个员工
 * @author abei <*****@*****.**> 
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_auth('worker');

if($_POST){
	$worker = $_POST['worker'];
	$worker['create_time'] = time();
	$worker['birth'] = !empty($worker['birth']) ? strtotime($worker['birth']) : NULL;
	$worker['in_time'] = !empty($worker['in_time']) ? strtotime($worker['in_time']) : NULL;

	if($worker_id = DB::Insert('worker',$worker)){
		log_admin('worker', '新建员工成功',$worker);
		Session::Set('notice', '新建员工成功');
		redirect( WEB_ROOT . "/manage/worker/index.php");
	}

}

include template('manage_worker_create');
?>
Example #4
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_partner();
$partner_id = abs(intval($_SESSION['partner_id']));
$action = strval($_GET['action']);
$id = $order_id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
need_auth($team['partner_id'] == $partner_id);
if ('teamdetail' == $action) {
    $partner = Table::Fetch('partner', $team['partner_id']);
    $nowcount = Table::Count('order', array('state' => 'pay', 'team_id' => $id));
    $onlinepay = Table::Count('order', array('state' => 'pay', 'team_id' => $id), 'money');
    $creditpay = Table::Count('order', array('state' => 'pay', 'team_id' => $id), 'credit');
    $team['state'] = team_state($team);
    $html = render('ajax_dialog_teamdetail');
    json($html, 'dialog');
}
Example #5
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('order');
$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) {
    $uuser = Table::Fetch('user', $uemail, 'email');
    if ($uuser) {
        $condition['user_id'] = $uuser['id'];
    } else {
        $uemail = null;
    }
}
$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;
}
/* end fiter */
$count = Table::Count('order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$pay_ids = Utility::GetColumn($orders, 'pay_id');
$pays = Table::Fetch('pay', $pay_ids);
Example #6
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('admin|market');
$action = strval($_GET['action']);
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
//处理导航分类下拉框联动效果
if ('baidu' == $action) {
    $first = $_GET['first'];
    require_once dirname(dirname(dirname(__FILE__))) . '/include/configure/navigation.php';
    $second = $baidu[$first];
    foreach ($second as $key => $val) {
        if ('网上购物' == $first || '餐饮美食' == $first || '旅游住宿' == $first) {
            $v[] = '<option value=' . $key . '>' . $key . '</option>';
        } else {
            $v[] = '<option value=' . $val . '>' . $val . '</option>';
        }
    }
    $v = join('<br/>', $v);
    $d = array('html' => "<option value=\"\">---请选择二级分类---</option>" . $v, 'id' => 'cate_api_baidu_second');
    json($d, 'updater');
    //json($second, 'alert');
} elseif ('baidu2' == $action) {
    $first = $_GET['first'];
    $second = $_GET['second'];
    //json($first, 'alert');
    require_once dirname(dirname(dirname(__FILE__))) . '/include/configure/navigation.php';
    foreach ($baidu[$first][$second] as $key => $val) {
        $v[] = '<option value=' . $val . '>' . $val . '</option>';
Example #7
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('ask');
$id = abs(intval($_GET['id']));
Table::Delete('ask', $id);
Session::Set('notice', "删除团购咨询({$id})记录成功");
redirect(udecode($_GET['r']));
Example #8
0
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
if ('newsremove' == $action) {
    need_auth('news');
    $news = Table::Fetch('news', $id);
    Table::Delete('news', $id);
    Session::Set('notice', "新闻 {$id} 删除成功!");
    json(null, 'refresh');
}
if ('mltadremove' == $action) {
    need_auth('mltad');
    $news = Table::Fetch('mltad', $id);
    Table::Delete('mltad', $id);
    Session::Set('notice', "广告 {$id} 删除成功!");
    json(null, 'refresh');
}
Example #9
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('news');
$now = time();
$condition = array();
$count = Table::Count('news', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$news = DB::LimitQuery('news', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$selector = 'index';
include template('manage_news_index');
Example #10
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_auth(option_yes('navforum'));
$condition = array('OR' => array('public_id > 0', 'city_id' => $city['id']), 'length(title) > 0', 'parent_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');
$users = Table::Fetch('user', $user_ids);
$pagetitle = '讨论区';
include template('forum_index');
Example #11
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('help');
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    $INI = ZSystem::GetUnsetINI($INI);
    /* end */
    foreach ($INI['bulletin'] as $bid => $bv) {
        $INI['bulletin'][$bid] = stripslashes($bv);
    }
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
    }
    $flag = $table->update(array('value'));
    Session::Set('notice', '更新系统信息成功');
    Utility::Redirect(WEB_ROOT . '/manage/system/bulletin.php');
}
include template('manage_system_bulletin');
Example #12
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('coupon');
if (is_post()) {
    $paycard = $_POST;
    $paycard['quantity'] = abs(intval($paycard['quantity']));
    $paycard['money'] = abs(intval($paycard['money']));
    $paycard['expire_time'] = strtotime($paycard['expire_time']);
    $error = array();
    if ($paycard['money'] < 10) {
        $error[] = "充值卡面额不能小于10元";
    }
    if ($paycard['quantity'] < 1 || $card['quantity'] > 1000) {
        $error[] = "充值卡每次只能生产1-1000张";
    }
    $today = strtotime(date('Y-m-d'));
    if ($paycard['expire_time'] < $today) {
        $error[] = "过期时间不能小于当天";
    }
    if (!$error && ZPaycard::PayCardCreate($paycard)) {
        log_admin('coupon', '新建充值卡' . $paycard['quantity'] . '张');
        Session::Set('notice', "{$paycard['quantity']}张充值卡生成成功");
        redirect(WEB_ROOT . '/manage/coupon/paycardcreate.php');
    }
    $error = join("<br />", $error);
    Session::Set('error', $error);
} else {
    $paycard = array('expire_time' => strtotime('+6 months'), 'quantity' => 10, 'money' => 50);
}
Example #13
0
     json($html, 'dialog');
 } else {
     if ('inviteok' == $action) {
         need_auth(is_manager());
         $invite = Table::Fetch('invite', $id);
         if (!$invite || $invite['pay'] != 'N') {
             json('Illeggal operation', 'alert');
         }
         Table::UpdateCache('invite', $id, array('pay' => 'Y'));
         $invite = Table::FetchForce('invite', $id);
         ZFlow::CreateFromInvite($invite);
         Session::Set('notice', 'Invitation rebate operation is done');
         json(null, 'refresh');
     } else {
         if ('inviteremove' == $action) {
             need_auth(is_manager());
             Table::Delete('invite', $id);
             Session::Set('notice', 'Illegal invitations deleted!');
             json(null, 'refresh');
         } else {
             if ('subscriberemove' == $action) {
                 $subscribe = Table::Fetch('subscribe', $id);
                 if ($subscribe) {
                     ZSubscribe::Unsubscribe($subscribe);
                     Session::Set('notice', "Email: {$subscribe['email']} unsubscribed successfully");
                 }
                 json(null, 'refresh');
             } else {
                 if ('partnerremove' == $action) {
                     $partner = Table::Fetch('partner', $id);
                     $count = Table::Count('team', array('partner_id' => $id));
Example #14
0
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_auth('caiwu_withdraw');


$id = abs(intval($_GET['id'])); 
$status = strval($_GET['status']);
$withdraw_direction = strval($_GET['withdraw_direction']);
$uemail = strval($_GET['uemail']);
$adminname = strval($_GET['adminname']);
$adminemail = strval($_GET['adminemail']);
$content = strval($_GET['content']);


$condition = array (
	'type' => 'withdraw',
);



/* filter */
if ($id) {
	$condition['id'] = $id;
} else { $id = null; }

if ($status) {
	$condition['status'] = $status;
} else { $status = null; }
Example #15
0
<?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);
Example #16
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_auth(abs(intval($INI['system']['forum'])) > 0);
$condition = array('city_id' => $city['id'], 'team_id' => 0, 'parent_id' => 0);
$topics = DB::LimitQuery('topic', array('condition' => $condition, 'order' => 'ORDER BY head DESC, last_time DESC'));
$user_ids = Utility::GetColumn($topics, 'user_id');
$users = Table::Fetch('user', $user_ids);
include template('forum_city');
Example #17
0
<?php
include(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_auth('market');

	include('./public_func.php');
	$func = new func();
//显示灯鹭设置页面上是文字
$arr_cache[] = $func->show_onoff('denglu_top',$denglu_cache['denglu_top'],$Dlang['denglu_top'],$Dlang['denglu_top_comment']);
	$arr_cache[] = $func->show_onoff('denglu_force_bind',$denglu_cache['denglu_force_bind'],$Dlang['denglu_force_bind'],$Dlang['denglu_force_bind_comment']);
	$arr_cache[] = $func->show_onoff('denglu_login_syn',$denglu_cache['denglu_login_syn'],$Dlang['denglu_login_syn'],$Dlang['denglu_login_syn_comment']);
//	$arr_cache[] = show_onoff('denglu_ignore_checkmail',$denglu_cache['denglu_ignore_checkmail'],$Dlang['denglu_ignore_checkmail'],$Dlang['denglu_ignore_checkmail_comment']);
//	$arr_cache[] = show_onoff('denglu_syn_source',$denglu_cache['denglu_syn_source'],$Dlang['denglu_syn_source'],$Dlang['denglu_syn_source_comment']);
//	$arr_cache[] = $func->show_onoff('denglu_syn_goods',$denglu_cache['denglu_syn_goods'],$Dlang['denglu_syn_goods'],$Dlang['denglu_syn_goods_comment']);
	$arr_cache[] = $func->show_onoff('denglu_syn_comment',$denglu_cache['denglu_syn_comment'],$Dlang['denglu_syn_comment'],$Dlang['denglu_syn_comment_comment']);
	$arr_cache[] = $func->show_input('denglu_appid',$denglu_cache['denglu_appid'],$Dlang['denglu_appid'],$Dlang['denglu_appid_comment']);
	$arr_cache[] = $func->show_input('denglu_appkey',$denglu_cache['denglu_appkey'],'APPKEY',$Dlang['denglu_appkey_comment']);
	
	///////////保存设置 
if($_GET['act']=='do_denglu_set'){

	
	unset($_POST['submit']);unset($_POST['reset']);
	$denglu_cache = $_POST;
	!is_writeable(dirname(dirname(dirname(__FILE__))).'/denglu/lib') && exit($Dlang['lib_cannot_write']);
	$str = "<?php\r\n \$denglu_cache = ".var_export($denglu_cache,1)."\r\n\n?>";
	
	if($fp = fopen(dirname(dirname(dirname(__FILE__))).'/denglu/lib/denglu_cache.php','wb')){
		fwrite($fp,$str);
	}
Example #18
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_partner();
$id = abs(intval($_GET['id']));
$team = $eteam = Table::Fetch('team', $id);
$partner_id = abs(intval($_SESSION['partner_id']));
$login_partner = Table::Fetch('partner', $partner_id);
need_auth($partner_id == $team['partner_id']);
$condition = array('partner_id' => $partner_id, 'id' => $id);
$count = Table::Count('team', $condition);
if ($count == 0 || $team['audit'] == 1) {
    if ($count == 0) {
        $errmsg = '无权操作';
    } else {
        $errmsg = '已审核通过,无法修改,如要修改请联系团旮旯客服!';
    }
    Session::Set('error', $errmsg);
    redirect(WEB_ROOT . '/biz/index.php');
}
if ($_POST) {
    $team = $_POST;
    $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'per_number', 'product', 'image', 'image1', 'image2', 'flv', 'now_number', 'detail', 'userreview', 'card', 'systemreview', 'conduser', 'buyonce', 'bonus', 'sort_order', 'delivery', 'mobile', 'address', 'fare', 'express', 'farefree', 'pre_number', 'user_id', 'city_id', 'group_id', 'partner_id', 'team_type', 'sort_order', 'state', 'condbuy');
    $team['user_id'] = $login_user_id;
    $team['state'] = 'none';
    $team['card'] = 0;
    $team['bonus'] = 0;
    $team['begin_time'] = strtotime($team['begin_time']);
    $team['city_id'] = abs(intval($team['city_id']));
    $team['partner_id'] = abs(intval($partner_id));
    $team['sort_order'] = 0;