本文整理汇总了PHP中get_gopreview函数的典型用法代码示例。如果您正苦于以下问题:PHP get_gopreview函数的具体用法?PHP get_gopreview怎么用?PHP get_gopreview使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_gopreview函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_login
public function do_login()
{
if (!$_POST) {
app_redirect(APP_ROOT . "/");
}
foreach ($_POST as $k => $v) {
$_POST[$k] = strim($v);
}
$ajax = intval($_REQUEST['ajax']);
require_once APP_ROOT_PATH . "system/libs/user.php";
if (check_ipop_limit(get_client_ip(), "user_dologin", 5)) {
$result = do_login_user($_POST['mobile'], $_POST['user_pwd']);
} else {
showErr("提交太快", $ajax, url_wap("user#login"));
}
if ($result['status']) {
$s_user_info = es_session::get("user_info");
if (intval($_POST['auto_login']) == 1) {
//自动登录,保存cookie
$user_data = $s_user_info;
es_cookie::set("mobile", $user_data['mobile'], 3600 * 24 * 30);
es_cookie::set("user_pwd", md5($user_data['user_pwd'] . "_EASE_COOKIE"), 3600 * 24 * 30);
}
if ($ajax == 0 && trim(app_conf("INTEGRATE_CODE")) == '') {
$redirect = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : url_wap("index");
app_redirect($redirect);
} else {
$jump_url = get_gopreview();
if ($ajax == 1) {
$return['status'] = 1;
$return['info'] = "登录成功";
$return['data'] = $result['msg'];
$return['jump'] = $jump_url;
ajax_return($return);
} else {
$GLOBALS['tmpl']->assign('integrate_result', $result['msg']);
showSuccess("登录成功", $ajax, $jump_url);
}
}
} else {
if ($result['data'] == ACCOUNT_NO_EXIST_ERROR) {
$err = "会员不存在";
}
if ($result['data'] == ACCOUNT_PASSWORD_ERROR) {
$err = "密码错误";
}
if ($result['data'] == ACCOUNT_NO_VERIFY_ERROR) {
$err = "用户未通过验证";
if (app_conf("MAIL_ON") == 1 && $ajax == 0) {
$GLOBALS['tmpl']->assign("page_title", $err);
$GLOBALS['tmpl']->assign("user_info", $result['user']);
$GLOBALS['tmpl']->display("verify_user.html");
exit;
}
}
showErr($err, $ajax);
}
}
示例2: delmessage
public function delmessage()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
app_redirect(url_wap("user#login"));
}
$id = intval($_REQUEST['id']);
$user_id = intval($GLOBALS['user_info']['id']);
$GLOBALS['db']->query("delete from " . DB_PREFIX . "user_message where user_id = " . $user_id . " and id = " . $id);
showSuccess("", $ajax, get_gopreview());
}
示例3: delnotify
public function delnotify()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
showErr("", $ajax, url("user#login"));
}
$id = intval($_REQUEST['id']);
$user_id = intval($GLOBALS['user_info']['id']);
$GLOBALS['db']->query("delete from " . DB_PREFIX . "user_notify where user_id = " . $user_id . " and id = " . $id);
showSuccess("", $ajax, get_gopreview());
}
示例4: go_order_pay
public function go_order_pay()
{
if (!$GLOBALS['user_info']) {
app_redirect(url("user#login"));
}
$id = intval($_REQUEST['order_id']);
$order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id']) . " and order_status = 0");
$paypassword = strim($_REQUEST['paypassword']);
if ($paypassword == '') {
showErr("请输入支付密码", 0);
}
if (md5($paypassword) != $GLOBALS['user_info']['paypassword']) {
showErr("支付密码错误", 0);
}
$is_tg = intval($_REQUEST['is_tg']);
if ($is_tg) {
if (!$GLOBALS['is_user_tg']) {
$jump_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $GLOBALS['user_info']['id'];
showErr("您未绑定第三方接口无法支付,点击确定后跳转到绑定页面", 0, $jump_url);
} elseif ($order_info) {
$sign = md5(md5($paypassword) . $order_info['id']);
$url = APP_ROOT . "/index.php?ctl=collocation&act=RegisterCreditor&order_id=" . $order_info['id'] . "&sign=" . $sign;
//showSuccess("",0,$url);
app_redirect($url);
}
}
if (!$order_info) {
showErr("项目支持已支付", 0, get_gopreview());
} else {
$credit = doubleval($_REQUEST['credit']);
$payment_id = intval($_REQUEST['payment']);
$pay_score = intval($_REQUEST['pay_score']);
$score_trade_number = intval(app_conf("SCORE_TRADE_NUMBER")) > 0 ? intval(app_conf("SCORE_TRADE_NUMBER")) : 0;
$pay_score_money = intval($pay_score / $score_trade_number * 100) / 100;
/*余额支付金额先不扣,只写入订单
if($credit>0)
{
$max_pay = $order_info['total_price'] - $order_info['credit_pay'];
$max_credit= $max_pay<$GLOBALS['user_info']['money']?$max_pay:$GLOBALS['user_info']['money'];
if($max_credit<0){
$max_credit=0;
}
$credit = $credit>$max_credit?$max_credit:$credit;
if($credit>0)
{
require_once APP_ROOT_PATH."system/libs/user.php";
$re=modify_account(array("money"=>"-".$credit),intval($GLOBALS['user_info']['id']),"支持".$order_info['deal_name']."项目支付");
if($re){
$GLOBALS['db']->query("update ".DB_PREFIX."deal_order set credit_pay = credit_pay + ".$credit." where id = ".$order_info['id']);//追加使用余额支付
}
}
}
*/
if (!$is_tg) {
if ($credit > $GLOBALS['user_info']['money']) {
showErr("余额最多只能用" . format_price($GLOBALS['user_info']['money']), 0);
}
if ($pay_score > $GLOBALS['user_info']['score']) {
showErr("积分最多只能用" . $GLOBALS['user_info']['score']);
}
if ($pay_score_money + $credit > $order_info['total_price']) {
showErr("支付超出");
}
}
if ($credit > 0) {
$order_data['credit_pay'] = $credit;
} else {
$order_data['credit_pay'] = 0;
}
if ($pay_score > 0) {
$order_data['score'] = $pay_score;
$order_data['score_money'] = $pay_score_money;
} else {
$order_data['score'] = 0;
$order_data['score_money'] = 0;
}
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set credit_pay = " . $order_data['credit_pay'] . ",score=" . $order_data['score'] . ",score_money=" . $order_data['score_money'] . " where id = " . intval($order_info['id']) . " ");
$result = pay_order($order_info['id']);
if ($result['status'] == 0) {
$money = $result['money'];
$payment_notice['create_time'] = NOW_TIME;
$payment_notice['user_id'] = intval($GLOBALS['user_info']['id']);
$payment_notice['payment_id'] = $payment_id;
$payment_notice['money'] = $money;
$payment_notice['bank_id'] = strim($_REQUEST['bank_id']);
$payment_notice['order_id'] = $order_info['id'];
$payment_notice['memo'] = $order_info['support_memo'];
$payment_notice['deal_id'] = $order_info['deal_id'];
$payment_notice['deal_item_id'] = $order_info['deal_item_id'];
$payment_notice['deal_name'] = $order_info['deal_name'];
do {
$payment_notice['notice_sn'] = to_date(NOW_TIME, "Ymd") . rand(100, 999);
$GLOBALS['db']->autoExecute(DB_PREFIX . "payment_notice", $payment_notice, "INSERT", "", "SILENT");
$notice_id = $GLOBALS['db']->insert_id();
} while ($notice_id == 0);
app_redirect(url("cart#jump", array("id" => $notice_id)));
} else {
app_redirect(url("account#view_order", array("id" => $order_info['id'])));
}
//.........这里部分代码省略.........
示例5: gopreview
public function gopreview()
{
header("Content-Type:text/html; charset=utf-8");
echo get_gopreview();
}
示例6: verify
public function verify()
{
$id = intval($_REQUEST['id']);
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $id);
if (!$user_info) {
showErr($GLOBALS['lang']['NO_THIS_USER']);
}
$verify = addslashes(trim($_REQUEST['code']));
if ($user_info['verify'] != '' && $user_info['verify'] == $verify) {
//成功
es_session::set("user_info", $user_info);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . get_client_ip() . "',login_time= " . get_gmtime() . ",verify = '',is_effect = 1 where id =" . $user_info['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "mail_list set is_effect = 1 where mail_address ='" . $user_info['email'] . "'");
$GLOBALS['db']->query("update " . DB_PREFIX . "mobile_list set is_effect = 1 where mobile ='" . $user_info['mobile'] . "'");
showSuccess($GLOBALS['lang']['VERIFY_SUCCESS'], 0, get_gopreview());
} elseif ($user_info['verify'] == '') {
showErr($GLOBALS['lang']['HAS_VERIFIED'], 0, get_gopreview());
} else {
showErr($GLOBALS['lang']['VERIFY_FAILED'], 0, get_gopreview());
}
}
示例7: app_recirect_preview
function app_recirect_preview()
{
app_redirect(get_gopreview());
}
示例8: do_api_login
public function do_api_login()
{
$api_info = es_session::get("api_user_info");
if (!$api_info) {
app_redirect_preview();
}
if (!$_POST) {
app_redirect(APP_ROOT . "/");
}
foreach ($_POST as $k => $v) {
$_POST[$k] = strim($v);
}
$ajax = intval($_REQUEST['ajax']);
if (!check_ipop_limit(get_client_ip(), "user_do_api_login", 5)) {
showErr("提交太快", $ajax);
}
require_once APP_ROOT_PATH . "system/libs/user.php";
$result = do_login_user($_POST['email'], $_POST['user_pwd']);
if ($result['status']) {
$s_user_info = es_session::get("user_info");
$GLOBALS['db']->query("update " . DB_PREFIX . "user set " . $api_info['field'] . " = '" . $api_info['name'] . "'," . $api_info['token_field'] . " = '" . $api_info['token'] . "'," . $api_info['secret_field'] . " = '" . $api_info['secret'] . "'," . $api_info['url_field'] . " = '" . $api_info['url'] . "' where id = " . $s_user_info['id']);
$GLOBALS['db']->query("delete from " . DB_PREFIX . "user_weibo where user_id = " . intval($s_user_info['id']) . " and weibo_url = '" . $api_info['url'] . "'");
update_user_weibo(intval($s_user_info['id']), $api_info['url']);
if ($ajax == 0 && trim(app_conf("INTEGRATE_CODE")) == '') {
$redirect = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : url("index");
app_redirect($redirect);
} else {
$jump_url = get_gopreview();
if ($ajax == 1) {
$return['status'] = 1;
$return['info'] = "登录成功";
$return['data'] = $result['msg'];
$return['jump'] = $jump_url;
ajax_return($return);
} else {
$GLOBALS['tmpl']->assign('integrate_result', $result['msg']);
showSuccess("登录成功", $ajax, $jump_url);
}
}
} else {
if ($result['data'] == ACCOUNT_NO_EXIST_ERROR) {
$err = "会员不存在";
}
if ($result['data'] == ACCOUNT_PASSWORD_ERROR) {
$err = "密码错误";
}
showErr($err, $ajax);
}
}
示例9: submitrefund
public function submitrefund()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
showErr("", $ajax, url("user#login"));
}
$money = doubleval($_REQUEST['money']);
$memo = strim($_REQUEST['memo']);
if ($money <= 0) {
showErr("提现金额出错", $ajax);
}
$ready_refund_money = doubleval($GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "user_refund where user_id = " . intval($GLOBALS['user_info']['id']) . " and is_pay = 0"));
if ($ready_refund_money + $money > $GLOBALS['user_info']['money']) {
showErr("提现超出限制", $ajax);
}
$refund_data['money'] = $money;
$refund_data['user_id'] = $GLOBALS['user_info']['id'];
$refund_data['create_time'] = NOW_TIME;
$refund_data['memo'] = $memo;
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_refund", $refund_data);
showSuccess("", $ajax, get_gopreview());
}
示例10: callback
public function callback()
{
require_once APP_ROOT_PATH . 'system/api_login/sina/saetv2.ex.class.php';
es_session::start();
//$sina_keys = es_session::get("sina_keys");
$o = new SaeTOAuthV2($this->api['config']['app_key'], $this->api['config']['app_secret']);
if (isset($_REQUEST['code'])) {
$keys = array();
$keys['code'] = $_REQUEST['code'];
if ($this->api['config']['app_url'] == "") {
$app_url = SITE_DOMAIN . APP_ROOT . "/api_callback.php?c=Sina";
} else {
$app_url = $this->api['config']['app_url'];
}
$keys['redirect_uri'] = $app_url;
try {
$token = $o->getAccessToken('code', $keys);
} catch (OAuthException $e) {
//print_r($e);exit;
showErr("授权失败,错误信息:" . $e->getMessage());
die;
}
}
$c = new SaeTClientV2($this->api['config']['app_key'], $this->api['config']['app_secret'], $token['access_token']);
$ms = $c->home_timeline();
// done
$uid_get = $c->get_uid();
$uid = $uid_get['uid'];
$msg = $c->show_user_by_id($uid);
//根据ID获取用户等基本信息
if (intval($msg['error_code']) != 0) {
showErr("授权失败,错误代码:" . $msg['error_code']);
die;
}
$msg['field'] = 'sina_id';
$msg['sina_token'] = $token['access_token'];
es_session::set("api_user_info", $msg);
if (!$msg['name']) {
app_redirect(url("index"));
exit;
}
$user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where sina_id = '" . $msg['id'] . "' and sina_id <> 0");
//print_r($user_data);die();
if ($user_data) {
$user_current_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id = " . intval($user_data['group_id']));
$user_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where score <=" . intval($user_data['score']) . " order by score desc");
if ($user_current_group['score'] < $user_group['score']) {
$user_data['group_id'] = intval($user_group['id']);
}
$GLOBALS['db']->query("update " . DB_PREFIX . "user set sina_token = '" . $token['access_token'] . "',login_ip = '" . get_client_ip() . "',login_time= " . get_gmtime() . ",group_id=" . intval($user_data['group_id']) . " where id =" . $user_data['id']);
es_session::delete("api_user_info");
$is_bind = intval(es_session::get("is_bind"));
if ($is_bind) {
if (intval($user_data['id']) != intval($GLOBALS['user_info']['id'])) {
showErr("该帐号已经被别的会员绑定过,请直接用帐号登录", 0, url("shop", "uc_center#setweibo"));
} else {
es_session::set("user_info", $user_data);
app_redirect(url("index", "uc_center#setweibo"));
}
} else {
require_once APP_ROOT_PATH . "system/libs/user.php";
auto_do_login_user($user_data['user_name'], md5($user_data['user_pwd'] . "_EASE_COOKIE"), $from_cookie = false);
app_recirect_preview();
}
} elseif ($is_bind == 1 && $GLOBALS['user_info']) {
//当有用户身份且要求绑定时
$GLOBALS['db']->query("update " . DB_PREFIX . "user set sina_id= '" . intval($msg['id']) . "', sina_token ='" . $token['access_token'] . "' where id =" . $GLOBALS['user_info']['id']);
app_redirect(url("index", "uc_center#setweibo"));
} else {
$this->create_user();
app_redirect(get_gopreview());
}
}
示例11: bidverify
public function bidverify()
{
$user_info = $GLOBALS['user_info'];
if (!$user_info) {
showErr($GLOBALS['lang']['NO_THIS_USER']);
}
$verify = addslashes(trim($_REQUEST['code']));
if ($user_info['verify'] != '' && $user_info['verify'] == $verify) {
//成功
es_session::set("user_info", $user_info);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . get_client_ip() . "',login_time= " . TIME_UTC . ",verify = '',emailpassed = 1,email=tmp_email,is_effect = 1 where id =" . $user_info['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "mail_list set is_effect = 1,mail_address='" . $user_info['tmp_email'] . "' where mail_address ='" . $user_info['email'] . "'");
$GLOBALS['db']->query("update " . DB_PREFIX . "user set tmp_email = '' where id =" . $user_info['id']);
showSuccess($GLOBALS['lang']['VERIFY_SUCCESS'], 0, get_gopreview());
} elseif ($user_info['verify'] == '') {
showErr($GLOBALS['lang']['HAS_VERIFIED'], 1);
} else {
showErr($GLOBALS['lang']['VERIFY_FAILED'], 1);
}
}
示例12: showSuccess
function showSuccess($msg, $ajax = 0, $jump = '', $stay = 0)
{
if ($ajax == 1) {
$result['status'] = 1;
$result['info'] = $msg;
$result['jump'] = $jump;
ajax_return($result);
} else {
$GLOBALS['tmpl']->assign('page_title', $GLOBALS['lang']['SUCCESS_TITLE']);
$GLOBALS['tmpl']->assign('msg', $msg);
if ($jump == '') {
$jump = get_gopreview();
}
$GLOBALS['tmpl']->assign('jump', $jump);
$GLOBALS['tmpl']->assign("stay", $stay);
$GLOBALS['tmpl']->display("msg_page.html");
exit;
}
}
示例13: save_consignee
public function save_consignee()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
showErr("", $ajax, url("user#login"));
}
if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_consignee where user_id = " . intval($GLOBALS['user_info']['id'])) > 10) {
showErr("每个会员只能预设10个配送地址", $ajax, "");
}
$id = intval($_REQUEST['id']);
$consignee = strim($_REQUEST['consignee']);
$province = strim($_REQUEST['province']);
$city = strim($_REQUEST['city']);
$address = strim($_REQUEST['address']);
$zip = strim($_REQUEST['zip']);
$mobile = strim($_REQUEST['mobile']);
if ($consignee == "") {
showErr("请填写收货人姓名", $ajax, "");
}
if ($province == "") {
showErr("请选择省份", $ajax, "");
}
if ($city == "") {
showErr("请选择城市", $ajax, "");
}
if ($address == "") {
showErr("请填写详细地址", $ajax, "");
}
if (!check_postcode($zip)) {
showErr("请填写正确的邮编", $ajax, "");
}
if ($mobile == "") {
showErr("请填写收货人手机号码", $ajax, "");
}
if (!check_mobile($mobile)) {
showErr("请填写正确的手机号码", $ajax, "");
}
$data = array();
$data['consignee'] = $consignee;
$data['province'] = $province;
$data['city'] = $city;
$data['address'] = $address;
$data['zip'] = $zip;
$data['mobile'] = $mobile;
$data['user_id'] = intval($GLOBALS['user_info']['id']);
if (!check_ipop_limit(get_client_ip(), "setting_save_consignee", 5)) {
showErr("提交太频繁", $ajax, "");
}
if ($id > 0) {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $data, "UPDATE", "id=" . $id);
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $data);
}
showSuccess("保存成功", $ajax, get_gopreview());
//$res = save_user($user_data);
}
示例14: domodifypassword
public function domodifypassword()
{
$id = intval($_REQUEST['id']);
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $id);
if (!$user_info) {
showErr($GLOBALS['lang']['NO_THIS_USER'], 1);
}
$verify = strim($_REQUEST['code']);
if ($user_info['password_verify'] == $verify && $user_info['password_verify'] != '') {
if (strim($_REQUEST['user_pwd']) != strim($_REQUEST['user_pwd_confirm'])) {
$data['status'] = false;
$data['info'] = $GLOBALS['lang']['PASSWORD_VERIFY_FAILED'];
$data['field'] = "user_pwd_confirm";
ajax_return($data);
} else {
$password = strim($_REQUEST['user_pwd']);
$user_info['user_pwd'] = $password;
$password = md5($password . $user_info['code']);
$result = 1;
//初始为1
//载入会员整合
$integrate_code = trim(app_conf("INTEGRATE_CODE"));
if ($integrate_code != '') {
$integrate_file = APP_ROOT_PATH . "system/integrate/" . $integrate_code . "_integrate.php";
if (file_exists($integrate_file)) {
require_once $integrate_file;
$integrate_class = $integrate_code . "_integrate";
$integrate_obj = new $integrate_class();
}
}
if ($integrate_obj) {
$result = $integrate_obj->edit_user($user_info, $user_info['user_pwd']);
}
if ($result > 0) {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set user_pwd = '" . $password . "',password_verify='' where id = " . $user_info['id']);
showSuccess($GLOBALS['lang']['NEW_PWD_SET_SUCCESS'], 1, get_gopreview());
} else {
showErr($GLOBALS['lang']['NEW_PWD_SET_FAILED'], 1);
}
}
} else {
showErr($GLOBALS['lang']['VERIFY_FAILED'], 1);
}
}
示例15: del_consignee
public function del_consignee()
{
if (!$GLOBALS['user_info']) {
$data['html'] = $GLOBALS['tmpl']->display("inc/user_login_box.html", "", true);
$data['status'] = 1;
ajax_return($data);
} else {
$id = intval($_REQUEST['id']);
$GLOBALS['db']->query("delete from " . DB_PREFIX . "user_consignee where id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id']));
showSuccess("", 1, get_gopreview());
}
}