本文整理汇总了PHP中get_gmtime函数的典型用法代码示例。如果您正苦于以下问题:PHP get_gmtime函数的具体用法?PHP get_gmtime怎么用?PHP get_gmtime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_gmtime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_medal
public function get_medal()
{
$user_id = intval($GLOBALS['user_info']['id']);
$medal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "medal where class_name = 'Groupuser'");
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
$data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_medal where medal_id = " . $medal['id'] . " and user_id = " . $user_id);
if ($data) {
//已经领取
$result['status'] = 2;
$result['info'] = "您已经领取过" . $medal['name'];
} else {
$group_info = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_group where user_id = " . $user_id);
if ($group_info > 0) {
$link_data['user_id'] = $user_id;
$link_data['medal_id'] = $medal['id'];
$link_data['name'] = $medal['name'];
$link_data['icon'] = $medal['icon'];
$link_data['create_time'] = get_gmtime();
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_medal", $link_data);
$result['status'] = 1;
//领取成功
$result['info'] = "您已经成功领取" . $medal['name'];
} else {
$result['status'] = 0;
$result['info'] = "您还不是小组组长,去申请一个小组";
$result['jump'] = url("shop", "group#create");
}
}
return $result;
}
开发者ID:dalinhuang,项目名称:zsh_business,代码行数:30,代码来源:Groupuser_medal.php
示例2: set
static function set($name, $value, $expire = '', $path = '', $domain = '')
{
$path = app_conf("COOKIE_PATH");
$domain = app_conf("DOMAIN_ROOT");
$expire = !empty($expire) ? get_gmtime() + $expire : 0;
setcookie($name, $value, $expire, $path, $domain);
}
开发者ID:xcdxcd,项目名称:zhongchou,代码行数:7,代码来源:es_cookie.php
示例3: insert
public function insert()
{
$name = $this->getActionName();
$model = D($name);
$data = $model->create();
$data['create_time'] = TIME_UTC;
if (false === $data) {
$this->error($model->getError());
}
$data['create_time'] = get_gmtime();
$list = false;
//保存当前数据对象
foreach ($_REQUEST['image'] as $k => $v) {
if ($v) {
$data['image'] = $v;
$data['brief'] = $_REQUEST['brief'][$k];
$list = $model->add($data);
}
}
if ($list !== false) {
//保存成功
$supplier_info['id'] = $data['supplier_location_id'];
syn_supplier_locationcount($supplier_info);
update_supplier_location_img($supplier_info['id']);
save_log(L("INSERT_SUCCESS"), 1);
$this->success(L("INSERT_SUCCESS"));
} else {
//错误提示
$dbErr = M()->getDbError();
save_log(L("INSERT_FAILED") . $dbErr, 0);
$this->error(L("INSERT_FAILED") . $dbErr);
}
}
开发者ID:dalinhuang,项目名称:zsh_business,代码行数:33,代码来源:SupplierLocationImagesAction.class.php
示例4: index
public function index()
{
$mobile = strim($GLOBALS['request']['mobile']);
if (app_conf("SMS_ON") == 0) {
$root['status'] = 0;
$root['info'] = '短信功能关闭';
output($root);
}
if ($mobile == '') {
$root['status'] = 0;
$root['info'] = '手机号码不能为空';
output($root);
}
if (!check_mobile($mobile)) {
$root['status'] = 0;
$root['info'] = "请输入正确的手机号码";
output($root);
}
if (!check_ipop_limit(CLIENT_IP, "register_verify_phone", 60, 0)) {
$root['status'] = 0;
$root['info'] = '发送太快了';
output($root);
}
$sql = "SELECT * FROM " . DB_PREFIX . "user WHERE mobile = " . $mobile;
$user = $GLOBALS['db']->getRow($sql);
if (empty($user)) {
$root['status'] = 0;
$root['info'] = "手机号未在本站注册过";
output($root);
}
//删除超过5分钟的验证码
$sql = "DELETE FROM " . DB_PREFIX . "sms_mobile_verify WHERE mobile_phone = '{$mobile}' and add_time <=" . (get_gmtime() - 300);
$GLOBALS['db']->query($sql);
$code = rand(100000, 999999);
$message = "您正在找回密码,验证码:" . $code . ",如非本人操作,请忽略本短信【" . app_conf("SHOP_TITLE") . "】";
require_once APP_ROOT_PATH . "system/utils/es_sms.php";
$sms = new sms_sender();
$send = $sms->sendSms($mobile, $message);
if ($send['status']) {
$add_time = get_gmtime();
$GLOBALS['db']->query("insert into " . DB_PREFIX . "sms_mobile_verify(mobile_phone,code,add_time,send_count,ip) values('{$mobile}','{$code}','{$add_time}',1," . "'" . CLIENT_IP . "')");
/* 插入一条发送成功记录到队列表中 */
$msg_data['dest'] = $mobile;
$msg_data['send_type'] = 0;
$msg_data['content'] = addslashes($message);
$msg_data['send_time'] = $add_time;
$msg_data['is_send'] = 1;
$msg_data['is_success'] = 1;
$msg_data['create_time'] = $add_time;
$msg_data['user_id'] = intval($user['id']);
$msg_data['title'] = "密码找回验证";
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
$root['info'] = "验证码发出,请注意查收";
$root['status'] = 1;
} else {
$root['info'] = "发送失败" . $send['msg'];
$root['status'] = 0;
}
output($root);
}
开发者ID:macall,项目名称:jishida,代码行数:60,代码来源:get_password_find_code.action.php
示例5: get_medal
public function get_medal()
{
$user_id = intval($GLOBALS['user_info']['id']);
$medal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "medal where class_name = 'Tencentbind'");
$medal['config'] = unserialize($medal['config']);
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
$data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_medal where medal_id = " . $medal['id'] . " and user_id = " . $user_id);
if ($data) {
//已经领取
$result['status'] = 2;
$result['info'] = "您已经领取过" . $medal['name'];
} else {
if ($user_info['tencent_id'] != '') {
$link_data['user_id'] = $user_id;
$link_data['medal_id'] = $medal['id'];
$link_data['name'] = $medal['name'];
$link_data['icon'] = $medal['icon'];
$link_data['create_time'] = get_gmtime();
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_medal", $link_data);
$result['status'] = 1;
//领取成功
$result['info'] = "您已经成功领取" . $medal['name'];
} else {
$result['status'] = 0;
$result['info'] = "领取该勋章需要绑定腾讯微博帐号";
$result['jump'] = url("shop", "uc_center#setweibo");
}
}
return $result;
}
开发者ID:dalinhuang,项目名称:zsh_business,代码行数:30,代码来源:Tencentbind_medal.php
示例6: index
public function index()
{
$ecvSn = strim($GLOBALS['request']['ecv_sn']);
$ecvPassword = strim($GLOBALS['request']['ecv_pwd']);
$now = get_gmtime();
//检查用户,用户密码
$user = $GLOBALS['user_info'];
$user_id = intval($user['id']);
$root = array();
$root['return'] = 1;
$root['info'] = "";
$root['check_ecv_state'] = 0;
//0:无效,1:有效
if ($user_id > 0) {
$root['user_login_status'] = 1;
if (!empty($ecvSn)) {
$ecv_sql = "select e.*,et.name from " . DB_PREFIX . "ecv as e left join " . DB_PREFIX . "ecv_type as et on e.ecv_type_id = et.id where e.sn = '" . $ecvSn . "' and e.password = '" . $ecvPassword . "' and ((e.begin_time <> 0 and e.begin_time < " . $now . ") or e.begin_time = 0) and " . "((e.end_time <> 0 and e.end_time > " . $now . ") or e.end_time = 0) and ((e.use_limit <> 0 and e.use_limit > e.use_count) or (e.use_limit = 0)) " . "and (e.user_id = " . $user_id . " or e.user_id = 0)";
$ecv_data = $GLOBALS['db']->getRow($ecv_sql);
if (!$ecv_data) {
$root['info'] = "无效的代金券";
} else {
$root['check_ecv_state'] = 1;
$root['info'] = "验证成功!";
}
} else {
$root['info'] = "卡号不能为空!";
}
} else {
$root['user_login_status'] = 0;
}
output($root);
}
开发者ID:macall,项目名称:jsd,代码行数:32,代码来源:check_ecv.action.php
示例7: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$share_id = intval($GLOBALS['request']['share_id']);
//没有分享ID直接退出
if ($share_id == 0) {
$root['status'] = -2;
output($root);
}
$content = strim($GLOBALS['request']['content']);
$source = strim($GLOBALS['request']['source']);
$source = str_replace("来自", "", $source);
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$is_relay = intval($GLOBALS['request']['is_relay']);
$parent_id = intval($GLOBALS['request']['parent_id']);
if ($parent_id > 0) {
$parent_reply = $GLOBALS['db']->getRow("select id,user_id,user_name from " . DB_PREFIX . "topic_reply where id = " . $parent_id);
}
$result = do_login_user($email, $pwd);
$GLOBALS['user_info'] = $user_data = es_session::get('user_info');
$user_data['id'] = intval($user_data['id']);
if (intval($user_data['id']) == 0) {
$root['return'] = 0;
$root['user_login_status'] = 0;
$root['info'] = "请先登录";
output($root);
}
$root['user_login_status'] = 1;
$topic = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and id = " . $share_id);
if (empty($topic)) {
$root['status'] = -3;
output($root);
}
$reply_data = array();
$reply_data['topic_id'] = $share_id;
$reply_data['user_id'] = intval($user_data['id']);
$reply_data['user_name'] = $user_data['user_name'];
$reply_data['reply_id'] = intval($parent_reply['id']);
$reply_data['reply_user_id'] = intval($parent_reply['user_id']);
$reply_data['reply_user_name'] = strim($parent_reply['user_name']);
$reply_data['create_time'] = get_gmtime();
$reply_data['is_effect'] = 1;
$reply_data['is_delete'] = 0;
$reply_data['content'] = valid_str($content);
$GLOBALS['db']->autoExecute(DB_PREFIX . "topic_reply", $reply_data);
$GLOBALS['db']->query("update " . DB_PREFIX . "topic set reply_count = reply_count + 1,last_time = " . get_gmtime() . ",last_user_id=" . $user_data['id'] . " where id = " . $share_id);
increase_user_active($user_data['id'], "转发了一则分享");
if ($is_relay == 1) {
$cnt = $topic['content'] . "@" . $user_data['user_name'] . " 评论:" . valid_str($content);
$id = insert_topic($cnt, $title = "", $type = "", $group = "", $relay_id = $share_id, $fav_id = 0);
if ($id) {
$GLOBALS['db']->query("update " . DB_PREFIX . "topic set source_name = '" . $source . "' where id = " . intval($id));
}
}
$root['return'] = 1;
$root['status'] = 1;
output($root);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:60,代码来源:addcomment.action.php
示例8: index
public function index()
{
$page = intval($GLOBALS['request']['page']);
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
if ($page == 0) {
$page = 1;
}
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
$event_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_event order by sort desc limit " . $limit);
$count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_event");
foreach ($event_list as $k => $v) {
$now = get_gmtime();
$event_list[$k]['end_time'] = $v['event_end_time'];
$event_list[$k]['url'] = url("shop", "deal_event#show", array("id" => $v['id']));
$event_list[$k]['event_end_time'] = to_date($v['event_end_time'], 'Y-m-d');
$event_list[$k]['icon'] = get_abs_img_root(make_img($v['icon'], 592, 215, 1));
$event_list[$k]['sheng_time_format'] = to_date($v['event_end_time'] - $now, "d天h小时i分");
}
$page_total = ceil($count / $page_size);
$root = array();
$root['return'] = 1;
$root['item'] = $event_list;
$root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
$root['page_title'] = "活动专题";
$root['city_name'] = $city_name;
output($root);
}
开发者ID:macall,项目名称:jsd,代码行数:29,代码来源:deal_eventlist.action.php
示例9: index
public function index()
{
$root = array();
$email = addslashes($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = addslashes($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
if ($user_id == 0) {
$root['user_login_status'] = 0;
//用户登陆状态:1:成功登陆;0:未成功登陆
output($root);
} else {
$root['user_login_status'] = 1;
}
$yh_id = intval($GLOBALS['request']['yh_id']);
$content = addslashes($GLOBALS['request']['content']);
//$merchant_id = intval($GLOBALS['db']->getOne("select supplier_location_id from ".DB_PREFIX."youhui where id='".$yh_id."'"));
$merchant_youhui_comment = array('user_id' => $user_id, 'rel_id' => $yh_id, 'rel_table' => 'youhui', 'title' => $content, 'content' => $content, 'is_effect' => 1, 'create_time' => get_gmtime());
$GLOBALS['db']->autoExecute(DB_PREFIX . "message", $merchant_youhui_comment, 'INSERT');
$id = $GLOBALS['db']->insert_id();
$root['id'] = $id;
if ($id > 0) {
increase_user_active($user_id, "点评了一个优惠券");
$root['status'] = 1;
$root['info'] = "添加成功";
} else {
$root['status'] = 0;
$root['info'] = "添加失败";
}
output($root);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:34,代码来源:save_youhui_comment.action.php
示例10: set
static function set($name, $value, $expire = '', $path = '', $domain = '')
{
$path = $GLOBALS['distribution_cfg']['COOKIE_PATH'];
$domain = $GLOBALS['distribution_cfg']['DOMAIN_ROOT'];
$expire = !empty($expire) ? get_gmtime() + $expire : 0;
setcookie($name, $value, $expire, $path, $domain);
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:7,代码来源:es_cookie.php
示例11: index
public function index()
{
$id = intval($_REQUEST['id']);
$home_user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $id . " and is_effect = 1");
if (!$home_user_info) {
app_redirect(url("index"));
}
$home_user_info['weibo_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_weibo where user_id = " . $home_user_info['id']);
$GLOBALS['tmpl']->assign("home_user_info", $home_user_info);
$page_size = DEAL_PAGE_SIZE;
$step_size = DEAL_STEP_SIZE;
$step = intval($_REQUEST['step']);
if ($step == 0) {
$step = 1;
}
$page = intval($_REQUEST['p']);
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * $page_size + ($step - 1) * $step_size . "," . $step_size;
$GLOBALS['tmpl']->assign("current_page", $page);
$condition = " is_delete = 0 and is_effect = 1 and user_id = " . intval($home_user_info['id']) . " ";
$deal_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal where " . $condition . " order by sort asc limit " . $limit);
$deal_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where " . $condition);
foreach ($deal_list as $k => $v) {
$deal_list[$k]['remain_days'] = floor(($v['end_time'] - get_gmtime()) / (24 * 3600));
$deal_list[$k]['percent'] = round($v['support_amount'] / $v['limit_price'] * 100);
}
$GLOBALS['tmpl']->assign("deal_list", $deal_list);
$page = new Page($deal_count, $page_size);
//初始化分页对象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
$GLOBALS['tmpl']->display("home_index.html");
}
开发者ID:noikiy,项目名称:yisheji,代码行数:35,代码来源:homeModule.class.php
示例12: get_payment_code
public function get_payment_code($payment_notice_id)
{
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
//$order_sn = $GLOBALS['db']->getOne("select order_sn from ".DB_PREFIX."deal_order where id = ".$payment_notice['order_id']);
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
/* 银行类型 */
//$bank_id = $GLOBALS['db']->getOne("select bank_id from ".DB_PREFIX."deal_order where id = ".$payment_notice['order_id']);
$bank_id = $payment_notice['bank_id'];
$payChannel = $this->config['sdo_paychannel'];
$defaultChannel = $this->config['sdo_defaultchannel'];
if ($bank_id == '0' || trim($bank_id) == 'SDO1' || trim($bank_id) == 'SDO') {
$bank_id = '';
}
$postBackURL = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Sdo';
//付款完成后的跳转页面
$notifyURL = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Sdo';
//通知发货页面
$shengpay = new shengpay();
$array = array('Name' => 'B2CPayment', 'Version' => 'V4.1.1.1.1', 'Charset' => 'UTF-8', 'MsgSender' => $payment_info['config']['sdo_account'], 'SendTime' => to_date(get_gmtime(), 'YmdHis'), 'OrderTime' => to_date(get_gmtime(), 'YmdHis'), 'PayType' => 'PT001', 'PayChannel' => '14,18,19,20', 'InstCode' => $bank_id, 'PageUrl' => $postBackURL, 'NotifyUrl' => $notifyURL, 'ProductName' => $payment_notice_id, 'BuyerContact' => '', 'BuyerIp' => '', 'Ext1' => '', 'Ext2' => '', 'SignType' => 'MD5');
$shengpay->init($array);
$shengpay->setKey($payment_info['config']['sdo_key']);
/*
/*
商家自行检测传入的价格与数据库订单需支付金额是否相同
*/
$code = $shengpay->takeOrder($payment_notice_id, $money, $payment_info);
$code .= "<br /><span class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</span>";
return $code;
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:31,代码来源:Sdo_payment.php
示例13: insert
public function insert()
{
$id = intval($_REQUEST['id']);
$coin_type["pay_name"] = $_REQUEST['pay_name'];
$coin_type["pay_desc"] = $_REQUEST['pay_desc'];
$coin_type["faccess_key"] = $_REQUEST['faccess_key'];
$coin_type["fsecrt_key"] = $_REQUEST['fsecrt_key'];
$coin_type["fip"] = $_REQUEST['fip'];
$coin_type["fport"] = $_REQUEST['fport'];
$coin_type["create_time"] = get_gmtime();
if (!$id) {
M("coin_type")->add($coin_type);
} else {
$coin_type['id'] = $id;
M("coin_type")->save($coin_type);
}
if (method_exists($this, '_filter')) {
$this->_filter($map);
}
$model = D("coin_type");
if (!empty($model)) {
$this->_list($model, $map);
}
$this->display("index");
}
开发者ID:BruceJi,项目名称:fanwe,代码行数:25,代码来源:CoinAction.class.php
示例14: insert_load_user_tip_index
function insert_load_user_tip_index()
{
//输出未读的消息数
$msg_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "msg_box where to_user_id = " . intval($GLOBALS['user_info']['id']) . " and is_read = 0 and is_delete = 0 and type = 0");
$GLOBALS['tmpl']->assign("msg_count", intval($msg_count));
$expire = array();
if ($GLOBALS['user_info']) {
$time = get_gmtime();
$expire_time = 6 * 30 * 24 * 3600;
if ($GLOBALS['user_info']['workpassed'] == 1) {
if ($time - $GLOBALS['user_info']['workpassed_time'] > $expire_time) {
$expire['workpassed_expire'] = 1;
}
}
if ($GLOBALS['user_info']['incomepassed'] == 1) {
if ($time - $GLOBALS['user_info']['incomepassed_time'] > $expire_time) {
$expire['incomepassed_expire'] = 1;
}
}
if ($GLOBALS['user_info']['creditpassed'] == 1) {
if ($time - $GLOBALS['user_info']['creditpassed_time'] > $expire_time) {
$expire['creditpassed_expire'] = 1;
}
}
if ($GLOBALS['user_info']['residencepassed'] == 1) {
if ($time - $GLOBALS['user_info']['residencepassed_time'] > $expire_time) {
$expire['residencepassed_expire'] = 1;
}
}
$GLOBALS['tmpl']->assign("u_expire", $expire);
}
return $GLOBALS['tmpl']->fetch("inc/insert/load_user_tip_index.html");
}
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:33,代码来源:insert_libs.php
示例15: check_fee
public function check_fee()
{
es_session::start();
$last_visit = intval(es_session::get("last_visit_smsbao"));
if (get_gmtime() - $last_visit > 10) {
$sms = new transport();
$params = array("u" => $this->sms['user_name'], "p" => md5($this->sms['password']));
$url = "http://www.smsbao.com/query";
$result = $sms->request($url, $params);
$match = explode(',', $result['body']);
if ($match[0] != '') {
$remain = (int) $match[1];
$str = sprintf('短信宝增值平台 剩余:%d 条', $remain);
} else {
$str = "短信宝增值平台 (<a href='http://www.smsbao.com/reg?r=5001' target='_blank'><font color='red'>还没账号?点击这免费注册</font></a>)";
}
es_session::set("smsbao_info", $str);
es_session::set("last_visit_smsbao", get_gmtime());
return $str;
} else {
$qxt_info = es_session::get("smsbao_info");
if ($smsbao_info) {
return $smsbao_info;
} else {
return "短信宝增值平台 (<a href='http://www.smsbao.com/reg?r=5001' target='_blank'><font color='red'>还没账号?点击这免费注册</font></a>)";
}
}
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:28,代码来源:smsbao_sms.php
示例16: dologin
public function dologin()
{
if (check_ipop_limit(get_client_ip(), "supplier_dologin", intval(app_conf("SUBMIT_DELAY")))) {
$account_name = htmlspecialchars(addslashes(trim($_REQUEST['account_name'])));
$account_password = htmlspecialchars(addslashes(trim($_REQUEST['account_password'])));
$account = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_account where account_name = '" . $account_name . "' and account_password = '" . md5($account_password) . "' and is_effect = 1 and is_delete = 0");
if ($account) {
if (intval($_REQUEST['save_password']) == 1) {
es_cookie::set("sp_account_name", $account_name, 3600 * 24 * 30);
es_cookie::set("sp_account_password", md5($account_password), 3600 * 24 * 30);
}
//$account_locations = $GLOBALS['db']->getAll("select location_id from ".DB_PREFIX."supplier_account_location_link where account_id = ".$account['id']);
$account_locations = $GLOBALS['db']->getAll("select id from " . DB_PREFIX . "supplier_location where supplier_id = " . $account['supplier_id']);
$account_location_ids = array(0);
foreach ($account_locations as $row) {
$account_location_ids[] = $row['id'];
}
$account['location_ids'] = $account_location_ids;
es_session::set("account_info", $account);
$result['status'] = 1;
$GLOBALS['db']->query("update " . DB_PREFIX . "supplier_account set login_time = " . get_gmtime() . ",login_ip = '" . get_client_ip() . "' where id = " . $account['id']);
ajax_return($result);
} else {
$result['status'] = 0;
$result['msg'] = $GLOBALS['lang']['SUPPLIER_LOGIN_FAILED'];
ajax_return($result);
}
} else {
$result['status'] = 0;
$result['msg'] = $GLOBALS['lang']['SUBMIT_TOO_FAST'];
ajax_return($result);
}
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:33,代码来源:loginModule.class.php
示例17: index
public function index()
{
$mobile = addslashes(htmlspecialchars(trim($GLOBALS['request']['mobile'])));
$root = array();
if (app_conf("SMS_ON") == 0) {
$root['response_code'] = 0;
$root['show_err'] = $GLOBALS['lang']['SMS_OFF'];
//短信未开启
output($root);
}
if ($mobile == '') {
$root['response_code'] = 0;
$root['show_err'] = $GLOBALS['lang']['MOBILE_EMPTY_TIP'];
//请输入你的手机号
output($root);
}
if (!check_mobile($mobile)) {
$root['response_code'] = 0;
$root['show_err'] = $GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'];
//请填写正确的手机号码
output($root);
}
if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where mobile = '" . $mobile . "'") > 0) {
$field_show_name = $GLOBALS['lang']['USER_TITLE_mobile'];
//手机号码
$root['response_code'] = 0;
$root['show_err'] = sprintf($GLOBALS['lang']['EXIST_ERROR_TIP'], $field_show_name);
//已存在,请重新输入
output($root);
}
if (!check_ipop_limit(get_client_ip(), "mobile_verify", 60, 0)) {
$root['response_code'] = 0;
$root['show_err'] = $GLOBALS['lang']['MOBILE_SMS_SEND_FAST'];
//短信发送太快
output($root);
}
//删除超过5分钟的验证码
$GLOBALS['db']->query("DELETE FROM " . DB_PREFIX . "mobile_verify_code WHERE create_time <=" . get_gmtime() - 300);
$verify_code = $GLOBALS['db']->getOne("select verify_code from " . DB_PREFIX . "mobile_verify_code where mobile = '" . $mobile . "' and create_time>=" . (TIME_UTC - 180) . " ORDER BY id DESC");
if (intval($verify_code) == 0) {
//如果数据库中存在验证码,则取数据库中的(上次的 );确保连接发送时,前后2条的验证码是一至的.==为了防止延时
//开始生成手机验证
$verify_code = rand(1111, 9999);
$GLOBALS['db']->autoExecute(DB_PREFIX . "mobile_verify_code", array("verify_code" => $verify_code, "mobile" => $mobile, "create_time" => get_gmtime(), "client_ip" => get_client_ip()), "INSERT");
}
//使用立即发送方式
$result = send_verify_sms($mobile, $verify_code, null, true);
//
$root['response_code'] = $result['status'];
if ($root['response_code'] == 1) {
$root['show_err'] = $GLOBALS['lang']['MOBILE_VERIFY_SEND_OK'];
} else {
$root['show_err'] = $result['msg'];
if ($root['show_err'] == null || $root['show_err'] == '') {
$root['show_err'] = "验证码发送失败";
}
}
//../system/sms/FW_sms.php 提示账户或密码错误地址
output($root);
}
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:60,代码来源:send_register_code.action.php
示例18: update
public function update()
{
B('FilterString');
$data = M("ApnsMessages")->create();
$log_info = $data['id'];
//开始验证有效性
$this->assign("jumpUrl", u("MApns/edit", array("id" => $data['id'])));
if (!check_empty($data['content'])) {
$this->error(L("CONTENT_EMPTY_TIP"));
}
if ($data['send_time'] == '') {
$data['send_time'] = get_gmtime();
}
$data['send_time'] = to_timespan($data['send_time']);
if (intval($_REQUEST['resend']) == 1) {
$data['status'] = 0;
}
$list = M("ApnsMessages")->save($data);
if (false !== $list) {
//成功提示
save_log($log_info . L("UPDATE_SUCCESS"), 1);
$this->success(L("UPDATE_SUCCESS"));
} else {
//错误提示
save_log($log_info . L("UPDATE_FAILED"), 0);
$this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
}
}
开发者ID:dalinhuang,项目名称:zsh_business,代码行数:28,代码来源:MApnsAction.class.php
示例19: insert_ticket
public function insert_ticket()
{
if ($_REQUEST['money'] == '') {
$this->error("券的金额不能为空");
}
if ($_REQUEST['amount'] == '') {
$this->error("券的数量不能为空");
}
if ($_REQUEST['use_time'] == '') {
$this->error("券的有效天数不能为空");
}
$ticket_data['money'] = intval($_REQUEST['money']);
$ticket_data['quantity'] = intval($_REQUEST['amount']);
$ticket_data['rest_quantity'] = intval($_REQUEST['amount']);
$ticket_data['use_time'] = intval($_REQUEST['use_time']);
$ticket_data['status'] = intval($_REQUEST['status']);
$ticket_data['value'] = intval($_REQUEST['value']);
$ticket_data['is_deposit'] = 1;
//券的类型 0:赠金券 1代金券
$ticket_data['ticket_type'] = intval($_REQUEST['type']);
//券的使用类型 0:无条件 1:满减优惠
$ticket_data['type'] = intval($_REQUEST['use_type']);
//系统默认时间
$ticket_data['create_time'] = get_gmtime();
$ticket_data['start_use'] = to_timespan(trim($_REQUEST['start_time']));
$ticket_data['deadline'] = to_timespan(trim($_REQUEST['end_time']));
$rs = M("Ticket")->add($ticket_data);
if ($rs) {
$this->success(L("INSERT_SUCCESS"));
} else {
$this->error(L("INSERT_FAILED"));
}
}
开发者ID:BruceJi,项目名称:fanwe,代码行数:33,代码来源:AddTicketAction.class.php
示例20: index
public function index()
{
$payment_id = intval($GLOBALS['request']['payment']);
$money = floatval($GLOBALS['request']['money']);
if ($money <= 0) {
$root['status'] = 2;
$root['info'] = $GLOBALS['lang']['PLEASE_INPUT_CORRECT_INCHARGE'];
output($root);
}
$payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_id);
if (!$payment_info) {
$root['status'] = 2;
$root['info'] = $GLOBALS['lang']['PLEASE_SELECT_PAYMENT'];
output($root);
}
if ($payment_info['fee_type'] == 0) {
//定额
$payment_fee = $payment_info['fee_amount'];
} else {
//比率
$payment_fee = $money * $payment_info['fee_amount'];
}
//开始生成订单
$now = NOW_TIME;
$order['type'] = 1;
//充值单
$order['user_id'] = $GLOBALS['user_info']['id'];
$order['create_time'] = $now;
$order['total_price'] = $money + $payment_fee;
$order['deal_total_price'] = $money;
$order['pay_amount'] = 0;
$order['pay_status'] = 0;
$order['delivery_status'] = 5;
$order['order_status'] = 0;
$order['payment_id'] = $payment_id;
$order['payment_fee'] = $payment_fee;
// $order['bank_id'] = strim($_REQUEST['bank_id']);
do {
$order['order_sn'] = to_date(get_gmtime(), "Ymdhis") . rand(100, 999);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'INSERT', '', 'SILENT');
$order_id = intval($GLOBALS['db']->insert_id());
} while ($order_id == 0);
require_once APP_ROOT_PATH . "system/model/cart.php";
$payment_notice_id = make_payment_notice($order['total_price'], $order_id, $payment_info['id']);
//创建支付接口的付款单
if ($payment_notice_id) {
$root['order_id'] = $order_id;
$root['info'] = 1;
}
// print_r($root);exit;
output($root);
// $rs = order_paid($order_id);
// if ($rs) {
// app_redirect(url("index", "payment#incharge_done", array("id" => $order_id))); //充值支付成功
// } else {
// app_redirect(url("index", "payment#pay", array("id" => $payment_notice_id)));
// }
}
开发者ID:macall,项目名称:jishida,代码行数:58,代码来源:incharge_done.action.php
注:本文中的get_gmtime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论