if ($_GET['t_effective'] != "") { $t_effective = intval($_GET['t_effective']); $wheresql = empty($wheresql) ? " WHERE t.t_effective= " . $t_effective : $wheresql . " AND t.t_effective= " . $t_effective; } $t_id = isset($_GET['t_id']) ? intval($_GET['t_id']) : ""; if ($t_id > 0) { $wheresql = empty($wheresql) ? " WHERE t.t_id= " . $t_id : $wheresql . " AND t.t_id= " . $t_id; } } $joinsql = " LEFT JOIN " . table('gifts_type') . " AS t ON g.t_id=t.t_id "; $total_sql = "SELECT COUNT(*) AS num FROM " . table('gifts') . " AS g " . $joinsql . $wheresql; $total = $db->get_total($total_sql); $page = new page(array('total' => $total, 'perpage' => $perpage)); $currenpage = $page->nowindex; $offset = ($currenpage - 1) * $perpage; $list = get_gifts($offset, $perpage, $joinsql . $wheresql . $oederbysql); $smarty->assign('category', get_gifts_category()); $smarty->assign('list', $list); $smarty->assign('total', $total); $smarty->assign('page', $page->show(3)); $smarty->assign('navlabel', "list"); $smarty->display('gifts/admin_gifts_list.htm'); } elseif ($act == 'generate') { get_token(); $category = get_gifts_category(); if (empty($category)) { $link[0]['text'] = "查看分类"; $link[0]['href'] = '?act=category'; adminmsg("礼品卡分类不存在,不能生成礼品卡,请增加礼品卡分类", 1, $link); } $smarty->assign('navlabel', "generate");
} header("Location:?act=payment&order_id=" . $order_id . ""); //付款页面 } else { showmsg("添加订单失败!", 0); } } else { showmsg("添加订单失败!", 0); } } elseif ($act == 'feedback') { $smarty->assign('title', '用户反馈 - 企业会员中心 - ' . $_CFG['site_name']); $smarty->assign('feedback', get_feedback($_SESSION['uid'])); $smarty->display('member_company/company_feedback.htm'); } elseif ($act == 'gifts') { $smarty->assign('title', '礼品卡 - 企业会员中心 - ' . $_CFG['site_name']); $smarty->assign('gifts', get_gifts($_SESSION['uid'])); $captcha = get_cache('captcha'); $smarty->assign('verify_gifts', $captcha['verify_gifts']); $smarty->display('member_company/company_gifts.htm'); } elseif ($act == 'gifts_apy') { $account = trim($_POST['account']) ? trim($_POST['account']) : showmsg("请填写卡号!", 1); $pwd = trim($_POST['pwd']) ? trim($_POST['pwd']) : showmsg("请填写密码!", 1); $captcha = get_cache('captcha'); $postcaptcha = trim($_POST['postcaptcha']); if ($captcha['verify_gifts'] == '1' && empty($postcaptcha)) { showmsg("请填写验证码", 1); } if ($captcha['verify_gifts'] == '1' && strcasecmp($_SESSION['imageCaptcha_content'], $postcaptcha) != 0) { showmsg("验证码错误", 1); } $info = $db->getone("select * from " . table('gifts') . " where account='{$account}' AND password='******' LIMIT 1 ");