function action_bonus() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $_SESSION['user_id']; include_once ROOT_PATH . 'includes/lib_transaction.php'; $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1; $suppid = isset($_REQUEST['suppid']) ? intval($_REQUEST['suppid']) : -1; $sql = "SELECT ub.supplier_id, ifnull( ssc.value, '网站自营' ) as suppname\r\n\t\t\tFROM " . $ecs->table('user_bonus') . " AS ub\r\n\t\t\tLEFT JOIN " . $ecs->table('supplier_shop_config') . " AS ssc ON ub.supplier_id = ssc.supplier_id\r\n\t\t\tAND ssc.code = 'shop_name'\r\n\t\t\tWHERE ub.user_id =" . $user_id . " \r\n\t\t\tGROUP BY ub.supplier_id"; $suppinfo = $db->getAll($sql); $where_suppid = ''; if ($suppid > -1) { $where_suppid = " AND supplier_id=" . $suppid; } $smarty->assign('suppinfo', $suppinfo); $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('user_bonus') . " WHERE user_id = '{$user_id}'" . $where_suppid); $pager = get_pager('user.php', array('act' => $action, 'suppid' => $suppid), $record_count, $page, 16); $bonus = get_user_bouns_list($user_id, $pager['size'], $pager['start'], $suppid); $smarty->assign('pager', $pager); $smarty->assign('bonus', $bonus); $smarty->display('user_transaction.dwt'); }
exit; } elseif ($action == 'save_order_address') { include_once ROOT_PATH . 'includes/lib_transaction.php'; $address = array('consignee' => isset($_POST['consignee']) ? trim($_POST['consignee']) : '', 'email' => isset($_POST['email']) ? trim($_POST['email']) : '', 'address' => isset($_POST['address']) ? trim($_POST['address']) : '', 'zipcode' => isset($_POST['zipcode']) ? make_semiangle(trim($_POST['zipcode'])) : '', 'tel' => isset($_POST['tel']) ? trim($_POST['tel']) : '', 'mobile' => isset($_POST['mobile']) ? trim($_POST['mobile']) : '', 'sign_building' => isset($_POST['sign_building']) ? trim($_POST['sign_building']) : '', 'best_time' => isset($_POST['best_time']) ? trim($_POST['best_time']) : '', 'order_id' => isset($_POST['order_id']) ? intval($_POST['order_id']) : 0); if (save_order_address($address, $user_id)) { ecs_header('Location: user.php?act=order_detail&order_id=' . $address['order_id'] . "\n"); exit; } else { $err->show($_LANG['order_list_lnk'], 'user.php?act=order_list'); } } elseif ($action == 'bonus') { include_once ROOT_PATH . 'includes/lib_transaction.php'; $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1; $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('user_bonus') . " WHERE user_id = '{$user_id}'"); $pager = get_pager('user.php', array('act' => $action), $record_count, $page); $bonus = get_user_bouns_list($user_id, $pager['size'], $pager['start']); $smarty->assign('pager', $pager); $smarty->assign('bonus', $bonus); $smarty->display('user_transaction.dwt'); } elseif ($action == 'group_buy') { include_once ROOT_PATH . 'includes/lib_transaction.php'; //待议 $smarty->display('user_transaction.dwt'); } elseif ($action == 'group_buy_detail') { include_once ROOT_PATH . 'includes/lib_transaction.php'; //待议 $smarty->display('user_transaction.dwt'); } elseif ($action == 'affiliate') { $goodsid = intval(isset($_REQUEST['goodsid']) ? $_REQUEST['goodsid'] : 0); if (empty($goodsid)) { //我的推荐页面
function action_bonus() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $GLOBALS['user_id']; include_once ROOT_PATH . 'includes/lib_transaction.php'; $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1; $record_count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('user_bonus') . " WHERE user_id = '{$user_id}'"); $pager = get_pager('user.php', array('act' => $action), $record_count, $page); $bonus = get_user_bouns_list($user_id, $pager['size'], $pager['start']); $smarty->assign('pager', $pager); $smarty->assign('bonus', $bonus); $smarty->display('user_transaction.dwt'); }