} $v = join('<br/>', $v); $d = array('html' => $v, 'id' => 'coupon-dialog-display-id'); json($d, 'updater'); } else { if ($action == 'sms') { $coupon = Table::Fetch('coupon', $sid); if ($coupon['sms'] >= 5 && !is_manager()) { json('短信发送' . $INI['system']['couponname'] . '最多5次, 如有任何疑问请联系客服!', 'alert'); } $interval = abs(intval($INI['sms']['interval'])); $lefttime = $interval + $coupon['sms_time'] - time(); if (!is_manager() && $lefttime > 0) { json("你好,请在{$lefttime}秒后,再次尝试短信发送优惠券" . $INI['system']['couponname'], 'alert'); } if (!$coupon || !is_login() || $coupon['user_id'] != ZLogin::GetLoginId() && !is_manager()) { json($cid, 'alert'); } $flag = sms_coupon($coupon); if ($flag === true) { json('手机短信发送成功,请及时查收', 'alert'); } else { if (is_string($flag)) { json($flag, 'alert'); } } json("手机短信发送失败,错误码:{$code}", 'alert'); } } } }
$_POST = magic_gpc($_POST); $_COOKIE = magic_gpc($_COOKIE); /* process currefer*/ $currefer = uencode(strval($_SERVER['REQUEST_URI'])); /* session,cache,configure,webroot register */ Session::Init(); $INI = ZSystem::GetINI(); /* end */ /* date_zone */ if (function_exists('date_default_timezone_set')) { date_default_timezone_set($INI['system']['timezone']); } /* end date_zone */ /* biz logic */ $currency = $INI['system']['currency']; $login_user_id = ZLogin::GetLoginId(); $login_user = Table::Fetch('user', $login_user_id); $hotcities = option_hotcategory('city', false, true); $allcities = option_category('city', false, true); $city = cookie_city(null); if (!isset($_COOKIE['referer'])) { setcookie('referer', $_SERVER['HTTP_REFERER']); } /* not allow access app.php */ if ($_SERVER['SCRIPT_FILENAME'] == __FILE__) { redirect(WEB_ROOT . '/index.php'); } /* end */ $AJAX = 'XMLHttpRequest' == @$_SERVER['HTTP_X_REQUESTED_WITH']; if (false == $AJAX) { header('Content-Type: text/html; charset=UTF-8');
json($flag, 'alert'); } } json("手机短信发送失败,错误码:{$code}", 'alert'); } else { if ($action == 'vouchersms') { $voucher = Table::Fetch('voucher', $cid); if ($voucher['sms'] >= 5 && !is_manager()) { json('短信发送商户券最多5次', 'alert'); } $interval = abs(intval($INI['sms']['interval'])); $lefttime = $interval + $voucher['sms_time'] - time(); if (!is_manager() && $lefttime > 0) { json("你好,请在{$lefttime}秒后,再次尝试短信发送商户券", 'alert'); } if (!$voucher || !is_login() || $voucher['user_id'] != ZLogin::GetLoginId() && !is_manager()) { json('非法下载', 'alert'); } $flag = sms_voucher($voucher); if ($flag === true) { json('手机短信发送成功,请及时查收', 'alert'); } else { if (is_string($flag)) { json($flag, 'alert'); } } json("手机短信发送失败,错误码:{$code}", 'alert'); } } } }