コード例 #1
0
ファイル: edit.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager(true)) {
    need_permission('modify', 'team/edit');
}
$id = abs(intval($_GET['id']));
if (!$id || !($team = Table::Fetch('team', $id))) {
    Utility::Redirect(WEB_ROOT . '/team/create.php');
}
if ($_POST) {
    $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'per_number', 'product', 'image', 'detail', 'userreview', 'systemreview', 'image1', 'image2', 'flv', 'delivery', 'mobile', 'address', 'fare', 'express', 'credit', 'user_id', 'city_id', 'group_id', 'partner_id');
    $table = new Table('team', $_POST);
    $table->SetStrip('summary', 'detail', 'systemreview', 'notice');
    $table->begin_time = strtotime($_POST['begin_time']);
    $table->end_time = strtotime($_POST['end_time']);
    $table->expire_time = strtotime($_POST['expire_time']);
    $table->image = upload_image('upload_image', $team['image'], 'team');
    $table->image1 = upload_image('upload_image1', $team['image1'], 'team', 380);
    $table->image2 = upload_image('upload_image2', $team['image2'], 'team', 380);
    $error_tip = array();
    if (!$error_tip) {
        if ($table->update($insert)) {
            if ($_POST['charity_id'] != 0) {
                if ($_POST['deal_charity_id'] != "") {
                    $dealcharity['id'] = $_POST['deal_charity_id'];
                }
                $dealcharity['charity_id'] = $_POST['charity_id'];
                $dealcharity['value'] = str_replace('%', '', $_POST['charityvalue']);
                $dealcharity['deal_id'] = $_POST['id'];
                $dcTable = new Table('deals_charity', $dealcharity);
コード例 #2
0
ファイル: invite.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/invite');
}
$memail = strval($_GET['memail']);
$oemail = strval($_GET['oemail']);
$condition = array('credit > 0', 'pay' => 'N');
if ($memail) {
    $muser = Table::Fetch('user', $memail, 'email');
    if ($muser) {
        $condition['user_id'] = $muser['id'];
    }
}
if ($oemail) {
    $ouser = Table::Fetch('user', $oemail, 'email');
    if ($ouser) {
        $condition['other_user_id'] = $ouser['id'];
    }
}
$count = Table::Count('invite', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$invites = DB::LimitQuery('invite', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$team_ids = Utility::GetColumn($invites, 'team_id');
$teams = Table::Fetch('team', $team_ids);
$user_ids = Utility::GetColumn($invites, 'user_id');
$user_ido = Utility::GetColumn($invites, 'other_user_id');
$user_ids = array_merge($user_ids, $user_ido);
$users = Table::Fetch('user', $user_ids);
include template('manage_misc_invite');
コード例 #3
0
ファイル: subscribe.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/subscribe');
}
$like = strval($_GET['like']);
$cs = strval($_GET['cs']);
/* build condition */
$condition = array();
if ($like) {
    $condition[] = "email like '%" . mysql_escape_string($like) . "%'";
}
if ($cs) {
    $cscity = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $cs), 'one' => true));
    if ($cscity) {
        $condition['city_id'] = $cscity['id'];
    } else {
        $cs = null;
    }
}
/* end */
$count = Table::Count('subscribe', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 50);
$subscribes = DB::LimitQuery('subscribe', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$city_ids = Utility::GetColumn($subscribes, 'city_id');
$cities = Table::Fetch('category', $city_ids);
include template('manage_misc_subscribe');
コード例 #4
0
ファイル: success.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'team/success');
}
$now = time();
$condition = array('system' => 'Y', "end_time < {$now}", "now_number >= min_number");
$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'));
$selector = 'success';
include template('manage_team_index');
コード例 #5
0
ファイル: sms.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/sms');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    $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', 'Update information done.');
    Utility::Redirect(WEB_ROOT . '/manage/system/sms.php');
}
include template('manage_system_sms');
コード例 #6
0
ファイル: bulletin.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/bulletin');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $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', 'Update information is done.');
    Utility::Redirect(WEB_ROOT . '/manage/system/bulletin.php');
}
include template('manage_system_bulletin');
コード例 #7
0
ファイル: down.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'team/down');
}
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
if ($team['delivery'] == 'express') {
    $oc = array('state' => 'pay');
    $orders = DB::LimitQuery('order', array('condition' => $oc));
    $xls[] = "User\tTel\tAddr";
    foreach ($orders as $o) {
        $xls[] = "{$o['realname']}\t'{$o['mobile']}\t{$o['address']}";
    }
    $xls = join("\n", $xls);
    header('Content-Disposition: attachment; filename="team' . $id . '.xls"');
    die(mb_convert_encoding($xls, 'GBK', 'UTF-8'));
} else {
    $cc = array('team_id' => $id);
    $coupons = DB::LimitQuery('coupon', array('condition' => $cc));
    $users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
    $xls[] = "User\tContact\t{$INI['system']['couponname']} Serial\t{$INI['system']['couponname']} Password";
    foreach ($coupons as $o) {
        $u = $users[$o['user_id']];
        $xls[] = "{$u['email']}\t'{$u['mobile']}\t'{$o['id']}\t{$o['secret']}";
    }
    $xls = join("\n", $xls);
    header('Content-Disposition: attachment; filename="team' . $id . '.xls"');
    die(mb_convert_encoding($xls, 'GBK', 'UTF-8'));
}
コード例 #8
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', '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);
$uemail = strval($_GET['uemail']);
if ($uemail) {
    $uuser = Table::Fetch('user', $uemail, 'email');
    if ($uuser) {
        $condition['user_id'] = $uuser['id'];
    } else {
        $uemail = null;
    }
}
$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);
$user_ids = Utility::GetColumn($orders, 'user_id');
$users = Table::Fetch('user', $user_ids);
$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
include template('manage_order_index');
コード例 #9
0
ファイル: create.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'partner/create');
}
if ($_POST) {
    $table = new Table('partner', $_POST);
    $table->SetStrip('location', 'other');
    $table->create_time = time();
    $table->user_id = $login_user_id;
    $table->password = ZPartner::GenPassword($table->password);
    $table->insert(array('user_name', 'user_id', 'city_id', 'title', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password'));
    Utility::Redirect(WEB_ROOT . '/manage/partner/index.php');
}
include template('manage_partner_create');
コード例 #10
0
ファイル: feedback.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/feedback');
}
$action = strval($_GET['action']);
$id = abs(intval($_GET['id']));
$r = udecode($_GET['r']);
$cate = strval($_GET['cate']);
$like = strval($_GET['like']);
if ($action == 'r') {
    Table::Delete('feedback', $id);
    Utility::Redirect($r);
} else {
    if ($action == 'm') {
        Table::UpdateCache('feedback', $id, array('user_id' => $login_user_id));
        Utility::Redirect($r);
    }
}
$condition = array();
if ($cate) {
    $condition['category'] = $cate;
}
if ($like) {
    $condition[] = "content like '%" . mysql_escape_string($like) . "%'";
}
$count = Table::Count('feedback', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$asks = DB::LimitQuery('feedback', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$user_ids = Utility::GetColumn($asks, 'user_id');
コード例 #11
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'user/index');
}
$like = strval($_GET['like']);
$cs = strval($_GET['cs']);
$usergroup = Table::Fetch('user_group', 'customer', 'name');
/* build condition */
//$condition = array();
if ($like) {
    if (empty($usergroup)) {
        $condition = array('or' => array("'user_group_id'!=0", "manager='Y'"), "email like '%" . mysql_escape_string($like) . "%'");
    } else {
        $condition = array('or' => array('and' => array("user_group_id!=0", "user_group_id!=" . $usergroup['id']), "manager='Y'"), "email like '%" . mysql_escape_string($like) . "%'");
    }
} else {
    if (empty($usergroup)) {
        $condition = array('or' => array("user_group_id!=0", "manager='Y'"));
    } else {
        $condition = array('or' => array('and' => array("user_group_id!=0", "user_group_id!=" . $usergroup['id']), "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, 'offset' => $offset));
include template('manage_user_index');
コード例 #12
0
ファイル: page.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/page');
}
$pages = array('help_tour' => 'Tour ' . $INI['system']['abbreviation'], 'help_faqs' => 'FAQ', 'help_zuitu' => 'What is ' . $INI['system']['abbreviation'], 'help_api' => 'Develope API', 'about_us' => 'About ' . $INI['system']['abbreviation'], 'about_job' => 'Job', 'about_terms' => 'Terms&Conditions', 'about_privacy' => 'Privacy');
$id = strval($_GET['id']);
$n = Table::Fetch('page', $id);
if ($_POST) {
    $table = new Table('page', $_POST);
    $table->SetStrip('value');
    if ($n) {
        $table->SetPk('id', $id);
        $table->update(array('id', 'value'));
    } else {
        $table->insert(array('id', 'value'));
    }
}
$value = $n['value'];
include template('manage_system_page');
コード例 #13
0
ファイル: charity.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'charity/charity');
}
$condition = array();
$count = Table::Count('charity', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$charities = DB::LimitQuery('charity', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_system_charity');
コード例 #14
0
ファイル: _city.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'system/_city');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    /* hot city convert */
    $cityname = preg_split('/[\\s,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $hotcity = array();
    foreach ($cityname as $one) {
        $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $one), 'one' => 'true'));
        if ($city) {
            $hotcity[$city['ename']] = $city['name'];
        }
    }
    if (!$hotcity) {
        $hotcity = array('sg' => 'Singapore');
    }
    /* merget */
    $_POST['hotcity'] = $hotcity;
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
コード例 #15
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'coupon/index');
}
$daytime = strtotime(date('Y-m-d'));
$condition = array('consume' => 'N', 'expire_time >= ' . $daytime);
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$coupons = DB::LimitQuery('coupon', array('condition' => $condition, 'order' => 'ORDER BY expire_time ASC', 'size' => $pagesize, 'offset' => $offset));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$teams = Table::Fetch('team', Utility::GetColumn($coupons, 'team_id'));
$selector = 'index';
include template('manage_coupon_index');
コード例 #16
0
ファイル: expire.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'coupon/expire');
}
$daytime = strtotime(date('Y-m-d'));
$condition = array('consume' => 'N', 'expire_time < ' . $daytime);
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$coupons = DB::LimitQuery('coupon', array('condition' => $condition, 'order' => 'ORDER BY expire_time ASC', 'size' => $pagesize, 'offset' => $offset));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$teams = Table::Fetch('team', Utility::GetColumn($coupons, 'team_id'));
$selector = 'index';
include template('manage_coupon_expire');
コード例 #17
0
ファイル: consume.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'coupon/consume');
}
$daytime = strtotime(date('Y-m-d'));
$condition = array('consume' => 'Y');
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$coupons = DB::LimitQuery('coupon', array('condition' => $condition, 'order' => 'ORDER BY consume_time DESC', 'size' => $pagesize, 'offset' => $offset));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$teams = Table::Fetch('team', Utility::GetColumn($coupons, 'team_id'));
$selector = 'index';
include template('manage_coupon_consume');
コード例 #18
0
ファイル: email.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/email');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    $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', 'Update information done');
    Utility::Redirect(WEB_ROOT . '/manage/system/email.php');
}
include template('manage_system_email');
コード例 #19
0
ファイル: charityedit.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'charityedit');
}
if ($_POST) {
    $temp = $_POST;
    $temp['image'] = upload_image('upload_image', null, 'charity');
    $id = abs(intval($_REQUEST['id']));
    $charity = Table::Fetch('charity', $id);
    $table = new Table('charity', $temp);
    $table->letter = strtoupper($table->letter);
    $uarray = array('name', 'description', 'image');
    if (!$_POST['name']) {
        Session::Set('error', 'Can not leave blank for Name');
        Utility::Redirect(null);
    }
    if ($charity) {
        if ($flag = $table->update($uarray)) {
            Session::Set('notice', 'Edit charity done');
        } else {
            Session::Set('error', 'Edit charity failed');
        }
    } else {
        if ($flag = $table->insert($uarray)) {
            Session::Set('notice', 'Create new charity done');
        } else {
            Session::Set('error', 'Create new charity failed');
        }
    }
コード例 #20
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/index');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    $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', 'Add new information done.');
    //Utility::Redirect( WEB_ROOT . '/manage/system/index.php');
}
include template('manage_system_index');
コード例 #21
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'category/index');
}
$condition = array();
($zone = strval($_GET['zone'])) || ($zone = 'city');
if ($zone) {
    $condition['zone'] = $zone;
}
$cates = get_zones();
$count = Table::Count('category', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$categories = DB::LimitQuery('category', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_category_index');
コード例 #22
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/index');
}
$daytime = strtotime(date('Y-m-d'));
$team_count = Table::Count('team');
$order_count = Table::Count('order');
$user_count = Table::Count('user');
$subscribe_count = Table::Count('subscribe');
$order_today_count = Table::Count('order', array("create_time > {$daytime}"));
$user_today_count = Table::Count('user', array("create_time > {$daytime}"));
include template('manage_misc_index');
コード例 #23
0
ファイル: usergroup.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'user/usergroup');
}
$cs = strval($_GET['cs']);
$count = Table::Count('user_group');
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$groups = DB::LimitQuery('user_group', array('order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_user_usergroup');
コード例 #24
0
ファイル: city.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/city');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    /* hot city convert */
    //$cityname = preg_split('/[\s,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $cityname = preg_split('/[,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $hotcity = array();
    foreach ($cityname as $one) {
        $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => trim($one)), 'one' => 'true'));
        if ($city) {
            $hotcity[$city['ename']] = $city['name'];
        }
    }
    if (!$hotcity) {
        $hotcity = array('sg' => 'Singapore');
    }
    /* merget */
    $_POST['hotcity'] = $hotcity;
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
コード例 #25
0
ファイル: unpay.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'order/unpay');
}
$condition = array('state' => 'unpay');
$uemail = strval($_GET['uemail']);
if ($uemail) {
    $uuser = Table::Fetch('user', $uemail, 'email');
    if ($uuser) {
        $condition['user_id'] = $uuser['id'];
    } else {
        $uemail = null;
    }
}
$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);
$user_ids = Utility::GetColumn($orders, 'user_id');
$users = Table::Fetch('user', $user_ids);
$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
include template('manage_order_unpay');
コード例 #26
0
ファイル: edit.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'category/edit');
}
$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');
if (!$_POST['name'] || !$_POST['ename'] || !$_POST['letter']) {
    Session::Set('error', 'Can not leave blank for Full Name, Short Name and First Letter');
    Utility::Redirect(null);
}
if ($category) {
    if ($flag = $table->update($uarray)) {
        Session::Set('notice', 'Edit category done');
    } else {
        Session::Set('error', 'Edit category failed');
    }
} else {
    if ($flag = $table->insert($uarray)) {
        Session::Set('notice', 'Create new category done');
    } else {
        Session::Set('error', 'Create new cagegory failed');
    }
}
Utility::Redirect(null);
コード例 #27
0
ファイル: edit.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'partner/edit');
}
$id = abs(intval($_GET['id']));
$partner = Table::Fetch('partner', $id);
if ($_POST && $id == $_POST['id']) {
    $table = new Table('partner', $_POST);
    $table->SetStrip('location', 'other');
    $up_array = array('username', 'title', 'bank_name', 'bank_user', 'bank_no', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone');
    if ($table->password) {
        $table->password = ZPartner::GenPassword($table->password);
        $up_array[] = 'password';
    }
    $flag = $table->update($up_array);
    if ($flag) {
        Session::Set('notice', 'Change partner information done!');
        Utility::Redirect(WEB_ROOT . "/manage/partner/edit.php?id={$id}");
    }
    Session::Set('error', 'Change partner information failed!');
    $partner = $_POST;
}
include template('manage_partner_edit');
コード例 #28
0
ファイル: create.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager(true)) {
    need_permission('modify', 'team/create');
}
if ($_POST) {
    $team = $_POST;
    $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'product', 'image', 'detail', 'userreview', 'systemreview', 'image1', 'image2', 'flv', 'mobile', 'address', 'fare', 'express', 'delivery', 'credit', 'user_id', 'state', 'city_id', 'group_id', 'partner_id');
    $team['user_id'] = $login_user_id;
    $team['state'] = 'none';
    $team['begin_time'] = strtotime($team['begin_time']);
    $team['end_time'] = strtotime($team['end_time']);
    $team['expire_time'] = strtotime($team['expire_time']);
    $team['image'] = upload_image('upload_image', null, 'team');
    $team['image1'] = upload_image('upload_image1', null, 'team', 380);
    $team['image2'] = upload_image('upload_image2', null, 'team', 380);
    $table = new Table('team', $team);
    $table->SetStrip('summary', 'detail', 'systemreview', 'notice');
    if ($team_id = $table->insert($insert)) {
        if ($team['charity_id'] != 0) {
            $dealcharity['charity_id'] = $team['charity_id'];
            $dealcharity['value'] = str_replace('%', '', $team['value']);
            $dealcharity['deal_id'] = $team_id;
            $dcTable = new Table('deals_charity', $dealcharity);
            $dealinsert = array('charity_id', 'value', 'deal_id');
            $dcTable->insert($dealinsert);
        }
        Utility::Redirect(WEB_ROOT . "/manage/team/index.php");
    }
} else {
コード例 #29
0
ファイル: index.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'customer/index');
}
$like = strval($_GET['like']);
$cs = strval($_GET['cs']);
$usergroup = Table::Fetch('user_group', 'customer', 'name');
/* build condition */
//$condition = array();
if ($like) {
    if (empty($usergroup)) {
        $condition = array('user_group_id' => 0, "email like '%" . mysql_escape_string($like) . "%'");
    } else {
        $condition = array('or' => array('and' => array('user_group_id' => 0, "email like '%" . mysql_escape_string($like) . "%'"), 'user_group_id' => $usergroup['id']), "email like '%" . mysql_escape_string($like) . "%'");
    }
} else {
    if (empty($usergroup)) {
        $condition = array('user_group_id' => 0);
    } else {
        $condition = array('or' => array('and' => array('user_group_id' => 0, "1=1"), 'user_group_id' => $usergroup['id']));
    }
}
$condition[] = "manager='N'";
$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, 'offset' => $offset));
include template('manage_customer_index');
コード例 #30
0
ファイル: askedit.php プロジェクト: jowino/bd786110cact
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'misc/askedit');
}
$id = abs(intval($_GET['id']));
$ask = Table::Fetch('ask', $id);
if (!$ask) {
    Utility::Redirect(WEB_ROOT . '/manage/misc/ask.php');
}
if ($_POST && $id == $_POST['id']) {
    $table = new Table('ask', $_POST);
    $table->update(array('comment', 'content'));
    Utility::Redirect(udecode($_GET['r']));
}
$team = Table::Fetch('team', $ask['team_id']);
$user = Table::Fetch('user', $ask['user_id']);
include template('manage_misc_askedit');