Beispiel #1
0
    //读取物流方式信息
    $get_delivery_id = 'select `id` from ' . $db->table('payment') . ' where `plugins`=\'' . $plugin . '\'';
    $delivery_id = $db->fetchOne($get_delivery_id);
    if ($delivery_id) {
        if ($db->autoDelete('payment', '`id`=' . $delivery_id)) {
            show_system_message('卸载支付插件成功');
        } else {
            show_system_message('系统繁忙,请稍后再试');
        }
    } else {
        show_system_message('插件已删除或不存在');
    }
    exit;
}
if ('edit' == $act) {
    $payment_id = intval(getGET('payment_id'));
    if ($payment_id <= 0) {
        show_system_message('参数错误');
    }
    $get_payment_plugins = 'select * from ' . $db->table('payment') . ' where `id`=' . $payment_id;
    $payment_plugins = $db->fetchRow($get_payment_plugins);
    if ($payment_plugins['configure']) {
        $payment_plugins['configure'] = unserialize($payment_plugins['configure']);
    }
    $plugin_path = ROOT_PATH . 'plugins/payment/';
    include $plugin_path . $payment_plugins['plugins'] . '.class.php';
    $payment_plugins['configures'] = $plugins[0]['configure'];
    assign('payment_plugins', $payment_plugins);
}
if ('view' == $act) {
    $plugin_path = ROOT_PATH . 'plugins/payment/';
Beispiel #2
0
            break;
        default:
            break;
    }
    //    $response['sql'] = $get_product_list;
    $product_list = $db->fetchAll($get_product_list);
    assign('product_list', $product_list);
    $response['content'] = $smarty->fetch('product-list-item.phtml');
    $response['error'] = 0;
    echo json_encode($response);
    exit;
}
if ($id < 0) {
    redirect('index.php');
}
$state = getGET('state');
$state_list = 'sale_amount|price|discount|star|add_time';
$state = check_action($state_list, $state);
if ('' == $state) {
    $state = 'price';
}
$filter = array();
$filter['id'] = $id;
$get_category_path = 'select `path` from ' . $db->table('category') . ' where `id`=' . $id;
$path = $db->fetchOne($get_category_path);
$get_category_ids = 'select `id` from ' . $db->table('category') . ' where `path` like \'' . $path . '%\' and `id` not in (' . $path . '0)';
$category_ids = $db->fetchAll($get_category_ids);
$category_ids_tmp = array();
$category_ids_str = '';
if ($category_ids) {
    foreach ($category_ids as $key => $val) {
Beispiel #3
0
        show_system_message('参数错误');
    } else {
        $recharge_sn = $db->escape($recharge_sn);
    }
    $get_recharge = 'select * from ' . $db->table('recharge') . ' where `recharge_sn`=\'' . $recharge_sn . '\'';
    $recharge = $db->fetchRow($get_recharge);
    assign('recharge', $recharge);
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $account = getGET('account');
    $begin_time = getGET('begin_time');
    $end_time = getGET('end_time');
    $status = getGET('status');
    $recharge_sn = getGET('recharge_sn');
    $where = ' where 1 ';
    if ($status != '' and $status >= 0) {
        $where .= ' and `status`=' . intval($status);
    } else {
        $status = -1;
    }
    if ($account != '') {
        $account = $db->escape($account);
        $where .= ' and `account`=\'' . $account . '\' ';
    }
    if ($begin_time != '') {
        $begin_time = strtotime($begin_time . ' 00:00:00');
        if ($begin_time) {
            $where .= ' and `recharge_sn`>=\'R' . intval($begin_time) . '000\'';
        }
Beispiel #4
0
         default:
             $and_where .= '';
             break;
     }
     assign('status', $status);
     assign('order_status', $status_str[$status - 1]);
 }
 $order_sn = trim(getGET('order_sn'));
 if ($order_sn) {
     $order_sn = $db->escape($order_sn);
     $and_where .= ' and order_sn like \'%' . $order_sn . '%\'';
 }
 assign('order_sn', $order_sn);
 //分页参数
 $page = intval(getGET('page'));
 $count = intval(getGET('count'));
 //获取总数
 $get_total = 'select count(*) from ' . $db->table('order_content') . ' as a';
 $get_total .= ' where a.business_account = \'' . $_SESSION['business_account'] . '\'';
 $get_total .= $and_where;
 $total = $db->fetchOne($get_total);
 $count = $count <= 0 ? 10 : $count;
 $total_page = ceil($total / $count);
 $page = $page > $total_page ? $total : $page;
 $page = $page <= 0 ? 1 : $page;
 $offset = ($page - 1) * $count;
 $get_content_list = 'select a.*, p.img from ' . $db->table('order_content') . ' as a';
 $get_content_list .= ' left join ' . $db->table('product') . ' as p on a.product_sn = p.product_sn';
 $get_content_list .= ' where a.business_account = \'' . $_SESSION['business_account'] . '\'';
 $get_content_list .= $and_where;
 $get_content_list .= ' order by id desc';
Beispiel #5
0
     $where .= ' and `recharge_sn`=\'' . $recharge_sn . '\'';
     $param_list .= '&recharge_sn=' . $recharge_sn;
 }
 $begin_time = trim(getGET('begin_time'));
 if ($begin_time != '' && ($begin_time = strtotime($begin_time . ' 00:00:00'))) {
     $where .= ' and `add_time`>=' . $begin_time;
     $param_list .= '&begin_time=' . date('Y-m-d', $begin_time);
 }
 $end_time = trim(getGET('end_time'));
 if ($end_time != '' && ($end_time = strtotime($end_time . ' 23:59:59'))) {
     $where .= ' and `add_time`<=' . $end_time;
     $param_list .= '&end_time=' . date('Y-m-d', $end_time);
 }
 $get_count = 'select count(*) from ' . $db->table('recharge') . ' where `account`=\'' . $_SESSION['account'] . '\' ' . $where . ' order by `add_time` DESC';
 //分页
 $page = intval(getGET('page'));
 if ($page == 0) {
     $page = 1;
 }
 $step = 20;
 //每页显示20条记录
 $limit = ($page - 1) * $step;
 $limit = ' limit ' . $limit . ',' . $step;
 $total_count = intval($db->fetchOne($get_count));
 $total_page = intval($total_count / $step);
 if ($total_count % $step) {
     $total_page++;
 }
 assign('total_page', $total_page);
 assign('total_count', $total_count);
 assign('page', $page);
Beispiel #6
0
    $get_business = 'select * from ' . $db->table('business');
    $get_business .= ' where business_account = \'' . $business_account . '\' and status = 1 limit 1';
    $business = $db->fetchRow($get_business);
    if (empty($business)) {
        show_system_message('商户不存在', array());
        exit;
    }
    assign('business_account', $business_account);
}
//认证信息驳回
if ('auth_reject' == $act) {
    if (!check_purview('pur_business_exam', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $business_account = trim(getGET('account'));
    if ('' == $business_account) {
        show_system_message('参数错误', array());
        exit;
    }
    $business_account = $db->escape($business_account);
    $get_business = 'select * from ' . $db->table('business');
    $get_business .= ' where business_account = \'' . $business_account . '\' and status = 2 limit 1';
    $business = $db->fetchRow($get_business);
    if (empty($business)) {
        show_system_message('商户不存在', array());
        exit;
    }
    assign('business_account', $business_account);
}
$template .= $act . '.phtml';
Beispiel #7
0
<?php

/**
 * Created by PhpStorm.
 * User: apple
 * Date: 15/8/20
 * Time: 下午2:08
 */
include 'library/init.inc.php';
$sn = trim(getGET('sn'));
if ($sn == '') {
    header('Location: index.php');
    exit;
}
$get_order_info = 'select * from ' . $db->table('order') . ' where `order_sn`=\'' . $sn . '\'';
$order_info = $db->fetchRow($get_order_info);
$order_info['add_time'] = date('Y-m-d H:i:s', $order_info['add_time']);
$order_info['show_status'] = $lang['order']['status_' . $order_info['status']];
assign('order', $order_info);
$smarty->display('response.phtml');
Beispiel #8
0
    $price_list = $db->fetchAll($get_price_list);
    $price_list_json = array();
    if ($price_list) {
        foreach ($price_list as $index => $price) {
            $price_list_json[$price['level_id']] = $price;
        }
    }
    assign('price_list', $price_list_json);
    assign('price_list_json', json_encode($price_list_json));
    assign('product_sn', $product_sn);
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $status = getGET('status');
    $product_sn = getGET('product_sn');
    $where = ' where 1 ';
    if ($status != '' and $status >= 0) {
        $where .= ' and `status`=' . intval($status);
    } else {
        $status = -1;
    }
    if ($product_sn != '') {
        $product_sn = $db->escape($product_sn);
        $where .= ' and `product_sn`=\'' . $product_sn . '\'';
    }
    $get_total = 'select count(*) from ' . $db->table('product') . $where;
    $total = $db->fetchOne($get_total);
    $count_expected = array(10, 25, 50, 100);
    $page = intval($page);
    $count = intval($count);
Beispiel #9
0
    $plugin_path = ROOT_PATH . 'plugins/express/';
    include $plugin_path . $plugin;
    $delivery_data = $plugins[0];
    $delivery_data['status'] = 1;
    $delivery_data['business_account'] = $_SESSION['business_account'];
    if ($db->autoInsert('delivery', array($delivery_data))) {
        $delivery_id = $db->get_last_id();
        $links = array(array('alt' => '设置配送区域', 'link' => 'express.php?act=delivery_area_set&delivery_id=' . $delivery_id));
        show_system_message('插件安装成功,请设置配送区域', $links);
    } else {
        show_system_message('系统繁忙,请稍后再试');
    }
    exit;
}
if ('uninstall' == $act) {
    $plugin = getGET('plugin');
    if ($plugin == '') {
        show_system_message('参数错误');
    }
    $plugin = $db->escape($plugin);
    //读取物流方式信息
    $get_delivery_id = 'select `id` from ' . $db->table('delivery') . ' where `plugins`=\'' . $plugin . '\' and `business_account`=\'' . $_SESSION['business_account'] . '\'';
    $delivery_id = $db->fetchOne($get_delivery_id);
    if ($delivery_id) {
        if ($db->autoDelete('delivery', '`id`=' . $delivery_id)) {
            //获取区域信息
            $get_area_id = 'select `id` from ' . $db->table('delivery_area') . ' where `delivery_id`=' . $delivery_id;
            $area_ids = $db->fetchAll($get_area_id);
            $area_str = '';
            foreach ($area_ids as $area) {
                $area_str .= $area['id'] . ',';
Beispiel #10
0
<?php

/**
 * PC端首页
 * @author winsen
 * @version 1.0.0
 */
include 'library/init.inc.php';
$action = 'info|password|super_password';
$act = check_action($action, getGET('act'), 'info');
if ('super_password' == $act) {
    assign('sub_title', '超级密码修改');
}
if ('password' == $act) {
    assign('sub_title', '密码修改');
}
if ('info' == $act) {
    assign('sub_title', '信息修改');
}
assign('act', $act);
$smarty->display('profile.phtml');
Beispiel #11
0
        case 'new':
            $get_product_list .= ' order by p.`add_time` DESC';
            break;
        default:
            break;
    }
    $product_list = $db->fetchAll($get_product_list);
    assign('product_list', $product_list);
    $response['content'] = $smarty->fetch('search-product-item.phtml');
    $response['error'] = 0;
    echo json_encode($response);
    exit;
}
$keyword = getGET('keyword');
$keyword = $db->escape($keyword);
$mode = getGET('mode');
$mode_list = 'shop|product';
$mode = check_action($mode_list, $mode);
if ($mode == '') {
    $mode = 'product';
}
if ($mode == 'product') {
    $now = time();
    $get_product_list = 'select p.`id`,p.`name`,if(p.`promote_end`>' . $now . ',p.`promote_price`,p.`price`) as `price`,p.`img`,p.`product_sn`,(select `account` from ' . $db->table('collection') . ' where `account`=\'' . $_SESSION['account'] . '\' and `product_sn`=p.`product_sn`) as collection from ' . $db->table('product') . ' as p where p.`status`=4 and p.`name` like \'%' . $keyword . '%\'';
    $product_list = $db->fetchAll($get_product_list);
    assign('product_list', $product_list);
    assign('keyword', $keyword);
    $filter = array();
    $filter['keyword'] = $keyword;
    //获取其他筛选条件
    $where = '`name` like \'%' . $keyword . '%\'';
    //输出
    $filename = date('YmdHis') . '奖金列表';
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: attachment;filename="' . $filename . '.xls"');
    header('Cache-Control: max-age=0');
    $objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
    $objWriter->save('php://output');
    exit;
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $account = getGET('account');
    $type = intval(getGET('type'));
    $begin_time = getGET('begin_time');
    $end_time = getGET('end_time');
    $where = ' where 1 ';
    if ($type > 0) {
        $where .= ' and `type`=' . $type;
    }
    if ($account != '') {
        $account = $db->escape($account);
        $where .= ' and `account`=\'' . $account . '\' ';
    }
    if ($begin_time != '') {
        $begin_time = strtotime($begin_time . ' 00:00:00');
        if ($begin_time) {
            $where .= ' and `add_time`>=' . intval($begin_time);
        }
    }
    if ($end_time != '') {
Beispiel #13
0
    $get_product_list .= $order;
    $get_product_list .= ' limit ' . $offset . ',' . $count;
    //echo $get_product_list;exit;
    $product_list = $db->fetchAll($get_product_list);
    assign('product_list', $product_list);
    $smarty->display($template);
} else {
    $get_total = 'select count(*) from ' . $db->table('business') . ' where `status`=2 and `shop_name` like \'%' . $keyword . '%\'';
    $total = $db->fetchOne($get_total);
    $total_page = ceil($total / $count);
    $page = intval(getGET('page'));
    $page = $page > $total_page ? $total_page : $page;
    $page = 0 >= $page ? 1 : $page;
    $offset = ($page - 1) * $count;
    create_pager($page, $total_page, $total);
    $filter = trim(getGET('filter'));
    $filter = $db->escape($filter);
    $order = '';
    switch ($filter) {
        default:
            $order .= 'order by comment desc';
            break;
    }
    assign('filter', $filter);
    $get_shop_list = 'select `id`, `shop_name`,`comment`,`shop_logo`,`business_account` from ' . $db->table('business') . ' where ' . ' `status`=2 and `shop_name` like \'%' . $keyword . '%\'';
    $shop_list = $db->fetchAll($get_shop_list);
    if ($shop_list) {
        foreach ($shop_list as $key => $s) {
            $get_product_list = 'select `id`,`img`,`name`,`price` from ' . $db->table('product') . ' where `business_account`=\'' . $s['business_account'] . '\' and `status`=4 order by `star` DESC limit 3';
            $shop_list[$key]['product_list'] = $db->fetchAll($get_product_list);
        }
Beispiel #14
0
<?php

/**
 * 首页
 * Created by PhpStorm.
 * User: apple
 * Date: 15/8/14
 * Time: 下午10:11
 */
include 'library/init.inc.php';
$operation = 'wechat|alipay|bank|cancel';
$opera = check_action($operation, getPOST('opera'));
$action = 'add|list';
$act = check_action($action, getGET('act'), 'add');
$template = 'recharge.phtml';
if ('cancel' == $opera) {
    $response = array('error' => 0, 'msg' => '');
    $withdraw_sn = getPOST('withdraw_sn');
    if ($withdraw_sn == '') {
        $response['msg'] = '000:参数错误';
    } else {
        $withdraw_sn = $db->escape($withdraw_sn);
    }
    if ($response['msg'] == '') {
        $db->begin();
        $check_withdraw = 'select * from ' . $db->table('recharge') . ' where `account`=\'' . $_SESSION['account'] . '\' and ' . ' `recharge_sn`=\'' . $withdraw_sn . '\' and `status`=1 for update;';
        if ($withdraw = $db->fetchRow($check_withdraw)) {
            $db->autoDelete('recharge', '`recharge_sn`=\'' . $withdraw_sn . '\'');
            $response['error'] = 0;
            $response['msg'] = '取消申请成功';
        } else {
Beispiel #15
0
            }
            break;
        default:
    }
}
if ('view' == $act) {
    if (!check_purview('pur_sysconf_view', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $getSysconf = 'select `key`,`name`,`type`,`value`, `remark`, `group` from `' . DB_PREFIX . 'sysconf` where `group`=\'config\' order by `group` asc';
    $sysconf = $db->fetchAll($getSysconf);
    assign('sysconf', $sysconf);
}
if ('edit' == $act) {
    if (!check_purview('pur_sysconf_edit', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $key = getGET('key');
    if ('' == $key) {
        show_system_message('参数错误', array());
    } else {
        $getSysconf = 'select `key`,`name`,`type`,`value` from `' . DB_PREFIX . 'sysconf`';
        $getSysconf .= ' where `key`=\'' . $key . '\'';
        assign('conf', $db->fetchRow($getSysconf));
    }
}
assign('act', $act);
$template .= $act . '.phtml';
$smarty->display($template);
Beispiel #16
0
        show_system_message('参数错误');
    } else {
        $withdraw_sn = $db->escape($withdraw_sn);
    }
    $get_withdraw = 'select * from ' . $db->table('withdraw') . ' where `withdraw_sn`=\'' . $withdraw_sn . '\'';
    $withdraw = $db->fetchRow($get_withdraw);
    assign('withdraw', $withdraw);
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $account = getGET('account');
    $begin_time = getGET('begin_time');
    $end_time = getGET('end_time');
    $status = getGET('status');
    $apply_sn = getGET('withdraw_sn');
    $where = ' where 1 ';
    if ($status != '' and $status >= 0) {
        $where .= ' and `status`=' . intval($status);
    } else {
        $status = -1;
    }
    if ($account != '') {
        $account = $db->escape($account);
        $where .= ' and `account`=\'' . $account . '\' ';
    }
    if ($begin_time != '') {
        $begin_time = strtotime($begin_time . ' 00:00:00');
        if ($begin_time) {
            $where .= ' and `add_time`>=' . intval($begin_time);
        }
Beispiel #17
0
    exit;
}
if ('edit' == $act) {
    $account = trim(getGET('account'));
    if ($account == '') {
        show_system_message('参数错误');
    }
    $account = $db->escape($account);
    $get_user_info = 'select * from ' . $db->table('member') . ' where `account`=\'' . $account . '\'';
    $user_info = $db->fetchRow($get_user_info);
    assign('member_info', $user_info);
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $account = getGET('account');
    $where = ' where 1 ';
    if ($account != '') {
        $account = $db->escape($account);
        $where .= ' and `account`=\'' . $account . '\' ';
    }
    $get_total = 'select count(*) from ' . $db->table('user') . $where;
    $total = $db->fetchOne($get_total);
    $count_expected = array(10, 25, 50, 100);
    $page = intval($page);
    $count = intval($count);
    if (!in_array($count, $count_expected)) {
        $count = 10;
    }
    $total_page = ceil($total / $count);
    $page = $page > $total_page ? $total_page : $page;
Beispiel #18
0
<?php

/**
 * Created by PhpStorm.
 * User: apple
 * Date: 15/9/16
 * Time: 下午2:04
 */
include 'library/init.inc.php';
$code = getGET('code');
$log->record_array($_GET);
if ($code != '') {
    $code = $db->escape($code);
    $url = $db->fetchOne('select `url` from ' . $db->table('short_link') . ' where `hash`=\'' . $code . '\'');
    $log->record($url . ',' . $_SERVER['REQUEST_URI']);
    $url = 'http://' . $_SERVER['HTTP_HOST'] . preg_replace('/d\\/[a-zA-Z].*$/', $url, $_SERVER['REQUEST_URI']);
    $log->record('target url:' . $url);
    if (is_weixin() && $_SESSION['openid'] == '') {
        $oathor_url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=2048#wechat_redirect';
        $url = sprintf($oathor_url, $config['appid'], urlencode($url));
        redirect($url);
    } else {
        redirect($url);
    }
    exit;
}
$opera = getPOST('opera');
if ($opera == 'get_url') {
    $response = array('error' => 1, 'msg' => '');
    if (true || !check_cross_domain()) {
        $url = getPOST('url');
Beispiel #19
0
    if ($content) {
        show_system_message('当前帖子下有回复,不能删除', array());
        exit;
    }
    $delete_section = 'delete from `' . DB_PREFIX . 'forum` where `id`=' . $id . ' limit 1';
    if ($db->delete($delete_section)) {
        show_system_message('删除帖子成功', array());
        exit;
    } else {
        show_system_message('系统繁忙,请稍后再试', array());
        exit;
    }
}
if ('top' == $act) {
    if (!check_purview('pur_forum_edit', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $id = getGET('id');
    $id = intval($id);
    $delete_section = 'update `' . DB_PREFIX . 'forum` set `is_top`=abs(1-`is_top`) where `id`=' . $id . ' limit 1';
    if ($db->update($delete_section)) {
        show_system_message('修改帖子成功', array());
        exit;
    } else {
        show_system_message('系统繁忙,请稍后再试', array());
        exit;
    }
}
$template .= $act . '.phtml';
$smarty->display($template);
Beispiel #20
0
<?php

/**
 * Created by PhpStorm.
 * User: apple
 * Date: 15/10/22
 * Time: 下午3:07
 */
include 'library/init.inc.php';
$business_account = getGET('business_account');
if ($business_account == '') {
    redirect('index.php');
    exit;
}
$business_account = $db->escape($business_account);
$get_business_info = 'select * from ' . $db->table('business') . ' where `business_account`=\'' . $business_account . '\'';
$business_info = $db->fetchRow($get_business_info);
assign('business_info', $business_info);
$smarty->display('map.phtml');
Beispiel #21
0
    }
    $delete_member = 'update ' . $db->table('member') . ' set status = 1  where account = \'' . $account . '\' limit 1';
    if ($db->update($delete_member)) {
        show_system_message('会员' . $account . '已撤销拉黑', array());
        exit;
    } else {
        show_system_message('系统繁忙,请稍后重试', array());
        exit;
    }
}
if ('network' == $act) {
    if (!check_purview('pur_member_network', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $account = trim(getGET('account'));
    if ('' == $account) {
        show_system_message('参数错误', array());
        exit;
    }
    $account = $db->escape($account);
    $get_member = 'select * from ' . $db->table('member') . ' where account = \'' . $account . '\' limit 1';
    $member = $db->fetchRow($get_member);
    if (empty($member)) {
        show_system_message('会员不存在', array());
        exit;
    }
    if ($member['parent_id'] != 0) {
        $get_parent = 'select * from ' . $db->table('member') . ' where id = \'' . $member['parent_id'] . '\' limit 1';
        $parent = $db->fetchRow($get_parent);
        if ($parent['parent_id'] != 0) {
Beispiel #22
0
    $reward_list = array();
    if ($reward_list_temp) {
        foreach ($reward_list_temp as $rlt) {
            $get_reward_detail = 'select cr.`position`,cr.`account`,m.`nickname` from ' . $db->table('cycle_reward') . ' as cr ' . ' join ' . $db->table('member') . ' as m using(`account`) where cr.`cycle_id`=' . $rlt['id'] . ' order by `position`';
            $reward_list[$rlt['serial']] = array('detail' => $db->fetchAll($get_reward_detail));
        }
    }
    assign('reward_list', $reward_list);
}
//游戏现场
if ('detail' == $act) {
    if (!check_purview('pur_scene_detail', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $scene_id = intval(getGET('scene_id'));
    if ($scene_id <= 0) {
        show_system_message('参数错误');
    }
    $get_scene = 'select `id` from ' . $db->table('scene') . ' where `id`=' . $scene_id;
    if (!$db->fetchOne($get_scene)) {
        show_system_message('场景不存在');
    }
    //如果不存在正在报名或者参与中的活动,则创建新的活动
    $get_cycle = 'select `id` from ' . $db->table('cycle') . ' where `scene_id`=' . $scene_id . ' and `status`<2';
    $cycle_id = $db->fetchOne($get_cycle);
    $db->autoUpdate('cycle', array('actived' => 0));
    if (!$cycle_id) {
        $get_cycle_count = 'select count(*) from ' . $db->table('cycle') . ' where `scene_id`=' . $scene_id;
        $count = $db->fetchOne($get_cycle_count);
        $count++;
Beispiel #23
0
    $objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
    $objWriter->save('php://output');
    exit;
}
if ('view' == $act) {
    $page = getGET('page');
    $count = getGET('count');
    $account = getGET('account');
    $type = intval(getGET('type'));
    $status = getGET('status');
    $begin_time = getGET('begin_time');
    $end_time = getGET('end_time');
    if ($status == '') {
        $status = -1;
    }
    $status = intval(getGET('status'));
    $where = ' where 1 ';
    if ($status > 0) {
        $status = intval($status);
        $where .= ' and `status`=' . $status;
    }
    if ($type > 0) {
        $where .= ' and `type`=' . $type;
    }
    if ($account != '') {
        $account = $db->escape($account);
        $where .= ' and `account`=\'' . $account . '\' ';
    }
    if ($begin_time != '') {
        $begin_time = strtotime($begin_time . ' 00:00:00');
        if ($begin_time) {
        $links = array(array('link' => 'virtual_product.php', 'alt' => '虚拟产品列表'), array('link' => 'virtual_product.php?act=cycle', 'alt' => '回收站'), array('link' => 'virtual_product.php?act=add', 'alt' => '添加虚拟产品'));
        $db->commit();
        show_system_message('产品' . $product['product_sn'] . '已被彻底删除', $links);
        exit;
    } else {
        $db->rollback();
        show_system_message('系统繁忙,请稍后重试', array());
        exit;
    }
}
if ('inventory' == $act) {
    if (!check_purview('pur_virtual_product_edit', $_SESSION['business_purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $product_sn = trim(getGET('sn'));
    if ('' == $product_sn) {
        show_system_message('参数错误', array());
        exit;
    }
    $product_sn = $db->escape($product_sn);
    $get_product = 'select a.* from ' . $db->table('product') . ' as a';
    $get_product .= ' where business_account = \'' . $_SESSION['business_account'] . '\'';
    $get_product .= ' and is_virtual = 1';
    //实体产品
    $get_product .= ' and a.product_sn = \'' . $product_sn . '\' and status <> 2 limit 1';
    $product = $db->fetchRow($get_product);
    if (!$product) {
        show_system_message('产品不存在', array());
        exit;
    }
Beispiel #25
0
<?php

/**
 * Created by PhpStorm.
 * User: apple
 * Date: 15/9/22
 * Time: 上午7:17
 */
include 'library/init.inc.php';
$sn = getGET('sn');
if ($sn == '') {
    redirect('index.php');
}
$sn = $db->escape($sn);
//获取商家信息
$get_business_info = 'select * from ' . $db->table('business') . ' where `business_account`=\'' . $sn . '\'';
$business = $db->fetchRow($get_business_info);
assign('business', $business);
//获取商家分类
$get_category = 'select `id`,`name` from ' . $db->table('category') . ' where `business_account`=\'' . $sn . '\' and `parent_id`=' . $business['category_id'];
$category = $db->fetchAll($get_category);
foreach ($category as $key => $c) {
    $get_children = 'select `id`,`name` from ' . $db->table('category') . ' where `parent_id`=' . $c['id'];
    $category[$key]['children'] = $db->fetchAll($get_children);
}
assign('category', $category);
//获取商家全部产品
$now = time();
$get_product_list = 'select `name`,if(`promote_end`>' . $now . ',`promote_price`,`price`) as `price`,`id`,`img` from ' . $db->table('product') . ' where `status`=4 and `business_account`=\'' . $sn . '\'';
$product_list = $db->fetchAll($get_product_list);
assign('product_list', $product_list);
			$(revInput).val( newRev );
		}
	$( document ).ready(function() {

	});
</script>
<div class="panel panel-default">
	<div class="panel-heading"><?php 
echo t('revision');
?>
</div>
	<div class="panel-body">
		<form class="form-inline pull-right" role="form" method="GET" action="">
			<?php 
foreach (getGET(array('rev')) as $key => $value) {
    echo "<input type='hidden' name='" . $key . "' value='" . $value . "'>";
}
?>
			<div class="col-lg-12">
				<div class="form-group">
					<div class="input-group text-center">
					    <span class="input-group-btn">
					    	<button class="btn btn-default btn-sm <?php 
if (1 == getRev(true)) {
    echo 'disabled';
}
?>
" onclick="revNav('-')" type="submit"><span class="glyphicon glyphicon-chevron-left"></span></button>
					    </span>
						<input type="text" class="form-control input-sm rev_input" name="rev" value="<?php 
Beispiel #27
0
<?php

/**
 * 帐号管理
 * @author 王仁欢
 * @email wrh4285@163.com
 * @date 2015-10-26
 * @version 1.0.0
 */
include 'library/init.inc.php';
back_base_init();
$template = 'self/';
assign('subTitle', '帐号管理');
$action = 'view|password';
$operation = 'edit|password';
$act = check_action($action, getGET('act'));
$act = $act == '' ? 'view' : $act;
$opera = check_action($operation, getPOST('opera'));
//======================================================================
if ('edit' == $opera) {
    $response = array('error' => 1, 'msg' => '', 'errmsg' => array());
    $email = trim(getPOST('email'));
    $name = trim(getPOST('name'));
    $mobile = trim(getPOST('mobile'));
    $sex = trim(getPOST('sex'));
    if ('' == $email) {
        $response['errmsg']['email'] = '请输入邮箱地址';
    }
    if ('' == $name) {
        $response['errmsg']['name'] = '请输入邮箱地址';
    }
Beispiel #28
0
        $links = array(array('alt' => '待发货订单列表', 'link' => 'order.php?status=4'));
        show_system_message('确认客户已付款', $links);
        exit;
    } else {
        show_system_message('系统繁忙,请稍后重试', array());
        exit;
    }
}
//预览
if ('preview' == $act) {
    if (!check_purview('pur_order_view', $_SESSION['business_purview'])) {
        echo '权限不足';
        exit;
    }
    $status_str = array(1 => '待支付', 2 => '支付中', 3 => '支付完成', 4 => '待发货', 5 => '配货中', 6 => '已发货', 7 => '已收货', 8 => '申请退单', 9 => '退单中', 10 => '已退单', 11 => '无效订单', 12 => '已完成');
    $order_sn = trim(getGET('sn'));
    if ('' == $order_sn) {
        show_system_message('参数错误', array());
        exit;
    }
    $order_sn = $db->escape($order_sn);
    $get_order = 'select a.*, p.province_name, city.city_name, d.district_name, g.group_name, e.name as express_name from ' . $db->table('order') . ' as a';
    $get_order .= ' left join ' . $db->table('province') . ' as p on a.province = p.id';
    $get_order .= ' left join ' . $db->table('city') . ' as city on a.city = city.id';
    $get_order .= ' left join ' . $db->table('district') . ' as d on a.district = d.id';
    $get_order .= ' left join ' . $db->table('group') . ' as g on a.group = g.id';
    $get_order .= ' left join ' . $db->table('express') . ' as e on a.express_id = e.id';
    $get_order .= ' where `business_account` = \'' . $_SESSION['business_account'] . '\'';
    //    $get_order .= ' and a.is_virtual = 0';    //实体订单
    $get_order .= ' and order_sn = \'' . $order_sn . '\'';
    $get_order .= ' limit 1';
Beispiel #29
0
    if ($db->update($revoke_content)) {
        $links = array(array('alt' => '返回列表', 'link' => 'content.php'), array('alt' => '回收站', 'link' => 'content.php?act=cycle'));
        show_system_message('已撤销删除', $links);
        exit;
    } else {
        show_system_message('系统繁忙,请稍后再试', array());
        exit;
    }
}
//完全删除
if ('remove' == $act) {
    if (!check_purview('pur_content_del', $_SESSION['purview'])) {
        show_system_message('权限不足', array());
        exit;
    }
    $id = intval(getGET('id'));
    if (0 >= $id) {
        show_system_message('参数错误', array());
        exit;
    }
    $id = intval($id);
    $delete_content = 'delete from `' . DB_PREFIX . 'content` where `id`=' . $id . ' limit 1';
    if ($db->delete($delete_content)) {
        $links = array(array('alt' => '返回列表', 'link' => 'content.php'), array('alt' => '回收站', 'link' => 'content.php?act=cycle'));
        show_system_message('已彻底删除', $links);
        exit;
    } else {
        show_system_message('系统繁忙,请稍后再试', array());
        exit;
    }
}
Beispiel #30
0
				$('.rev2').attr("value",$('.rev').val());
			}else{
				$(".rev2").removeAttr('readonly');
			}
		}
	</script>

	<div class="panel-heading"><?php 
echo t('log');
?>
</div>
	<div class="panel-body">

		<form class="" role="form" method="GET" action="">
			<?php 
foreach (getGET(array('rev', 'rev2', 'max', 'mode')) as $key => $value) {
    echo "<input type='hidden' name='" . $key . "' value='" . $value . "'>";
}
?>
			<div class="form-group text-center">
				<div class="btn-group btn-group-justified" data-toggle="buttons">
					<label class="btn btn-default btn-md col-md-6  <?php 
if ($_GET['mode'] == "log" or $_GET['mode'] == null) {
    echo "active";
}
?>
">
						<input class="modeChoice" type="radio" name="mode" value="log" id="log" <?php 
if (@$_GET['mode'] == "log" or @$_GET['mode'] == null) {
    echo "checked";
}