當前位置: 首頁>>代碼示例>>PHP>>正文


PHP local_date函數代碼示例

本文整理匯總了PHP中local_date函數的典型用法代碼示例。如果您正苦於以下問題:PHP local_date函數的具體用法?PHP local_date怎麽用?PHP local_date使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了local_date函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _get_data

 function _get_data()
 {
     $this->options = stripslashes_deep($this->options);
     $today = local_date('Y-m-d');
     $this->options['is_valid'] = (empty($this->options['start_date']) || $this->options['start_date'] <= $today) && (empty($this->options['end_date']) || $this->options['end_date'] >= $today);
     return $this->options;
 }
開發者ID:dongfeihu,項目名稱:estore,代碼行數:7,代碼來源:main.widget.php

示例2: load_to

          messages.id="' . $id . '" and
          messages_to.person="' . $_SESSION['userid'] . '"
         ';
     $db->select($query);
     if ($db->num_rows == 1) {
         $this->data = $db->data[0];
     }
 }
 function load_to()
 {
     global $db;
     $query = 'person.id, 
          person.first_name, 
          person.last_name
         from messages_to
         left join person on
          messages_to.person=person.id
         where messages_to.message="' . $this->data['id'] . '"';
     $db->select($query);
     $this->to = $db->data;
 }
 function format()
 {
     $fdata = $this->data;
     $fdata['text_html'] = html_br($fdata['text']);
     $fdata['created_html'] = local_date($fdata['created'], 'ymdHi');
     $fdata['author_first_name_html'] = mask_html($fdata['author_first_name']);
     $fdata['author_last_name_html'] = mask_html($fdata['author_last_name']);
     $to_list = array();
     $seperator = array();
     foreach ($this->to as $i => $to) {
         $to['first_name'] = mask_html($to['first_name']);
         $to['last_name'] = mask_html($to['last_name']);
         $to['seperator'] = $seperator;
         $seperator = array(array());
開發者ID:BackupTheBerlios,項目名稱:infoschool-svn,代碼行數:35,代碼來源:class.php

示例3: get_snatch

 /**
  * 取得當前活動信息
  *
  * @access  public
  *
  * @return 活動名稱
  */
 function get_snatch($id)
 {
     $sql = "SELECT g.goods_id, g.goods_sn, g.is_real, g.goods_name, g.extension_code, g.market_price, g.shop_price AS org_price, product_id, " . "IFNULL(mp.user_price, g.shop_price * '{$_SESSION['discount']}') AS shop_price, " . "g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb,g.goods_img, " . "ga.act_name AS snatch_name, ga.start_time, ga.end_time, ga.ext_info, ga.act_desc AS `desc` " . "FROM " . $this->pre . "goods_activity AS ga " . "LEFT JOIN " . $this->pre . "goods AS g " . "ON g.goods_id = ga.goods_id " . "LEFT JOIN " . $this->pre . "member_price AS mp " . "ON mp.goods_id = g.goods_id AND mp.user_rank = '{$_SESSION['user_rank']}' " . "WHERE ga.act_id = '{$id}' AND g.is_delete = 0";
     $goods = $this->row($sql);
     if ($goods) {
         $promote_price = bargain_price($goods['promote_price'], $goods['promote_start_date'], $goods['promote_end_date']);
         $goods['formated_market_price'] = price_format($goods['market_price']);
         $goods['formated_shop_price'] = price_format($goods['shop_price']);
         $goods['formated_promote_price'] = $promote_price > 0 ? price_format($promote_price) : '';
         $goods['goods_thumb'] = get_image_path($goods['goods_id'], $goods['goods_thumb'], true);
         $goods['goods_img'] = get_image_path($goods['goods_id'], $goods['goods_img'], true);
         $goods['url'] = url('goods/index', array('id' => $goods['goods_id']));
         $goods['start_time'] = local_date(C('time_format'), $goods['start_time']);
         $info = unserialize($goods['ext_info']);
         if ($info) {
             foreach ($info as $key => $val) {
                 $goods[$key] = $val;
             }
             $goods['is_end'] = gmtime() > $goods['end_time'];
             $goods['formated_start_price'] = price_format($goods['start_price']);
             $goods['formated_end_price'] = price_format($goods['end_price']);
             $goods['formated_max_price'] = price_format($goods['max_price']);
         }
         /* 將結束日期格式化為格林威治標準時間時間戳 */
         $goods['gmt_end_time'] = $goods['end_time'];
         $goods['end_time'] = local_date(C('time_format'), $goods['end_time']);
         $goods['snatch_time'] = sprintf(L('snatch_start_time'), $goods['start_time'], $goods['end_time']);
         return $goods;
     } else {
         return false;
     }
 }
開發者ID:ChanHarold,項目名稱:ecshop,代碼行數:39,代碼來源:SnatchModel.class.php

示例4: check_order

function check_order($con, $goods)
{
    $msg = '';
    $btime = "";
    $ntimestamp = gmtime() + 32 * 3600;
    //24小時後時間戳
    $now = gmtime();
    $tmd = date('Y-m-d', $now + 32 * 3600);
    if (empty($con)) {
        $msg .= '請您填寫收貨信息|';
    } else {
        $btime = $con['best_time'];
    }
    $btimestamp = strtotime($btime);
    if (empty($goods)) {
        $msg .= '購物車沒有商品|';
    }
    if (empty($btime) || strlen($btime) < 19) {
        $msg .= '請填寫送貨時間|';
    }
    if ($btimestamp < gmtime() + 13.25 * 3600) {
        $msg .= '送貨時間不足5小時,重新填寫送貨時間';
    }
    if (local_date('H', $now) > 21 && substr($btime, 0, 13) < $tmd . ' 14' && $con['country'] == '441') {
        $msg .= '請注意,此時訂貨最早14點送貨,請修改送貨時間 ';
    }
    if (local_date('H', $now) < 10 && substr($btime, 0, 13) < date('Y-m-d', $now + 8 * 3600) . ' 14' && $con['country'] == '441') {
        $msg .= '請注意,此時訂貨最早14點送貨,請修改送貨時間 ';
    }
    return $msg;
}
開發者ID:songtaiwu,項目名稱:m-cmsold,代碼行數:31,代碼來源:check_order.php

示例5: get_user_orders_1

/**
 *  獲取用戶指定範圍的訂單列表
 *
 * @access  public
 * @param   int         $user_id        用戶ID號
 * @param   int         $num            列表最大數量
 * @param   int         $start          列表起始位置
 * @return  array       $order_list     訂單列表
 */
function get_user_orders_1($user_id, $num = 10, $start = 0, $where = '')
{
    /* 取得訂單列表 */
    $arr = array();
    $sql = "SELECT o.*, ifnull(ssc.value,'網站自營') as shopname, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . ' as o ' . " LEFT JOIN " . $GLOBALS['ecs']->table('supplier_shop_config') . 'as ssc ' . " ON o.supplier_id=ssc.supplier_id AND ssc.code='shop_name' " . " WHERE user_id = '{$user_id}' {$where} ORDER BY add_time DESC";
    $res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        if ($row['order_status'] == OS_UNCONFIRMED) {
            $row['handler'] = "<a href=\"user.php?act=cancel_order&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $GLOBALS['_LANG']['confirm_cancel'] . "')) return false;\">" . $GLOBALS['_LANG']['cancel'] . "</a>";
        } else {
            if ($row['order_status'] == OS_SPLITED) {
                /* 對配送狀態的處理 */
                if ($row['shipping_status'] == SS_SHIPPED) {
                    $back_num = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('back_order') . " WHERE order_id = " . $row['order_id'] . " AND status_back < 6 AND status_back != 3");
                    if ($back_num > 0) {
                        $back_info = "此單存在正在退貨商品,確認收貨退貨申請將取消。";
                    } else {
                        $back_info = "";
                    }
                    @($okgoods_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('shop_config') . " where code='okgoods_time'"));
                    @($row_time = $okgoods_time - (local_date('d', gmtime()) - local_date('d', $row['shipping_time'])));
                    @($row['handler'] = "<strong><img src='themesmobile/" . $GLOBALS['_CFG']['template'] . "/images/time.png' height='30px' style='vertical-align:middle;'/>還剩" . $row_time . "天自動收貨</strong><a href=\"user.php?act=affirm_received&order_id=" . $row['order_id'] . "\" onclick=\"if (!confirm('" . $back_info . $GLOBALS['_LANG']['confirm_received'] . "')) return false;\" style='display:inline-block; margin-top:12px; width:80px; height:25px; font-size:14px; line-height:25px; border:1px solid #F60; color:#fff; text-align:center;border-radius:5px; background:#F60 '>" . $GLOBALS['_LANG']['received'] . "</a>");
                } elseif ($row['shipping_status'] == SS_RECEIVED) {
                    @($row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['ss_received'] . '</span>');
                } else {
                    if ($row['pay_status'] == PS_UNPAYED) {
                        @($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['pay_money'] . '</a>');
                    } else {
                        @($row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" . $row['order_id'] . '">' . $GLOBALS['_LANG']['view_order'] . '</a>');
                    }
                }
            } else {
                $row['handler'] = '<span style="color:red">' . $GLOBALS['_LANG']['os'][$row['order_status']] . '</span>';
            }
        }
        $row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status'];
        $row['order_status1'] = $row['order_status'];
        $row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']];
        $cod_code = $GLOBALS['db']->getOne("select pay_code from " . $GLOBALS['ecs']->table('payment') . " where pay_id=" . $row['pay_id']);
        $weixiu_time = $GLOBALS['db']->getOne("select value from " . $GLOBALS['ecs']->table('ecsmart_shop_config') . " where code='weixiu_time'");
        $row['weixiu_time'] = $weixiu_time - (local_date('d', gmtime()) - local_date('d', $order['shipping_time_end'])) <= 0 ? 0 : 1;
        $back_can_a = 1;
        $comment_s = 0;
        $shaidan_s = 0;
        $goods_list_r = get_order_goods($row);
        foreach ($goods_list_r as $g_val) {
            if ($g_val['back_can'] == 0) {
                $back_can_a = 0;
            }
            if ($g_val['comment_state'] == 0 && $g_val['is_back'] == 0 && $comment_s == 0) {
                $comment_s = $g_val['rec_id'];
            }
            if ($g_val['shaidan_state'] == 0 && $g_val['is_back'] == 0 && $shaidan_s == 0) {
                $shaidan_s = $g_val['rec_id'];
            }
        }
        $arr[$row['order_id']] = array('order_id' => $row['order_id'], 'order_sn' => $row['order_sn'], 'shopname' => $row['shopname'], 'order_time' => local_date($GLOBALS['_CFG']['time_format'], $row['add_time']), 'order_status' => str_replace(',', ' ', $row['order_status']), 'order_status1' => $row['order_status1'], 'back_can_a' => $back_can_a, 'comment_s' => $comment_s, 'shaidan_s' => $shaidan_s, 'total_fee' => price_format($row['total_fee'], false), 'goods_list' => $goods_list_r, 'pay_online' => $row['pay_online'], 'is_suborder' => $row['parent_order_id'] ? "(子訂單)" : "", 'pay_status' => $row['pay_status'], 'handler' => $row['handler'], 'shipping_id' => $row['shipping_id'], 'shipping_name' => $row['shipping_name'], 'shipping_status' => $row['shipping_status'], 'pay_id' => $cod_code == 'cod' ? '' : $row['pay_id'], 'invoice_no' => $row['invoice_no'], 'weixiu_time' => $row['weixiu_time'], 'supplier_id' => $row['supplier_id'], 'count' => count($goods_list_r));
    }
    return $arr;
}
開發者ID:moonlight-wang,項目名稱:feilun,代碼行數:69,代碼來源:lib_transaction_1.php

示例6: index_comments

 function index_comments($num)
 {
     /*$sql = 'SELECT a.*,b.goods_id,b.goods_thumb,b.goods_name FROM '. $GLOBALS['ecs']->table('comment') .
       ' AS a,'. $GLOBALS['ecs']->table('goods') .'AS b WHERE a.status = 1 AND a.parent_id = 0 and a.comment_type=0 and a.id_value=b.goods_id'.
       ' GROUP BY a.id_value ORDER by a.comment_id DESC';*/
     $sql = 'SELECT DISTINCT a.id_value,b.goods_id,b.goods_thumb,b.goods_name,b.shop_price FROM ' . $GLOBALS['ecs']->table('comment') . ' AS a,' . $GLOBALS['ecs']->table('goods') . 'AS b WHERE a.status = 1 AND a.parent_id = 0 and a.comment_type=0 and a.id_value=b.goods_id' . ' ORDER by a.comment_id DESC';
     if ($num > 0) {
         $sql .= ' LIMIT ' . $num;
     }
     $res = $GLOBALS['db']->getAll($sql);
     $comments = array();
     foreach ($res as $idx => $row) {
         $comments[$idx]['id_value'] = $row['id_value'];
         $sqli = 'SELECT add_time,content,user_name FROM ' . $GLOBALS['ecs']->table('comment') . ' where id_value=' . $row['id_value'] . ' and status = 1 AND parent_id = 0 and comment_type=0 ORDER by add_time desc';
         $resi = $GLOBALS['db']->getRow($sqli);
         $result = mysql_query($sqli);
         $getall = $GLOBALS['db']->num_rows($result);
         $comments[$idx]['number'] = $getall;
         //條數
         $comments[$idx]['add_time'] = local_date('Y-m-d', $resi['add_time']);
         $comments[$idx]['content'] = $resi['content'];
         $comments[$idx]['user_name'] = $resi['user_name'];
         $comments[$idx]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
         $comments[$idx]['goods_name'] = $row['goods_name'];
         $comments[$idx]['shop_price'] = $row['shop_price'];
         $comments[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
     }
     return $comments;
 }
開發者ID:norain2050,項目名稱:mhFault,代碼行數:29,代碼來源:diyfile.php

示例7: assign_comment

 /**
  * 查詢評論內容
  *
  * @access  public
  * @params  integer     $id
  * @params  integer     $type
  * @params  integer     $page
  * @return  array
  */
 function assign_comment($id, $type, $rank = 0, $page = 1) {
     $rank_info = '';
     if ($rank == '1') {
         $rank_info = ' AND (comment_rank= 5 OR comment_rank = 4)';
     }
     if ($rank == '2') {
         $rank_info = ' AND (comment_rank= 2 OR comment_rank = 3)';
     }
     if ($rank == '3') {
         $rank_info = ' AND comment_rank= 1 ';
     }
     /* 取得評論列表 */
     $res = $this->row('SELECT COUNT(*) as count FROM ' . $this->pre .
             "comment WHERE id_value = '$id' AND comment_type = '$type' AND status = 1 AND parent_id = 0" . $rank_info);
     $count = $res['count'];
     $size = C('comments_number') > 0 ? C('comments_number') : 5;
     $page_count = ($count > 0) ? intval(ceil($count / $size)) : 1;
     $start = ($page - 1) * $size;
     $sql = 'SELECT * FROM ' . $this->pre .
             "comment WHERE id_value = '$id' AND comment_type = '$type' AND status = 1 AND parent_id = 0" . $rank_info .
             " ORDER BY comment_id DESC LIMIT $start , $size";
     $res = $this->query($sql);
     $arr = array();
     $ids = '';
     foreach ($res as $key => $row) {
         $ids .= $ids ? ",$row[comment_id]" : $row['comment_id'];
         $arr[$row['comment_id']]['id'] = $row['comment_id'];
         $arr[$row['comment_id']]['email'] = $row['email'];
         $arr[$row['comment_id']]['username'] = $row['user_name'];
         $arr[$row['comment_id']]['content'] = str_replace('\r\n', '<br />', htmlspecialchars($row['content']));
         $arr[$row['comment_id']]['content'] = nl2br(str_replace('\n', '<br />', $arr[$row['comment_id']]['content']));
         $arr[$row['comment_id']]['rank'] = $row['comment_rank'];
         $arr[$row['comment_id']]['add_time'] = local_date(C('time_format'), $row['add_time']);
     }
     /* 取得已有回複的評論 */
     if ($ids) {
         $sql = 'SELECT * FROM ' . $this->pre .
                 "comment WHERE parent_id IN( $ids )";
         $res = $this->query($sql);
         foreach ($res as $row) {
             $arr[$row['parent_id']]['re_content'] = nl2br(str_replace('\n', '<br />', htmlspecialchars($row['content'])));
             $arr[$row['parent_id']]['re_add_time'] = local_date(C('time_format'), $row['add_time']);
             $arr[$row['parent_id']]['re_email'] = $row['email'];
             $arr[$row['parent_id']]['re_username'] = $row['user_name'];
         }
     }
     /* 分頁樣式 */
     //$pager['styleid'] = isset(C('page_style'))? intval(C('page_style')) : 0;
     $pager['page'] = $page;
     $pager['size'] = $size;
     $pager['record_count'] = $count;
     $pager['page_count'] = $page_count;
     $pager['page_first'] = "javascript:gotoPage(1,$id,$type,$rank)";
     $pager['page_prev'] = $page > 1 ? "javascript:gotoPage(" . ($page - 1) . ",$id,$type,$rank)" : 'javascript:;';
     $pager['page_next'] = $page < $page_count ? 'javascript:gotoPage(' . ($page + 1) . ",$id,$type,$rank)" : 'javascript:;';
     $pager['page_last'] = $page < $page_count ? 'javascript:gotoPage(' . $page_count . ",$id,$type,$rank)" : 'javascript:;';
     $cmt = array('comments' => $arr, 'pager' => $pager);
     return $cmt;
 }
開發者ID:sayi21cn,項目名稱:ecshopAndEctouch,代碼行數:68,代碼來源:CommentModel.class.php

示例8: PaySubmit

 /**
  * 支付提交方法
  * @param array $data 支付相關參數
  */
 public function PaySubmit($data = array())
 {
     /**************************請求參數**************************/
     //商戶用戶唯一編號
     $user_id = $data['user_id'];
     //支付類型
     $busi_partner = 101001;
     //商戶訂單號
     $no_order = $data['TransID'];
     //商戶網站訂單係統中唯一訂單號,必填
     //付款金額
     $money_order = $data['OrderMoney'];
     //必填
     //商品名稱
     $name_goods = '用戶充值';
     //訂單地址
     $url_order = '';
     //訂單描述
     $info_order = '';
     //銀行網銀編碼
     $bank_code = '';
     //支付方式
     $pay_type = 'D';
     //卡號
     $card_no = '';
     //銀行賬號姓名
     $acct_name = $data['acct_name'];
     //身份證號
     $id_no = $data['id_no'];
     //協議號
     $no_agree = '';
     //修改標記
     $flag_modify = '';
     //風險控製參數
     $risk_item = $data['risk_item'];
     //分賬信息數據
     $shareing_data = '';
     //返回修改信息地址
     $back_url = '';
     //訂單有效期
     $valid_order = $this->llpay_config['valid_order'];
     //服務器異步通知頁麵路徑
     $notify_url = $data['ReturnUrl'];
     //需http://格式的完整路徑,不能加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $return_url = $data['PageUrl'];
     //需http://格式的完整路徑,不能加?id=123這類自定義參數,不能寫成http://localhost/
     /************************************************************/
     date_default_timezone_set('PRC');
     //構造要請求的參數數組,無需改動
     $parameter = array("version" => trim($this->llpay_config['version']), "oid_partner" => trim($this->llpay_config['oid_partner']), "sign_type" => trim($this->llpay_config['sign_type']), "userreq_ip" => trim($this->llpay_config['userreq_ip']), "id_type" => trim($this->llpay_config['id_type']), "valid_order" => trim($this->llpay_config['valid_order']), "user_id" => $user_id, "timestamp" => local_date('YmdHis', time()), "busi_partner" => $busi_partner, "no_order" => $no_order, "dt_order" => local_date('YmdHis', $data['dt_order']), "name_goods" => $name_goods, "info_order" => $info_order, "money_order" => $money_order, "notify_url" => $notify_url, "url_return" => $return_url, "url_order" => $url_order, "bank_code" => $bank_code, "pay_type" => $pay_type, "no_agree" => $no_agree, "shareing_data" => $shareing_data, "risk_item" => $risk_item, "id_no" => $id_no, "acct_name" => $acct_name, "flag_modify" => $flag_modify, "card_no" => $card_no, "back_url" => $back_url);
     //建立請求
     $llpaySubmit = new LLpaySubmit($this->llpay_config);
     $html_text = $llpaySubmit->buildRequestForm($parameter, "post", "確認");
     echo $html_text;
     exit;
 }
開發者ID:shuai959980629,項目名稱:TTDV1,代碼行數:61,代碼來源:Pay.php

示例9: get_footer

/**
 * 返回尾文件
 *
 * @return  string
 */
function get_footer()
{
    if (substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')) == '/index.php') {
        $footer = "<br/>Powered by ECShop[" . local_date('H:i') . "]";
    } else {
        $footer = "<br/><select><option onpick='index.php'>快速通道</option><option onpick='goods_list.php?type=best'>精品推薦</option><option onpick='goods_list.php?type=promote'>商家促銷</option><option onpick='goods_list.php?type=hot'>熱門商品</option><option onpick='goods_list.php?type=new'>最新產品</option></select>";
    }
    return $footer;
}
開發者ID:BGCX262,項目名稱:zuyii-svn-to-git,代碼行數:14,代碼來源:lib_main.php

示例10: get_footer

/**
 * 返回尾文件
 *
 * @return  string
 */
function get_footer()
{
    if (substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')) == '/index.php') {
        $footer = "<br/>Phát triển bởi ECMS.ASIA [" . local_date('H:i') . "]";
    } else {
        $footer = "<br/><select><option onpick='index.php'>Chuyển nhanh</option><option onpick='goods_list.php?type=best'>Sản phẩm tốt nhất</option><option onpick='goods_list.php?type=promote'>Sản phẩm k.mại</option><option onpick='goods_list.php?type=hot'>Sản phẩm hot</option><option onpick='goods_list.php?type=new'>Sản phẩm mới</option></select>";
    }
    return $footer;
}
開發者ID:duynhan07,項目名稱:ecshop-vietnam,代碼行數:14,代碼來源:lib_main.php

示例11: get_code

 /**
  * 生成支付代碼
  * @param   array   $order      訂單信息
  * @param   array   $payment    支付方式信息
  */
 function get_code($order, $payment)
 {
     $c_mid = trim($payment['c_mid']);
     //商戶編號,在申請商戶成功後即可獲得,可以在申請商戶成功的郵件中獲取該編號
     $c_order = $order['order_sn'];
     //商戶網站依照訂單號規則生成的訂單號,不能重複
     $c_name = "";
     //商戶訂單中的收貨人姓名
     $c_address = "";
     //商戶訂單中的收貨人地址
     $c_tel = "";
     //商戶訂單中的收貨人電話
     $c_post = "";
     //商戶訂單中的收貨人郵編
     $c_email = "";
     //商戶訂單中的收貨人Email
     $c_orderamount = $order['order_amount'];
     //商戶訂單總金額
     if (!empty($order['add_time'])) {
         $c_ymd = local_date('Ymd', $order['add_time']);
     } else {
         $c_ymd = local_date('Ymd', gmtime());
     }
     //$c_ymd      = substr($order['order_sn'], 0, 8); //商戶訂單的產生日期,格式為"yyyymmdd",如20050102
     $c_moneytype = $payment['c_moneytype'];
     //支付幣種,0為人民幣
     $c_retflag = "1";
     //商戶訂單支付成功後是否需要返回商戶指定的文件,0:不用返回 1:需要返回
     $c_paygate = empty($payment['c_paygate']) ? '' : trim($payment['c_paygate']);
     //如果在商戶網站選擇銀行則設置該值,具體值可參見《雲網支付@網技術接口手冊》附錄一;如果來雲網支付@網選擇銀行此項為空值。
     $c_returl = return_url(basename(__FILE__, '.php'));
     //如果c_retflag為1時,該地址代表商戶接收雲網支付結果通知的頁麵,請提交完整文件名(對應範例文件:GetPayNotify.php)
     $c_memo1 = abs(crc32(trim($payment['c_memo1'])));
     //商戶需要在支付結果通知中轉發的商戶參數一
     if (empty($order['order_id'])) {
         $c_memo2 = "voucher";
         //商戶需要在支付結果通知中轉發的商戶參數二
     } else {
         $c_memo2 = '';
     }
     $c_pass = trim($payment['c_pass']);
     //支付密鑰,請登錄商戶管理後台,在帳戶信息-基本信息-安全信息中的支付密鑰項
     $notifytype = "0";
     //0普通通知方式/1服務器通知方式,空值為普通通知方式
     $c_language = trim($payment['c_language']);
     //對啟用了國際卡支付時,可使用該值定義消費者在銀行支付時的頁麵語種,值為:0銀行頁麵顯示為中文/1銀行頁麵顯示為英文
     $srcStr = $c_mid . $c_order . $c_orderamount . $c_ymd . $c_moneytype . $c_retflag . $c_returl . $c_paygate . $c_memo1 . $c_memo2 . $notifytype . $c_language . $c_pass;
     //說明:如果您想指定支付方式(c_paygate)的值時,需要先讓用戶選擇支付方式,然後再根據用戶選擇的結果在這裏進行MD5加密,也就是說,此時,本頁麵應該拆分為兩個頁麵,分為兩個步驟完成。
     //--對訂單信息進行MD5加密
     //商戶對訂單信息進行MD5簽名後的字符串
     $c_signstr = md5($srcStr);
     $def_url = '<form name="payForm1" action="https://www.cncard.net/purchase/getorder.asp" method="POST" target="_blank">' . "<input type=\"hidden\" name=\"c_mid\" value=\"{$c_mid}\" />" . "<input type=\"hidden\" name=\"c_order\" value=\"{$c_order}\" />" . "<input type=\"hidden\" name=\"c_name\" value=\"{$c_name}\" />" . "<input type=\"hidden\" name=\"c_address\" value=\"{$c_address}\" />" . "<input type=\"hidden\" name=\"c_tel\" value=\"{$c_tel}\" />" . "<input type=\"hidden\" name=\"c_post\" value=\"{$c_post}\" />" . "<input type=\"hidden\" name=\"c_email\" value=\"{$c_email}\" />" . "<input type=\"hidden\" name=\"c_orderamount\" value=\"{$c_orderamount}\" />" . "<input type=\"hidden\" name=\"c_ymd\" value=\"{$c_ymd}\" />" . "<input type=\"hidden\" name=\"c_moneytype\" value=\"{$c_moneytype}\" />" . "<input type=\"hidden\" name=\"c_retflag\" value=\"{$c_retflag}\" />" . "<input type=\"hidden\" name=\"c_paygate\" value=\"{$c_paygate}\" />" . "<input type=\"hidden\" name=\"c_returl\" value=\"{$c_returl}\" />" . "<input type=\"hidden\" name=\"c_memo1\" value=\"{$c_memo1}\" />" . "<input type=\"hidden\" name=\"c_memo2\" value=\"{$c_memo2}\" />" . "<input type=\"hidden\" name=\"c_language\" value=\"{$c_language}\" />" . "<input type=\"hidden\" name=\"notifytype\" value=\"{$notifytype}\" />" . "<input type=\"hidden\" name=\"c_signstr\" value=\"{$c_signstr}\" />" . "<input type=\"submit\" name=\"submit\" value=\"" . $GLOBALS['_LANG']['cncard_button'] . "\" />" . "</form>";
     return $def_url;
 }
開發者ID:a494008974,項目名稱:bzbshop,代碼行數:59,代碼來源:cncard.php

示例12: favourable_list

 private function favourable_list($offset = '0, 12')
 {
     /* 查詢 */
     $sql = "SELECT * " . "FROM " . $this->model->pre . "favourable_activity WHERE 1" . " ORDER BY act_id  DESC  LIMIT {$offset}";
     $res = $this->model->query($sql);
     $list = array();
     foreach ($res as $row) {
         $row['start_time'] = local_date('Y-m-d H:i', $row['start_time']);
         $row['end_time'] = local_date('Y-m-d H:i', $row['end_time']);
         $list[] = $row;
     }
     return $list;
 }
開發者ID:noikiy,項目名稱:shop-3,代碼行數:13,代碼來源:FavourableController.class.php

示例13: get_article_info

function get_article_info($article_id)
{
    $sql = "SELECT a.*, IFNULL(AVG(r.comment_rank), 0) AS comment_rank " . "FROM " . $GLOBALS['ecs']->table('article') . " AS a " . "LEFT JOIN " . $GLOBALS['ecs']->table('comment') . " AS r ON r.id_value = a.article_id AND comment_type = 1 " . "WHERE a.is_open = 1 AND a.article_id = '{$article_id}' GROUP BY a.article_id";
    $row = $GLOBALS['db']->getRow($sql);
    if ($row !== false) {
        $row['comment_rank'] = ceil($row['comment_rank']);
        $row['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']);
        if (empty($row['author']) || $row['author'] == '_SHOPHELP') {
            $row['author'] = $GLOBALS['_CFG']['shop_name'];
        }
    }
    return $row;
}
開發者ID:seanguo166,項目名稱:microdistribution,代碼行數:13,代碼來源:ectouch.php

示例14: get_deposit_by_user_id

function get_deposit_by_user_id($user_id, $page, $size)
{
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('deposit') . " WHERE user_id = '{$user_id}'";
    $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
    $arr = array();
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $arr[$row['id']]['id'] = $row['id'];
        $arr[$row['id']]['add_time'] = local_date('Y-m-d', $row['add_time']);
        $arr[$row['id']]['deposit_money'] = price_format($row['deposit_money']);
        $arr[$row['id']]['status'] = $row['status'];
    }
    return $arr;
}
開發者ID:moonlight-wang,項目名稱:feilun,代碼行數:13,代碼來源:v_user_tixianmore.php

示例15: get_package_info

 /**
  * 獲取指定id package 的信息
  *
  * @access  public
  * @param   int         $id         package_id
  *
  * @return array       array(package_id, package_name, goods_id,start_time, end_time, min_price, integral)
  */
 function get_package_info($id)
 {
     global $ecs, $db, $_CFG;
     $id = is_numeric($id) ? intval($id) : 0;
     $now = gmtime();
     $sql = "SELECT act_id AS id,  act_name AS package_name, goods_id , goods_name, start_time, end_time, act_desc, ext_info" . " FROM " . $this->pre . "goods_activity WHERE act_id='{$id}' AND act_type = " . GAT_PACKAGE;
     $package = $this->row($sql);
     /* 將時間轉成可閱讀格式 */
     if ($package['start_time'] <= $now && $package['end_time'] >= $now) {
         $package['is_on_sale'] = "1";
     } else {
         $package['is_on_sale'] = "0";
     }
     $package['start_time'] = local_date('Y-m-d H:i', $package['start_time']);
     $package['end_time'] = local_date('Y-m-d H:i', $package['end_time']);
     $row = unserialize($package['ext_info']);
     unset($package['ext_info']);
     if ($row) {
         foreach ($row as $key => $val) {
             $package[$key] = $val;
         }
     }
     $sql = "SELECT pg.package_id, pg.goods_id, pg.goods_number, pg.admin_id, " . " g.goods_sn, g.goods_name, g.market_price, g.goods_thumb, g.is_real, " . " IFNULL(mp.user_price, g.shop_price * '{$_SESSION['discount']}') AS rank_price " . " FROM " . $this->pre . "package_goods AS pg " . "   LEFT JOIN " . $this->pre . "goods AS g " . "   ON g.goods_id = pg.goods_id " . " LEFT JOIN " . $this->pre . "member_price AS mp " . "ON mp.goods_id = g.goods_id AND mp.user_rank = '{$_SESSION['user_rank']}' " . " WHERE pg.package_id = " . $id . " " . " ORDER BY pg.package_id, pg.goods_id";
     $goods_res = $this->query($sql);
     $market_price = 0;
     $real_goods_count = 0;
     $virtual_goods_count = 0;
     foreach ($goods_res as $key => $val) {
         $goods_res[$key]['goods_thumb'] = get_image_path($val['goods_id'], $val['goods_thumb'], true);
         $goods_res[$key]['market_price_format'] = price_format($val['market_price']);
         $goods_res[$key]['rank_price_format'] = price_format($val['rank_price']);
         $market_price += $val['market_price'] * $val['goods_number'];
         /* 統計實體商品和虛擬商品的個數 */
         if ($val['is_real']) {
             $real_goods_count++;
         } else {
             $virtual_goods_count++;
         }
     }
     if ($real_goods_count > 0) {
         $package['is_real'] = 1;
     } else {
         $package['is_real'] = 0;
     }
     $package['goods_list'] = $goods_res;
     $package['market_package'] = $market_price;
     $package['market_package_format'] = price_format($market_price);
     $package['package_price_format'] = price_format($package['package_price']);
     return $package;
 }
開發者ID:m7720647,項目名稱:demo,代碼行數:58,代碼來源:PackageBaseModel.class.php


注:本文中的local_date函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。