本文整理汇总了PHP中Utility::IsMobile方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::IsMobile方法的具体用法?PHP Utility::IsMobile怎么用?PHP Utility::IsMobile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::IsMobile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sms_coupon
function sms_coupon($coupon, $mobile = null)
{
global $INI;
if ($coupon['consume'] == 'Y' || $coupon['expire_time'] < strtotime(date('Y-m-d'))) {
return $INI['system']['couponname'] . '已失效';
}
$user = Table::Fetch('user', $coupon['user_id']);
$order = Table::Fetch('order', $coupon['order_id']);
if (!Utility::IsMobile($mobile)) {
$mobile = $order['mobile'];
if (!Utility::IsMobile($mobile)) {
$mobile = $user['mobile'];
}
}
if (!Utility::IsMobile($mobile)) {
return '请设置合法的手机号码,以便接受短信';
}
$team = Table::Fetch('team', $coupon['team_id']);
$partner = Table::Fetch('partner', $coupon['partner_id']);
$coupon['end'] = date('Y-n-j', $coupon['expire_time']);
$coupon['name'] = $team['product'];
$content = render('manage_tpl_smscoupon', array('partner' => $partner, 'coupon' => $coupon, 'user' => $user));
if (true === ($code = sms_send($mobile, $content))) {
Table::UpdateCache('coupon', $coupon['id'], array('sms' => array('`sms` + 1'), 'sms_time' => time()));
return true;
}
return $code;
}
示例2: Create
public static function Create($mobile, $user_id, $secret = null, $enable = false)
{
if (!Utility::IsMobile($mobile, true)) {
return;
}
$secret = $secret ? $secret : Utility::VerifyCode();
$table = new Table('toolsbind', array('user_id' => $user_id, 'tools' => $mobile, 'enable' => $enable ? 'Y' : 'N', 'secret' => $secret));
$condition = array('user_id' => $user_id, 'tools' => $mobile, 'enable' => 'N');
$haveone = DB::GetTableRow('toolsbind', $condition);
if ($haveone) {
return Table::UpdateCache('toolsbind', $haveone['id'], array('secret' => $secret, 'enable' => 'N'));
}
//已经绑定了本号码
$loginbind = array('user_id' => $user_id, 'tools' => $mobile, 'enable' => 'Y');
$havebind = DB::GetTableRow('toolsbind', $loginbind);
if ($havebind) {
return false;
}
//$table->insert(array( 'user_id', 'tools','secret', 'enable'));
DB::Insert('toolsbind', array('user_id' => $user_id, 'tools' => $mobile, 'secret' => $secret, 'enable' => 'N', 'create_time' => time()));
$have = Table::Fetch('toolsbind', $mobile, 'tools');
if ($have && 'Y' == $have['enable']) {
return true;
}
}
示例3: Create
public static function Create($mobile, $city_id, $secret = null, $enable = false)
{
if (!Utility::IsMobile($mobile, true)) {
return;
}
$secret = $secret ? $secret : Utility::VerifyCode();
$have = Table::Fetch('smssubscribe', $mobile, 'mobile');
if ($have && $have['city_id'] == $city_id && 'Y' == $have['enable']) {
return true;
}
$table = new Table('smssubscribe', array('mobile' => $mobile, 'enable' => $enable ? 'Y' : 'N', 'city_id' => $city_id, 'secret' => $secret));
Table::Delete('smssubscribe', $mobile, 'mobile');
return $table->insert(array('mobile', 'city_id', 'secret', 'enable'));
}
示例4: sms_coupon
function sms_coupon($coupon)
{
global $INI;
$coupon_user = Table::Fetch('user', $coupon['user_id']);
if ($coupon['consume'] == 'Y' || $coupon['expire_time'] < strtotime(date('Y-m-d'))) {
return $INI['system']['couponname'] . '已失效';
} else {
if (!Utility::IsMobile($coupon_user['mobile'])) {
return '请设置合法的手机号码,以便接受短信';
}
}
$team = Table::Fetch('team', $coupon['team_id']);
$user = Table::Fetch('user', $coupon['user_id']);
$coupon['end'] = date('Y-n-j', $coupon['expire_time']);
$coupon['name'] = $team['product'];
$content = render('manage_tpl_smscoupon', array('coupon' => $coupon, 'user' => $user));
$content = trim(preg_replace("/[\\s]+/", '', $content));
if (true === ($code = sms_send($coupon_user['mobile'], $content))) {
Table::UpdateCache('coupon', $coupon['id'], array('sms' => array('`sms` + 1')));
return true;
}
return $code;
}
示例5: sms_send_smsbao
function sms_send_smsbao($mobile, $content, $account)
{
if (empty($content)) {
return '短信内容不能为空';
}
if (!Utility::IsMobile($mobile)) {
return 'Bad mobile';
}
$content = Utility::SmsContent($content);
$smsapi = smsbao_api_url();
//短信网关
$charset = "utf8";
//文件编码
$user = $account["sms_user"];
$pass = $account["sms_pass"];
$pass = md5($pass);
/*去掉这块 - IE有bug*/
// if (function_exists('curl_exec') == 1)
// {
// $sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$mobile}&c=".urlencode($content);
// $result = Utility::HttpRequest($sendurl);
// } else {
$snoopy = new snoopy();
$sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$mobile}&c=" . urlencode($content);
$snoopy->fetch($sendurl);
$result = $snoopy->results;
// }
if (trim(strval($result)) == '') {
$result = '-2';
}
$code = intval(trim($result));
if ($code === 0) {
return true;
} else {
return smsbao_status($code);
}
}
示例6: htmlspecialchars
<div class="sect" style="padding:0 10px;">
<form method="get">
<p style="margin:5px 0;">用户:<input type="text" name="uemail" class="h-input" value="<?php echo htmlspecialchars($uemail); ?>" > 管理员ID:<input type="text" name="adminemail" class="h-input" value="<?php echo htmlspecialchars($adminemail); ?>" style="width:50px;" > 管理员真名:<input type="text" name="adminname" class="h-input" value="<?php echo htmlspecialchars($adminname); ?>" style="width:50px;" > <select name="withdraw_direction"><?php echo Utility::Option($option_withdraw_direction, $withdraw_direction, '提现方式'); ?></select> <select name="status"><?php echo Utility::Option($option_status, $status, '申请状态'); ?></select> 内容:<input type="text" name="content" class="h-input" value="<?php echo htmlspecialchars($content); ?>" ></p>
<p style="margin:5px 0;">申请日期:<input type="text" class="h-input" onFocus="WdatePicker({isShowClear:true})" name="cbday" value="<?php echo $cbday; ?>" /> - <input type="text" class="h-input" onFocus="WdatePicker({isShowClear:true})" name="ceday" value="<?php echo $ceday; ?>" /> 操作日期:<input type="text" class="h-input" onFocus="WdatePicker({isShowClear:true})" name="dbday" value="<?php echo $dbday; ?>" /> - <input type="text" class="h-input" onFocus="WdatePicker({isShowClear:true})" name="deday" value="<?php echo $deday; ?>" /> <input type="submit" value="筛选" class="formbutton" style="padding:1px 6px;"/></p>
</form>
</div>
<div class="sect">
<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
<tr><td colspan="10"><?php echo $pagestring; ?></tr>
<tr><th width="50">ID</th><th width="200">申请用户</th><th width="80">用户余额</th><th width="80">申请金额</th><th width="100" nowrap>申请时间</th><th width="100" nowrap>提现方式</th><th width="100" nowrap>实际支付</th><th width="50" nowrap>操作</th></tr>
<?php if(is_array($applys)){foreach($applys AS $index=>$one) { ?>
<tr <?php echo $index%2?'':'class="alt"'; ?> id="dialog-apply-id" aid="<?php echo $one['id']; ?>">
<td><?php echo $one['id']; ?></td>
<td><a href="/ajax/manage.php?action=userview&id=<?php echo $one['user_id']; ?>" class="ajaxlink"><?php echo $users[$one['user_id']]['email']; ?><br/><?php echo $users[$one['user_id']]['username']; ?></a><?php if(Utility::IsMobile($users[$one['user_id']]['mobile'])){?> » <a href="/ajax/misc.php?action=sms&v=<?php echo $users[$one['user_id']]['mobile']; ?>" class="ajaxlink">短信</a><?php }?>
</td>
<td><?php echo moneyit($users[$one['user_id']]['money']); ?></td>
<?php if($one['status']=='ask'){?><td style="color:#FF0000">- <?php echo moneyit($one['money']); ?></td><?php } else { ?><td>- <?php echo moneyit($one['money']); ?></td><?php }?>
<td nowrap><?php echo date('Y-m-d H:i', $one['create_time']); ?></td>
<td nowrap><?php echo $one['withdraw_direction']; ?></td>
<td nowrap><?php echo $one['withdrawpay']; ?></td>
<td class="op" nowrap><!--<input type="text" class="h-input" id="dialog-withdraw-content" name="content" value="<?php echo $one['content']; ?>" /><br /><input type="submit" value="审核通过" onclick="return X.manage.be();"/> <input type="submit" value="拒绝提现" onclick="return X.manage.no();"/>-->
<?php if($one['status']=='ask'){?>
<!--<a href="/ajax/apply.php?action=withdraw_be&id=<?php echo $one['id']; ?>" class="ajaxlink">审核通过</a>--><a href="/ajax/apply.php?action=withdraw_do&id=<?php echo $one['id']; ?>" class="ajaxlink" style="font-weight:bold; color:#FF0000;">处理</a> |
<a href="/ajax/apply.php?action=withdraw_no&id=<?php echo $one['id']; ?>" class="ajaxlink">拒绝提现</a><br /><a href="/ajax/apply.php?action=apply_cancel_admin&id=<?php echo $one['id']; ?>" class="ajaxlink">代客取消</a> |
<?php } else if($one['status']=='no') { ?><font color="#FF0000">拒绝提现</font> By:<?php echo $one['admin_name']; ?><br /><?php echo date('Y-m-d H:i', $one['done_time']); ?>
<?php } else if($one['status']=='cancel') { ?>取消提现 By:<?php echo $one['admin_name']; ?><br /><?php echo date('Y-m-d H:i', $one['done_time']); ?>
<?php } else if($one['status']=='be') { ?>审核通过 By:<?php echo $one['admin_name']; ?>(<?php echo $one['admin_id']; ?>)<br /><?php echo date('Y-m-d H:i', $one['done_time']); ?>
<?php }?> <a href="/ajax/apply.php?action=withdraw_view&id=<?php echo $one['id']; ?>" class="ajaxlink">详情</a></td>
示例7: new_feedback
public function new_feedback()
{
$last = M('Feedbacks')->order('id desc')->getBySourceIp(Utility::GetRemoteIp());
if (time() - $last['create_time'] < 10) {
return json("send_enquiry_callback(0, '发的太快了,等10秒再发')", 'eval');
}
$data['user_email'] = $this->_param("email");
$data['user_phone'] = $this->_param("phone");
if (!Utility::ValidEmail($data['user_email'])) {
return json("send_enquiry_callback(0, '邮箱格式有误')", 'eval');
}
if (!Utility::IsMobile($data['user_phone'])) {
return json("send_enquiry_callback(0, '手机格式有误')", 'eval');
}
if (!Utility::CaptchaCheck($this->_param('verify'))) {
return json("send_enquiry_callback(0, '验证码有误')", 'eval');
}
$data['user_name'] = $this->_param("name");
$data['title'] = $this->_param("title");
$data['message'] = $this->_param("message");
$data['create_time'] = time();
$data['source_ip'] = Utility::GetRemoteIp();
$data['source_url'] = $_SERVER['HTTP_REFERER'];
$new_id = M("Feedbacks")->saveOrUpdate($data);
return json("send_enquiry_callback(1, '发送成功! 非常感谢您的留言!')", 'eval');
}
示例8: intval
'user_id' => $login_user_id,
'team_id' => $team['id'],
'state' => 'pay',
), 'quantity');
$leftnum = ($team['per_number'] - $now_count);
if ($leftnum <= 0) {
Session::Set('error', '您购买本单产品的数量已经达到上限,快去关注一下其他产品吧!');
redirect( WEB_ROOT . "/team.php?id={$id}");
}
}
//payed order
if ( $order['state'] == 'pay' ) {
if ( is_get() ) {
$user = Table::Fetch('user', $login_user['id'], 'id');
if ($INI['sms']['buy']=='1' && Utility::IsMobile($user['mobile'])) {
@session_start();
$last_order_id = intval($_SESSION['last_order_id']);
if($last_order_id != $order_id){
$content = $INI['system']['sitename']." 团购项目:".$team['product']." 支付成功,感谢您的购买。";
$ret = sms_send($user['mobile'], $content);
$_SESSION['last_order_id'] = $order_id;
}
}
die(include template('order_pay_success'));
} else {
redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
}
}
示例9: team_origin
if ($table->id) {
$eorder = Table::Fetch('order', $table->id);
if ($eorder['state'] == 'unpay' && $eorder['team_id'] == $id && $eorder['user_id'] == $login_user_id) {
$table->origin = team_origin($team, $table->quantity, $express_price);
$table->origin -= $eorder['card'];
} else {
$eorder = null;
}
}
if (!$eorder) {
$table->pk_value = '';
$table->create_time = time();
$table->origin = team_origin($team, $table->quantity, $express_price);
}
if ($team['delivery'] == 'express') {
if (!$table->address || !Utility::IsMobile($table->mobile) || !$table->zipcode || !$table->realname) {
Session::Set('error', '购买选项填写不完整');
Session::Set('loginpagepost', json_encode($_POST));
redirect("buy.php?id={$team['id']}");
}
}
$insert = array('user_id', 'team_id', 'city_id', 'state', 'express_id', 'fare', 'express', 'origin', 'price', 'address', 'zipcode', 'realname', 'mobile', 'quantity', 'create_time', 'remark');
if ($flag = $table->update($insert)) {
$order_id = abs(intval($table->id));
/* 插入订单来源 */
$data['order_id'] = $order_id;
$data['user_id'] = $login_user_id;
$data['referer'] = $_COOKIE['referer'];
$data['create_time'] = time();
DB::Insert('referer', $data);
redirect("pay.php?id={$order_id}");
示例10: htmlspecialchars
<div class="head">
<h2>意见反馈及商务合作</h2>
<ul class="filter">
<li><form action="/manage/misc/feedback.php" method="get"><input type="text" name="like" value="<?php echo htmlspecialchars($like); ?>" class="h-input" /> <select name="cate"><?php echo Utility::Option($feedcate, $cate, '所有分类'); ?></select> <input type="submit" value="筛选" class="formbutton" style="padding:1px 6px;"/><form></li>
</ul>
</div>
<div class="sect">
<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
<tr><th width="200">客户</th><th width="370" align="center">内容</th><th width="80">状态</th><th width="80">日期</th><th width="100">操作</th></tr>
<?php if(is_array($asks)){foreach($asks AS $index=>$one) { ?>
<tr <?php echo $index%2?'':'class="alt"'; ?> id="team-list-id-<?php echo $one['id']; ?>">
<td><p style="width:250px;overflow: hidden; height:20px;"><strong>项目类别:</strong><?php echo $feedcate[$one['category']]; ?><?php if($one['hzlx']){?> <span style="color:#F00">(<?php echo htmlspecialchars($one['hzlx']); ?>)</span><?php }?></p>
<?php if($one['tgsjmc']){?>
<p style="width:250px;overflow: hidden; height:20px;"><strong>商家名称:</strong><span style="color:#F00"><?php echo htmlspecialchars($one['tgsjmc']); ?></span></p><?php }?>
<p style="width:250px;overflow: hidden; height:20px;"><strong>联 系 人:</strong><?php echo htmlspecialchars($one['title']); ?></p><?php if($one['sjhm']){?>
<p style="width:250px;overflow: hidden; height:20px;"><strong>联系电话:</strong><?php echo htmlspecialchars($one['sjhm']); ?><?php if(Utility::IsMobile($one['sjhm'])){?> <a href="/ajax/misc.php?action=sms&v=<?php echo $one['sjhm']; ?>" class="ajaxlink">短信</a><?php }?></p><?php }?>
<p style="width:250px;overflow: hidden; height:20px;"><strong>其他联系:</strong><?php echo htmlspecialchars($one['contact']); ?></p></td>
<td width="370" align="center" nowrap><?php echo htmlspecialchars($one['content']); ?></td>
<td width="80" nowrap><p style="width:20px;overflow: hidden; height:20px;"><?php echo $one['user_id']?$users[$one['user_id']]['username']:''; ?></p>
</td>
<td nowrap><?php echo date('Y-n-j',$one['create_time']); ?></td>
<td class="op" nowrap><a href="/manage/misc/feedback.php?action=r&id=<?php echo $one['id']; ?>&r=<?php echo $currefer; ?>" class="remove-record">删除</a><?php if(!$one['user_id']){?>|<a href="/manage/misc/feedback.php?action=m&id=<?php echo $one['id']; ?>&r=<?php echo $currefer; ?>">处理</a><?php }?></td>
</tr>
<?php }}?>
<tr><td colspan="5"><?php echo $pagestring; ?></tr>
</table>
</div>
</div>
<div class="box-bottom"></div>
</div>
</div>
示例11: team_origin
if ($eorder['state']=='unpay' && $eorder['team_id'] == $id && $eorder['user_id'] == $login_user_id ) {
$table->origin = team_origin($team, $table->quantity,$express_price);
$table->origin -= $eorder['card'];
} else {
$eorder = null;
}
}
if (!$eorder){
$table->pk_value='';
$table->create_time = time();
$table->origin = team_origin($team, $table->quantity,$express_price);
}
if ($team['delivery']=='express') {
if (!$table->address
|| !Utility::IsMobile($table->mobile)
|| !$table->realname
) {
Session::Set('error', '购买选项填写不完整');
Session::Set('loginpagepost', json_encode($_POST));
redirect("buy.php?id={$team['id']}");
}
}
$insert = array(
'user_id', 'team_id', 'city_id', 'state','express_id',
'fare', 'express', 'origin', 'price',
'address', 'zipcode', 'realname', 'mobile', 'quantity',
'create_time', 'remark','is_mobile'
);
示例12: redirect
Session::Set('error', '请输入正确的邮箱,邮箱不能为空!');
redirect(WEB_ROOT . '/account/repass.php');
} else {
if (!empty($_POST['email'])) {
$user = Table::Fetch('user', strval($_POST['email']), 'email');
if ($user) {
$user['recode'] = $user['recode'] ? $user['recode'] : md5(json_encode($user));
Table::UpdateCache('user', $user['id'], array('recode' => $user['recode']));
mail_repass($user);
Session::Set('reemail', $user['email']);
redirect(WEB_ROOT . '/account/repass.php?action=ok');
}
Session::Set('error', '抱歉,这个邮箱没有在本站绑定过用户,试试<a style="color:#000" href="/account/repassmobile.php">手机号找回密码?</a>');
redirect(WEB_ROOT . '/account/repass.php');
} elseif (!empty($_POST['mobile'])) {
if (!Utility::IsMobile($_POST['mobile'])) {
Session::Set('error', '手机号码不正确');
redirect(WEB_ROOT . '/account/repass.php');
} else {
$sended = DB::GetQueryResult("SELECT mobile FROM verifycode WHERE mobile='" . $_POST['mobile'] . "' AND status=3 AND getip='" . Utility::GetRemoteIp() . "' AND dateline>'" . (time() - 3600) . "'");
if ($sended) {
Session::Set('error', '每IP每手机号每小时只能找回一次密码');
redirect(WEB_ROOT . '/account/repass.php');
} else {
$user = Table::Fetch('user', strval($_POST['mobile']), 'mobile');
if ($user) {
//设置6位随机数字密码
$new_password = Utility::VerifyCode();
$content = $INI['system']['sitename'] . " 您的用户名:" . $user['username'] . " 新密码:" . $new_password . " 请及时修改密码。";
//长度不能超过70个字符
$ret = sms_send($_POST['mobile'], $content);
示例13: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
$user_name = $_POST['email'];
if ($INI['sms']['login'] == '1') {
if (Utility::IsMobile($user_name)) {
$user = DB::GetQueryResult("SELECT username,email from user WHERE mobile='" . $user_name . "'");
//根据手机号获取用户名
if ($user) {
$user_name = $user['username'];
}
}
}
$login_user = ZUser::GetLogin($user_name, $_POST['password']);
if (!$login_user) {
Session::Set('error', '账号或密码错误,请重新输入。如果已绑定手机号,建议用手机号登录。');
redirect(WEB_ROOT . '/account/login.php');
} else {
if (option_yes('mobilecode') && $login_user['emailable'] == 'Y' && $login_user['enable'] == 'N') {
$user['id'] = $login_user['id'];
Session::Set('error', '请验证手机号');
die(include template('account_signmobile'));
} else {
if (option_yes('emailverify') && $login_user['emailable'] == 'N' && $login_user['enable'] == 'N' && $login_user['secret']) {
Session::Set('unemail', $_POST['email']);
redirect(WEB_ROOT . '/account/verify.php');
} else {
Session::Set('user_id', $login_user['id']);
if (abs(intval($_POST['auto_login']))) {
ZLogin::Remember($login_user);
示例14: json
json($d, 'updater');
} else {
if ($action == 'sms') {
$smskey = Cache::GetStringKey("Coupon:{$cid}-{$login_user_id}");
$yeah = $cache->Get($smskey);
if ($yeah) {
json('SMS is submitted, please hold on for 3-5 minutes');
}
$coupon = Table::Fetch('coupon', $cid);
if (!$coupon || !is_login() || $coupon['user_id'] != ZLogin::GetLoginId()) {
json('illegal download', 'alert');
} else {
if ($coupon['consume'] == 'Y' || $coupon['expire_time'] < strtotime(date('Y-m-d'))) {
json($INI['system']['couponname'] . 'invalid already', 'alert');
} else {
if (!Utility::IsMobile($login_user['mobile'])) {
json('SMS is sent, please check it', 'alert');
}
}
}
$team = Table::Fetch('team', $coupon['team_id']);
$content = "Deal: {$team['product']}, {$INI['system']['couponname']}Serial:{$coupon['id']}, Password:{$coupon['secret']}";
if (true === ($code = sms_send($login_user['mobile'], $content))) {
$cache->Set($smskey, 'yeah', 0, 300);
json('SMS is sent successfully, please check it', 'alert');
}
json("Sending SMS failed, error code: {$code}", 'alert');
}
}
}
}
示例15: sms_refundorder
function sms_refundorder($order, $mobile=null) {
global $INI;
$user = Table::Fetch('user', $order['user_id']);
if (!Utility::IsMobile($mobile)) {
$mobile = $order['mobile'];
if (!Utility::IsMobile($mobile)) {
$mobile= $user['mobile'];
}
}
$team = Table::Fetch('team', $order['team_id']);
$content = render('manage_tpl_smsrefundorder', array(
'refundproduct' => $team['product'],
));
sms_send($mobile, $content);
}