Example #1
0
 public function excute()
 {
     $post = RequestParam::Post();
     if ($post) {
         $username = $post['username'];
         $pwd = $post['pwd'];
         $result = Lib_User::Register($username, $pwd);
         if ($result) {
             System::AddNotice("注册成功");
             Utility::Redirect("/demo/list");
         }
     }
     $param = array('username' => $username);
     $this->show($param);
 }
Example #2
0
 public static function Show($template = '', $parameters = array(), $assignGlobal = true)
 {
     $smarty = self::GetTemplate();
     $smarty->php_handling = Smarty::PHP_ALLOW;
     if ($assignGlobal) {
         $smarty = self::AssignGlobalVar($smarty);
     }
     if ($parameters) {
         foreach ($parameters as $key => $val) {
             $smarty->assign($key, $val);
         }
     }
     if (!$template) {
         $webroot = Config::Get('webroot');
         $path = $_SERVER['PHP_SELF'];
         if (trim($webroot, '/')) {
             $webroot = strtr($webroot, array('/' => "\\/", "\\" => "\\/"));
             $path = preg_replace("/{$webroot}/", '', $path, 1);
         }
         $path = trim($path, '/');
         $dotPos = strpos($path, '.');
         if ($dotPos !== false) {
             $path = substr($path, 0, $dotPos);
         }
         $template = $path . self::DEFAULT_TEMPLATE_SUFFIX;
     }
     ///验证文件是否存在
     //404
     if (strpos($template, '/') !== 0) {
         $file = TEMPLATE_PATH . '/' . $template;
     } else {
         $file = $template;
     }
     if (!file_exists($file)) {
         //找不到文件   报404
         $systemConfig = Config::Get('system');
         if ($systemConfig['404_redirect']) {
             Utility::Redirect('/' . $systemConfig['error']);
         } else {
             $template = $systemConfig['404'];
         }
     }
     ///
     $smarty->display($template);
 }
Example #3
0
 public function excute()
 {
     $loginUser = Lib_User::GetLoginUser();
     if ($loginUser) {
         Utility::Redirect("/demo/list");
     }
     $post = RequestParam::Post();
     if ($post) {
         $username = $post['username'];
         $pwd = $post['pwd'];
         $loginUser = Lib_User::Login($username, $pwd);
         if ($loginUser) {
             System::AddNotice("登陆成功");
             Utility::Redirect("/demo/list");
         }
     }
     $param = array();
     $this->show($param);
 }
Example #4
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('market');
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->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', null, 'team', true);
    $table->image1 = upload_image('upload_image1', null, 'team');
    $table->image2 = upload_image('upload_image2', null, 'team');
    $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat'));
    $partner = DB::GetTableRow('partner', array('username' => $username, 'password' => $password));
    // 更新商户支付信息
    if ($login_partner) {
        $table = new Table('partner_pay', $_POST);
        $table->SetPk('id', $partner['id']);
        $insert = array('id', 'tenpaymid', 'tenpaysec', 'alipaymid', 'alipaysec');
        $flag = $table->insert($insert);
    }
    Session::Set('notice', '新建商户成功');
    Utility::Redirect(WEB_ROOT . '/manage/partner/index.php');
}
include template('manage_partner_create');
Example #5
0
    $table->image = upload_image('upload_image', $team['image'], 'team', true);
    $table->image1 = upload_image('upload_image1', $team['image1'], 'team');
    $table->image2 = upload_image('upload_image2', $team['image2'], 'team');
    //team_type == goods
    if ($table->team_type == 'goods') {
        $table->min_number = 1;
    }
    $error_tip = array();
    if (!$error_tip) {
        if ($table->update($insert)) {
            print $table->title;
            $field = strtoupper($table->conduser) == 'Y' ? null : 'quantity';
            $now_number = Table::Count('order', array('team_id' => $table->id, 'state' => 'pay'), $field);
            $need_update = array('now_number' => $now_number);
            /* 增加了总数,未卖完状态 */
            if ($table->max_number > $table->now_number) {
                $need_update['close_time'] = 0;
            }
            Table::UpdateCache('team', $table->id, $need_update);
            Session::Set('notice', '团购修改成功');
            Utility::Redirect(WEB_ROOT . "/biz/index.php");
        } else {
            Session::Set('error', '修改团信息失败,请检查系统环境?');
        }
    }
}
$groups = DB::LimitQuery('category', array('condition' => array('zone' => 'group')));
$groups = Utility::OptionArray($groups, 'id', 'name');
$partners = DB::LimitQuery('partner', array('order' => 'ORDER BY id DESC'));
$partners = Utility::OptionArray($partners, 'id', 'title');
include template('biz_coupon_edit');
Example #6
0
<?php
include_once( 'config.php' );
//QQ登录成功后的回调地址,主要保存access token
qq_callback();

//获取用户标示id

get_openid();

die($_SESSION["access_token"].'sss'.$_SESSION["openid"]);

if(!option_yes('firstqzonelogin')){
	Utility::Redirect( WEB_ROOT . '/thirdpart/qzone/auth.php' );
	}

Utility::Redirect(WEB_ROOT . '/account/qzone_bind.php' );
Example #7
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$version = strval(SYS_VERSION);
$action = strval($_GET['action']);
if ('db' == $action) {
    $r = zuitu_upgrade($action, $version);
    Session::Set('notice', '数据库结构升级成功,数据库已经是最新版本');
    Utility::Redirect(WEB_ROOT . '/manage/system/upgrade.php');
}
$version_meta = zuitu_version();
$newversion = $version_meta['version'];
$software = $version_meta['software'];
$install = $version_meta['install'];
$patch = $version_meta['patch'];
$patchdesc = $version_meta['patchdesc'];
$upgrade = $version_meta['upgrade'];
$upgradedesc = $version_meta['upgradedesc'];
$isnew = $newversion == $version;
include template('manage_system_upgrade');
Example #8
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
if ($_POST) {
    $update = array('email' => $_POST['email'], 'username' => $_POST['username'], 'realname' => $_POST['realname'], 'zipcode' => $_POST['zipcode'], 'address' => $_POST['address'], 'mobile' => $_POST['mobile'], 'gender' => $_POST['gender'], 'city_id' => $_POST['city_id'], 'qq' => $_POST['qq'], 'city_id' => $_POST['city_id']);
    $avatar = upload_image('upload_image', $login_user['avatar'], 'user');
    $update['avatar'] = $avatar;
    if ($_POST['password'] == $_POST['password2'] && $_POST['password']) {
        $update['password'] = $_POST['password'];
    }
    if (ZUser::Modify($login_user['id'], $update)) {
        Session::Set('notice', '修改账户设置成功');
        Utility::Redirect(WEB_ROOT . '/account/settings.php ');
    } else {
        Session::Set('error', '修改账户设置失败');
    }
}
$readonly['email'] = defined('UC_API') ? '' : 'readonly';
$readonly['username'] = defined('UC_API') ? 'readonly' : '';
include template('account_settings');
Example #9
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$pages = array('help_tour' => '玩转' . $INI['system']['abbreviation'], 'help_faqs' => '常见问题', 'help_zuitu' => '什么是' . $INI['system']['abbreviation'], 'help_api' => '开发API', 'about_contact' => '联系方式', 'about_us' => '关于' . $INI['system']['abbreviation'], 'about_job' => '工作机会', 'about_terms' => '用户协议', 'about_privacy' => '隐私声明');
$id = strval($_GET['id']);
if ($id && !in_array($id, array_keys($pages))) {
    Utility::Redirect(WEB_ROOT . "/manage/system/page.php");
}
$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'));
    }
    Session::Set('notice', "页面:{$pages[$id]}编辑成功");
    Utility::Redirect(WEB_ROOT . "/manage/system/page.php?id={$id}");
}
$value = $n['value'];
include template('manage_system_page');
Example #10
0
                $locale = $INI['migs']['loc'];
                $returnURL = $INI['migs']['url'];
                include template('gift_pay');
            } else {
                Utility::Redirect(WEB_ROOT . '/index.php');
            }
        }
    }
} elseif ($_POST && isset($_POST['cod'])) {
    $carray = array('remark' => strtolower($_POST['remark']), 'paytype' => 'cash', 'state' => 'unpay');
    Table::UpdateCache('gift_card', $_POST['order_id'], $carray);
    $team = Table::Fetch('team', $order['team_id']);
    die(include template('gift_pay_success'));
} else {
    if (is_post()) {
        $order_id = abs(intval($_POST['order_id']));
    } else {
        $order_id = $id = abs(intval($_GET['id']));
    }
    if (!$order_id || !($order = Table::Fetch('gift_card', $order_id))) {
        die('404 Not Found');
    }
    if ($order['state'] == 'pay') {
        if (is_get()) {
            $team = Table::Fetch('team', $order['team_id']);
            die(include template('gift_pay_success'));
        } else {
            Utility::Redirect(WEB_ROOT . "/gift_cards/index.php");
        }
    }
}
Example #11
0
@(list($_, $order_id, $city_id, $_) = explode('-', $out_trade_no, 4));
if ($verify_result) {
    if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS') {
        $order = Table::Fetch('order', $order_id);
        if ($order['state'] == 'unpay') {
            //1
            $table = new Table('order');
            $table->SetPk('id', $order_id);
            $table->pay_id = $out_trade_no;
            $table->money = $total_fee;
            $table->state = 'pay';
            $flag = $table->update(array('state', 'pay_id', 'total_fee'));
            if ($flag) {
                $table = new Table('pay');
                $table->id = $out_trade_no;
                $table->order_id = $order_id;
                $table->money = $total_fee;
                $table->currency = 'CNY';
                $table->bank = '支付宝';
                $table->service = 'alipay';
                $table->create_time = time();
                $table->insert(array('id', 'order_id', 'money', 'currency', 'service', 'create_time', 'bank'));
                //update team,user,order,flow state//
                ZTeam::BuyOne($order);
            }
        }
        Utility::Redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
    }
}
Utility::Redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
Example #12
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
    $login_user = ZUser::GetLogin($_POST['email'], $_POST['password']);
    if (!$login_user) {
        Session::Set('error', '登录失败');
        Utility::Redirect(WEB_ROOT . '/account/login.php');
    } else {
        if ($INI['system']['emailverify'] && $login_user['enable'] == 'N' && $login_user['secret']) {
            Session::Set('unemail', $_POST['email']);
            Utility::Redirect(WEB_ROOT . '/account/verify.php');
        } else {
            Session::Set('user_id', $login_user['id']);
            ZLogin::Remember($login_user);
            ZUser::SynLogin($_POST['email'], $_POST['password']);
            Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php'));
        }
    }
}
$currefer = strval($_GET['r']);
if ($currefer) {
    Session::Set('loginpage', udecode($currefer));
}
include template('account_login');
Example #13
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if (is_post()) {
    $user = Table::Fetch('user', strval($_POST['email']), 'email');
    if ($user) {
        $user['recode'] = $user['recode'] ? $user['recode'] : md5(json_encode($user));
        Table::UpdateCache('user', $user['id'], array('recode' => $user['recode']));
        mail_repass($user);
        Session::Set('reemail', $user['email']);
        Utility::Redirect(WEB_ROOT . '/account/repass.php?action=ok');
    }
    Session::Set('error', '你的Email没有在本站注册');
    Utility::Redirect(WEB_ROOT . '/account/repass.php');
}
$action = strval($_GET['action']);
if ($action == 'ok') {
    die(include template('account_repass_ok'));
}
$pagetitle = '重设密码';
include template('account_repass');
Example #14
0
<?php

@header('Content-Type:text/html;charset=utf-8');
session_start();
include_once 'config.php';
include_once 'weibooauth.php';
$o = new WeiboOAuth(WB_AKEY, WB_SKEY, $_SESSION['keys']['oauth_token'], $_SESSION['keys']['oauth_token_secret']);
$last_key = $o->getAccessToken($_REQUEST['oauth_verifier']);
//获取ACCESSTOKEN
$_SESSION['last_key'] = $last_key;
if (!option_yes('firstsinalogin')) {
    Utility::Redirect(WEB_ROOT . '/thirdpart/sina/auth.php');
}
Utility::Redirect(WEB_ROOT . '/account/sina_bind.php');
Example #15
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
$order = Table::Fetch('order', $id, 'team_id');
if ($order) {
    Session::Set('notice', "删除团购({$id})记录失败,存在订单记录");
} else {
    Table::Delete('team', $id);
    Session::Set('notice', "删除团购({$id})记录成功");
}
Utility::Redirect(udecode($_GET['r']));
Example #16
0
    exit;
} elseif ($action == 'add') {
    $question['type'] = 'radio';
    $question['is_show'] = 1;
    $question['order'] = 0;
    include template('manage_vote_question_edit');
    exit;
    //添加问题,数据处理
} elseif ($action == 'add_submit') {
    $question['title'] = isset($_POST['question']['title']) ? addslashes(htmlspecialchars($_POST['question']['title'])) : '';
    $question['type'] = isset($_POST['question']['type']) && $_POST['question']['type'] == 'radio' ? 'radio' : 'checkbox';
    $question['is_show'] = isset($_POST['question']['is_show']) && $_POST['question']['is_show'] ? 1 : 0;
    $question['order'] = isset($_POST['question']['order']) && is_numeric($_POST['question']['order']) ? $_POST['question']['order'] : '0';
    $table = new Table('vote_question', $question);
    $title_check = Table::Count('vote_question', array("title = '{$question['title']}'"));
    if ($title_check) {
        Session::Set('error', '“' . $question['title'] . '”已存在,请换一个标题。');
        Utility::Redirect(WEB_ROOT . '/manage/vote/question.php?action=add');
        exit;
    }
    $table->addtime = time();
    $table->insert(array('title', 'type', 'is_show', 'addtime', 'order'));
    Session::Set('notice', '添加调查问题成功');
    Utility::Redirect(WEB_ROOT . '/manage/vote/question.php?action=list-all');
    exit;
}
if ($action == 'add' || $action == 'edit') {
    include template('manage_vote_question_edit');
} else {
    include template('manage_vote_question_list');
}
Example #17
0
    $reqHandler->setParameter("sp_billno", $sp_billno);
    $reqHandler->setParameter("transaction_id", $transaction_id);
    $reqHandler->setParameter("total_fee", $v_amount);
    $reqHandler->setParameter("return_url", $v_url);
    $reqHandler->setParameter("desc", $desc);
    $reqHandler->setParameter("spbill_create_ip", Utility::GetRemoteIp());
    $reqUrl = $reqHandler->getRequestURL();
    include template('order_charge');
} else {
    if ($_POST['paytype'] == 'alipay') {
        $_input_charset = 'utf-8';
        $service = 'create_direct_pay_by_user';
        $partner = $INI['alipay']['mid'];
        $security_code = $INI['alipay']['sec'];
        $seller_email = $INI['alipay']['acc'];
        $sign_type = 'MD5';
        $out_trade_no = "charge-{$login_user_id}-{$now}-{$randno}";
        $return_url = $INI['system']['wwwprefix'] . '/order/alipay/return.php';
        $notify_url = $INI['system']['wwwprefix'] . '/order/alipay/notify.php';
        $show_url = $INI['system']['wwwprefix'] . "/credit/index.php";
        $subject = $title;
        $body = $show_url;
        $quantity = 1;
        $parameter = array("service" => $service, "partner" => $partner, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => $_input_charset, "subject" => $subject, "body" => $body, "out_trade_no" => $out_trade_no, "total_fee" => $total_money, "payment_type" => "1", "show_url" => $show_url, "seller_email" => $seller_email);
        $alipay = new AlipayService($parameter, $security_code, $sign_type);
        $sign = $alipay->Get_Sign();
        include template('order_charge');
    } else {
        Utility::Redirect(WEB_ROOT . "/credit/index.php");
    }
}
Example #18
0
include_once 'config.php';
include_once 'txwboauth.php';
$c = new WeiboClient(WB_AKEY, WB_SKEY, $_SESSION['last_key']['oauth_token'], $_SESSION['last_key']['oauth_token_secret']);
$ms = $c->pub_abc($_SESSION['last_key']['openid']);
$id = $_SESSION['last_key']['openid'];
$name = $ms['nickname'];
//echo $name;
if (!$id) {
    need_login();
}
$type = "qzone";
$sns = "qzone:" . $id;
$exist_user = Table::Fetch('user', $sns, 'sns');
if ($exist_user) {
    Session::Set('user_id', $exist_user['id']);
    Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php'));
}
$prompt_name = $ms['nickname'];
$exist_user = Table::Fetch('user', $prompt_name, 'username');
while (!empty($exist_user)) {
    $prompt_name = $ms['nickname'] . '_' . rand(100, 999);
    $exist_user = Table::Fetch('user', $prompt_name, 'username');
}
$new_user = array('username' => $prompt_name, 'password' => rand(10000000, 99999999), 'sns' => $sns);
if ($user_id = ZUser::Create($new_user, true)) {
    Session::Set('user_id', $user_id);
    Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php'));
}
Utility::Redirect(WEB_ROOT . '/thirdpart/qzone/index.php');
Example #19
0
<?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');
Example #20
0
    Utility::Redirect('install.php');
}
if (!$m) {
    Session::Set('error', 'Database setting is not correct');
    Utility::Redirect('install.php');
}
if (!mysql_select_db($db['name'], $m) && !mysql_query("CREATE database `{$db['name']}`;", $m)) {
    Session::Set('error', "Choose Database {$db['name']} Error, is it available?");
    Utility::Redirect('install.php');
}
mysql_select_db($db['name'], $m);
$dir = dirname(__FILE__);
$sql = '';
$f = file('./include/configure/db.sql');
foreach ($f as $l) {
    if (strpos(trim($l), '--') === 0 || strpos(trim($l), '/*') === 0 || !trim($l)) {
        continue;
    }
    $sql .= $l;
}
mysql_query("SET names UTF8;");
$sqls = explode(';', $sql);
foreach ($sqls as $sql) {
    mysql_query($sql, $m);
}
$PHP = array('db' => $db);
if (write_php_file($PHP, SYS_PHPFILE)) {
    Session::Set('notice', 'Installation is done, for security reason please delete install.php!');
}
Utility::Redirect('index.php');
Example #21
0
        if ('cash' == $s) {
            $condition = array('service' => 'cash', 'state' => 'pay');
            $summary = Table::Count('order', $condition, 'money');
            $count = Table::Count('order', $condition);
            list($pagesize, $offset, $pagestring) = pagestring($count, 20);
            $orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC'));
            $user_ids = Utility::GetColumn($orders, 'user_id');
            $admin_ids = Utility::GetColumn($orders, 'admin_id');
            $users = Table::Fetch('user', array_merge($user_ids, $admin_ids));
            $team_ids = Utility::GetColumn($orders, 'team_id');
            $teams = Table::Fetch('team', $team_ids);
            include template('manage_misc_money_cash');
        } else {
            if ('refund' == $s) {
                $condition = array('action' => 'refund');
                $summary = Table::Count('flow', $condition, 'money');
                $count = Table::Count('flow', $condition);
                list($pagesize, $offset, $pagestring) = pagestring($count, 20);
                $flows = DB::LimitQuery('flow', array('condition' => $condition, 'order' => 'ORDER BY id DESC'));
                $user_ids = Utility::GetColumn($flows, 'user_id');
                $admin_ids = Utility::GetColumn($flows, 'admin_id');
                $users = Table::Fetch('user', array_merge($user_ids, $admin_ids));
                $team_ids = Utility::GetColumn($flows, 'detail_id');
                $teams = Table::Fetch('team', $team_ids);
                include template('manage_misc_money_refund');
            } else {
                Utility::Redirect(WEB_ROOT . '/manage/misc/money.php');
            }
        }
    }
}
Example #22
0
<?php

require_once dirname(__FILE__) . '/app.php';
$tip = strval($_GET['tip']);
if ($_POST) {
    if (!Utility::ValidEmail($_POST['email'], true)) {
        Session::Set('error', 'Email is not a valid email address');
        Utility::Redirect(WEB_ROOT . '/subscribe.php');
    }
    if ($_POST['city_id']) {
        ZSubscribe::Create($_POST['email'], $_POST['city_id']);
        if ($city['id'] != $_POST['city_id']) {
            $updatecity = Table::Fetch('category', $_POST['city_id']);
            cookie_city($updatecity);
            $city = $updatecity;
        }
    } else {
        ZSubscribe::Create($_POST['email'], $city['id']);
    }
    die(include template('subscribe_success'));
}
include template('subscribe');
Example #23
0
<?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');
Example #24
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_auth(abs(intval($INI['system']['forum'])) > 0);
$publics = option_category('public');
if ($_POST) {
    $topic = new Table('topic', $_POST);
    if ($topic->category == 'city') {
        $topic->city_id = $city['id'];
    } else {
        $topic->public_id = $topic->category;
    }
    $topic->user_id = $topic->last_user_id = $login_user_id;
    $topic->create_time = $topic->last_time = time();
    $topic->reply_number = 0;
    $insert = array('user_id', 'city_id', 'public_id', 'content', 'last_user_id', 'last_time', 'reply_number', 'create_time', 'title');
    if ($topic_id = $topic->insert($insert)) {
        Utility::Redirect(WEB_ROOT . "/forum/topic.php?id={$topic_id}");
    }
    $topic = $_POST;
}
$id = abs(intval($_GET['id']));
include template('forum_new');
Example #25
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 #26
0
<?php

require_once dirname(__FILE__) . '/app.php';
$request_uri = 'index';
$team = current_team($city['id']);
$daytime = strtotime(date('Y-m-d'));
$condition = array('city_id' => array(0, abs(intval($city['id']))), 'team_type' => 'normal', "begin_time <= '{$daytime}'", "end_time > '{$daytime}'", "audit" => 1);
$count = Table::Count('team', $condition);
if ($count > 1) {
    Utility::Redirect(WEB_ROOT . '/team/list.php');
}
if ($team) {
    $_GET['id'] = abs(intval($team['id']));
    die(require_once dirname(__FILE__) . '/team.php');
}
include template('subscribe');
Example #27
0
if ($team['close_time']) {
    Utility::Redirect(WEB_ROOT . "/team.php?id={$id}");
}
if ($order['state'] == 'unpay') {
    if ($INI['alipay']['mid'] && $order['service'] == 'alipay') {
        $ordercheck['alipay'] = 'checked';
    } else {
        if ($INI['chinabank']['mid'] && $order['service'] == 'chinabank') {
            $ordercheck['chinabank'] = 'checked';
        } else {
            if ($INI['tenpay']['mid'] && $order['service'] == 'tenpay') {
                $ordercheck['tenpay'] = 'checked';
            } else {
                if ($INI['alipay']['mid']) {
                    $ordercheck['alipay'] = 'checked';
                } else {
                    if ($INI['tenpay']['mid']) {
                        $ordercheck['tenpay'] = 'checked';
                    } else {
                        if ($INI['chinabank']['mid']) {
                            $ordercheck['chinabank'] = 'checked';
                        }
                    }
                }
            }
        }
    }
    die(include template('order_check'));
}
Utility::Redirect(WEB_ROOT . "/order/view.php?id={$id}");
Example #28
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_partner();
$partner_id = abs(intval($_SESSION['partner_id']));
$login_partner = $partner = Table::Fetch('partner', $partner_id);
if ($_POST) {
    $table = new Table('partner', $_POST);
    $table->SetStrip('location', 'other');
    $table->SetPk('id', $partner_id);
    $flag = $table->update(array('title', 'bank_name', 'bank_user', 'bank_no', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone'));
    if ($table->password == $table->password2 && $table->password) {
        $update[] = 'password';
        $table->password = ZPartner::GenPassword($table->password);
    }
    if ($flag) {
        Session::Set('notice', 'Change partner information OK');
        Utility::Redirect(WEB_ROOT . "/biz/settings.php");
    }
    Session::Set('error', 'Change partner information failed');
    $partner = $_POST;
}
include template('biz_settings');
Example #29
0
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if ($INI['system']['emailverify']) {
            $u['enable'] = 'N';
        }
        $usergroup = Table::Fetch('user_group', 'customer', 'name');
        if (!empty($usergroup)) {
            $u['user_group_id'] = $usergroup['id'];
        }
        if ($user_id = ZUser::Create($u)) {
            if ($INI['system']['emailverify']) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                Utility::Redirect(WEB_ROOT . '/account/verify.php');
            } else {
                ZLogin::Login($user_id);
                Utility::Redirect(WEB_ROOT . '/index.php');
            }
        } else {
            $au = Table::Fetch('user', $_POST['email'], 'email');
            if ($au) {
                Session::Set('error', 'Failed, Email has registerred ');
            } else {
                Session::Set('error', 'Failed, username has  been taken');
            }
        }
    } else {
        Session::Set('error', 'Register failed, check your password please');
    }
}
include template('account_signup');
Example #30
0
<?php

require_once dirname(__FILE__) . '/app.php';
need_login(true);
if ($login_user['rang'] == 'master') {
    Utility::Redirect(WEB_ROOT . '/account.php');
}
$work_types = DB::GetQueryResult("SELECT * FROM `work_type`", false);
$master = DB::GetQueryResult("SELECT * FROM `master`", false);
$city = DB::GetQueryResult("SELECT * FROM `city` WHERE parent_id = 0", false);
$users_master = DB::GetQueryResult("SELECT id,realname FROM `user` WHERE rang = 'master'", false);
include template('operator');