当前位置: 首页>>代码示例>>PHP>>正文


PHP AZLib::getProvinces方法代码示例

本文整理汇总了PHP中AZLib::getProvinces方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::getProvinces方法的具体用法?PHP AZLib::getProvinces怎么用?PHP AZLib::getProvinces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AZLib的用法示例。


在下文中一共展示了AZLib::getProvinces方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: on_submit

 function on_submit()
 {
     $name = Url::get('name');
     $brief_name = Url::get('brief_name');
     $status = Url::get('status', "HIDE");
     $area = (int) Url::get('area');
     $position = (int) Url::get('position', 0);
     $this->checkFormInput('Tên đối tác', 'name', $name, 'str', true, '', 2, 75);
     $this->checkFormInput('Vị trí', 'position', $position, 'int', true, '', 1);
     if ($brief_name == '') {
         $brief_name = $name;
     }
     if (!$this->errNum) {
         $new_row = array('name' => $name, 'brief_name' => $brief_name, 'position' => $position, 'status' => $status, 'area' => $area);
         if (Url::get('cmd') == 'edit') {
             DB::update_id('province', $new_row, $this->province['id']);
         } else {
             DB::insert('province', $new_row);
         }
         AZLib::getProvinces(1, true);
         Url::redirect_current();
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:23,代码来源:edit.php

示例2: item_same_category_form

 function item_same_category_form()
 {
     global $display;
     AZLib::getProvinces();
     AZLib::getCats();
     $item_id = (int) Url::get('item_id');
     $sql = 'SELECT id, name, list_brief, offer, modify_time, sku, read_count, category_id, currency_id, price, price_out, img_url, img_server FROM item WHERE';
     $where = " id!={$item_id}";
     if (CGlobal::$curCategory) {
         $where .= ($where != '' ? " AND " : "") . " category_id = " . CGlobal::$curCategory;
     }
     $where .= ($where != '' ? " AND " : "") . " status=1";
     if (CGlobal::$curCity) {
         // $where = " province_id = " . CGlobal::$curCity . ($where != '' ? " AND " : "") . $where;//ngannv comment vì k có trường province id trong bảng item
     }
     $sql .= "{$where} ORDER BY item_order ASC";
     $divID = 'item_same_cat';
     $code = 'item_same_cat';
     $url_path = WEB_DIR . "ajax.php?act=item&code=item_same_category&category_id=" . CGlobal::$curCategory . "&item_id={$item_id}";
     $limit = '';
     $item_per_page = 3;
     $i = 1;
     $pagging = AZPagging::AjaxPagingNext($limit, $item_per_page, true, 'p_item_same', $url_path, $divID);
     $sql .= $limit;
     $items = array();
     $re = DB::query($sql);
     if ($re) {
         while ($item = mysql_fetch_assoc($re)) {
             if ($i <= $item_per_page) {
                 if (isset(CGlobal::$allCategories[$item['category_id']])) {
                     $item['href'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                 } else {
                     $item['href'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                 }
                 $item['modify_time'] = date('H:i | d.m.y', $item['modify_time']);
                 $item['price_num'] = (int) $item['price'];
                 if ($item['price']) {
                     $item['price'] = number_format($item['price'], 0, ',', '.');
                 } else {
                     $item['price'] = '';
                 }
                 $item['price_title'] = 'Giá bán';
                 if ($item['price_out'] > 0) {
                     $item['price_out'] = number_format($item['price_out'], 0, ',', '.') . ($item['currency_id'] == ' ' ? ' ' . CGlobal::$currency[$item['currency_id']] : '');
                 } else {
                     $item['price_out'] = '0';
                 }
                 //$item['price'] 			= AZLib::convertCurrency($item['price'],			$item['currency_id']);
                 //$item['price_out'] 		= AZLib::convertCurrency($item['price_out'],		$item['currency_id']);
                 $item['name'] = AZLib::filter_title($item['name']);
                 if ($item['img_url']) {
                     $item['img_thumb_wl'] = AZLib::getImageThumb($item['img_url'], 180, 0, 1, $item['img_server']);
                 } else {
                     $item['img_url'] = '';
                 }
                 if (!CGlobal::$curLevel2Cat) {
                     if (isset(CGlobal::$allCategories[$item['category_id']])) {
                         $item['cat_name'] = CGlobal::$allCategories[$item['category_id']]['name'];
                     } else {
                         $item['cat_name'] = "ID: {$item['category_id']}";
                     }
                 }
                 $items[$item['id']] = $item;
                 /* 
                                    $value['price'] = AZLib::convertCurrency($value['price'], $value['currency_id']);
                                   $value['currency_id'] = 1;
                                  
                                    if (isset(CGlobal::$allCategories[$value['category_id']]))
                                     {
                                         $value['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $value['id'] . '&ebname=' . AZLib::safe_title($value['name']) . '&nice_name=' . CGlobal::$allCategories[$value['category_id']]['nice_name']);
                                     } else {
                                         $value['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $value['id'] . '&ebname=' . AZLib::safe_title($value['name']));
                                     }
                 
                                     $value['item_time'] = date('h:i | d.m', $value['modify_time']);
                 
                 
                                     $value['price_name'] = 'Giá bán';
                                     $value['item_type'] = 'Giao dịch bán';
                 
                                     $value['name'] = strip_tags(AZLib::filter_title($value['name']));
                 
                                     if ($value['price'] && $value['price'] > 0) {
                                         $value['price'] = number_format($value['price'], 0, ',', '.');
                                         $value['currency_id'] = CGlobal::$currency[$value['currency_id']];
                                     } else {
                                         $value['price'] = 'Liên hệ';
                                         $value['currency_id'] = '';
                                     }
                 
                                     if ($value['img_url']) {
                                         $value['img_url'] = AZLib::getImageThumb($value['img_url'], 80, 80, 0, $value['img_server']);
                                     } else {
                                         $value['img_url'] = 'style/images/no-images-69x53.jpg';
                                     }
                 
                                     $items[$value['id']] = $value;
                 */
             }
             $i++;
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_item.ajax.php

示例3: unset

//Khởi tạo các biến hệ thống:
global $server_list;
CGlobal::$my_server = $server_list;
unset($server_list);
if (MEMCACHE_ON) {
    require_once ROOT_PATH . 'core/AZMemcache.php';
}
require_once ROOT_PATH . 'core/AZLib.php';
require_once ROOT_PATH . 'core/AZArrCache.php';
require_once ROOT_PATH . 'core/System.php';
require_once ROOT_PATH . 'core/Url.php';
// Disable ALL magic_quote
set_magic_quotes_runtime(0);
register_shutdown_function(array("DB", "close"));
$js_file = ROOT_PATH . "javascript/enbac/cities.js";
AZLib::getProvinces();
echo "<pre>";
print_r(CGlobal::$provinces);
echo "</pre>";
$cities = array();
if (CGlobal::$provinces) {
    foreach (CGlobal::$provinces as $City) {
        if ($City['id'] != 0) {
            $tp = array("id" => $City['id'], "url" => "tp{$City['id']}/{$City['ebname']}.html", "bdsurl" => "bds{$City['id']}/{$City['ebname']}.html", "name" => $City['name']);
            if ($City['status'] == 'HOME') {
                $cities['HOME'][] = $tp;
            } else {
                if ($City['area'] == 1) {
                    $cities['NORTHEN'][] = $tp;
                } elseif ($City['area'] == 2) {
                    $cities['MIDDLE'][] = $tp;
开发者ID:duynhan07,项目名称:elink,代码行数:31,代码来源:citygen.php

示例4: draw


//.........这里部分代码省略.........
         $search_value .= ' AND id=' . $id_search;
     }
     if ($id_search == 0) {
         $id_search = '';
     }
     $display->add('id_search', $id_search);
     // search ô textbox	tài khoản
     if (Url::get('text_value') != '') {
         $text_value = Url::get('text_value');
         $display->add('text_value', $text_value);
         $str_search = str_replace("'", '"', $text_value);
         $str_search = str_replace("&#39;", '"', $str_search);
         $str_search = str_replace("&quot;", '"', $str_search);
         $search_value .= " AND (user_name LIKE '%" . $str_search . "%'  OR email LIKE '%" . $str_search . "%')";
     }
     // search so dien thoai
     if (Url::get('id_phone') != '') {
         $id_phone = Url::get('id_phone');
         $search_value .= " AND (home_phone LIKE '%" . $id_phone . "%'  OR mobile_phone LIKE '%" . $id_phone . "%')";
     }
     $display->add('id_phone', Url::get('id_phone'));
     $item_per_page = Url::get('item_per_page', 50);
     $sql_count = 'SELECT COUNT(id) AS total_item FROM user WHERE ' . $search_value;
     $total = DB::fetch($sql_count, 'total_item', 0);
     $items = array();
     $str_id = '';
     $uids = '';
     if ($total) {
         $limit = '';
         $paging = AZPagging::pagingSE($limit, $total, $item_per_page, 10, 'page_no', true, 'Thành viên', 'Trang');
         $sql = 'SELECT * FROM user WHERE ' . $search_value . ' ' . $order_by . $limit;
         $result = DB::query($sql);
         if ($result) {
             AZLib::getProvinces();
             while ($row = mysql_fetch_assoc($result)) {
                 if ($row['block_time'] > TIME_NOW || $row['block_time'] == -1 || $row['invalid_time'] > 0 || $row['invalid_time'] == -1) {
                     $str_id .= ($str_id == '' ? '' : ',') . $row['id'];
                 }
                 $row['create_time'] = date('d/m/y H:i', $row['create_time']);
                 if ($row['last_login']) {
                     $row['last_login'] = date('d/m/y H:i', $row['last_login']);
                 } else {
                     $row['last_login'] = false;
                 }
                 if ($row['block_time'] > TIME_NOW || $row['block_time'] == -1) {
                     if ($row['block_time'] != -1) {
                         $row['status'] = "<font color=red><b>" . date('H:i d/m/y', $row['block_time']) . '</b></font>';
                     } else {
                         $row['status'] = '<font color=red><b>Khóa vĩnh viễn</b></font>';
                     }
                     $row['bgcolor'] = 'bgcolor="#CCCCCC"';
                     $row['is_block'] = true;
                     $display->add('type_reason', 'Khóa');
                 } else {
                     $row['status'] = "";
                     $row['bgcolor'] = '';
                     $row['is_block'] = false;
                 }
                 if ($row['invalid_time'] > 0 || $row['invalid_time'] == -1) {
                     $row['status'] = $row['invalid_time'] == -1 ? "<font color=red><b>kiểm duyệt vĩnh viễn</b></font>" : "<font color=red><b>" . date('H:i d/m/y', $row['invalid_time']) . '</b></font>';
                     $row['is_invalid'] = true;
                     $display->add('type_reason', 'Kiểm duyệt');
                 } else {
                     //$row['status'] = "";
                     //$row['bgcolor'] = '';
                     $row['is_invalid'] = false;
开发者ID:duynhan07,项目名称:elink,代码行数:67,代码来源:UserAdmin.php

示例5: draw_from

 function draw_from()
 {
     //mb_internal_encoding("UTF-8");
     //AZLib::getCats();
     AZLib::getProvinces();
     global $display;
     $page_no = (int) Url::get('page_no', 1);
     if ($page_no <= 0) {
         $page_no = 1;
     }
     $admin_item = FALSE;
     if (User::have_permit(ADMIN_ITEM)) {
         $admin_item = TRUE;
     }
     $item_per_page = 30;
     $sql = 'SELECT * FROM item WHERE ';
     $where = '';
     $curMainCat = CGlobal::$curMainCat;
     $curLevel2Cat = CGlobal::$curLevel2Cat;
     /*if($curLevel2Cat){
                   $where		.=($where!=''?" AND ":"")." level_2_catid = ".$curLevel2Cat['id'];
               }
               elseif($curMainCat){
                   $where		.=($where!=''?" AND ":"")." level_1_catid = ".$curMainCat['id'];
               }
     
               $where	.= ($where!=''?" AND ":"")." status=1";
     
               $sql		.= "$where ORDER BY item_order ASC";*/
     if (!CGlobal::$item_condition) {
         //Ngannv hack code trường hợp khong add module FilterMenu hoặc module Build
         if (isset($_GET['category_id']) && $_GET['category_id']) {
             CGlobal::$item_condition = " category_id = " . CGlobal::$curCategory . " ";
         }
     }
     $sql .= CGlobal::$item_condition . " ORDER BY item_order ASC";
     $total_row = DB::count("item", CGlobal::$item_condition);
     if (CGlobal::$allCategories[CGlobal::$curCategory]['parent_id'] && isset(CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']])) {
         $ebname = CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']]['ebname'] . '-' . CGlobal::$allCategories[CGlobal::$curCategory]['ebname'];
     } else {
         $ebname = CGlobal::$allCategories[CGlobal::$curCategory]['ebname'];
     }
     #######################################################################################
     #Paging
     $url_new = "?page=list_detail&category_id=" . CGlobal::$curCategory . "&ebname=" . $ebname;
     $url_addend = "";
     $filter_get = Url::get('filter');
     $min = Url::get('min');
     $max = Url::get('max');
     $order = Url::get('order');
     if ($filter_get) {
         foreach ($filter_get as $get_gid => $get_fid) {
             $url_addend .= ($url_addend != '' ? '&' : '?') . "filter[{$get_gid}]={$get_fid}";
         }
     }
     if ($min) {
         $url_addend .= ($url_addend != '' ? '&' : '?') . "min={$min}";
     }
     if ($max) {
         $url_addend .= ($url_addend != '' ? '&' : '?') . "max={$max}";
     }
     if ($order) {
         $url_addend .= ($url_addend != '' ? '&' : '?') . "order={$order}";
     }
     $limit = '';
     $paging = AZPagging::paging_list($limit, $total_row, $item_per_page, 10, 'page_no', $url_new, TRUE, 'Sản phẩm', 'Trang', $url_addend);
     //$paging = AZPagging::paging_list($limit,$item_per_page,'page_no',$url_new);
     $sql .= $limit;
     #Paging
     #######################################################################################
     $items = array();
     $re = DB::query($sql);
     if ($re) {
         while ($item = mysql_fetch_assoc($re)) {
             $items[$item['id']] = $this->processItem($item, $admin_item);
         }
     }
     $display->add('admin_item', $admin_item);
     $display->add('page', $page_no);
     $display->add('items', $items);
     $display->add('paging', $paging);
     $display->output("ListItem");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:83,代码来源:ListItem.php

示例6: load_shop_label

    function load_shop_label()
    {
        if (!CGlobal::$user_profile) {
            User::check_get_user();
        }
        if (CGlobal::$user_profile) {
            $mode_default = 'comment';
            if (!CGlobal::$shop_setting) {
                if (CGlobal::$user_profile['shop_setting']) {
                    CGlobal::$shop_setting = unserialize(stripslashes(CGlobal::$user_profile['shop_setting']));
                }
                if (!CGlobal::$shop_setting) {
                    CGlobal::$shop_setting = array('shop_name' => CGlobal::$user_profile['full_name'] ? CGlobal::$user_profile['full_name'] : CGlobal::$user_profile['user_name'], 'default_mode' => 1, 'default_layout' => 1, 'item_list_mode' => 0, 'adv_banner' => '');
                }
            }
            if (CGlobal::$shop_setting && !isset(CGlobal::$shop_setting['default_layout'])) {
                CGlobal::$shop_setting['default_layout'] = 1;
            }
            if (Url::get("mode") == "comment" || CGlobal::$shop_setting['default_mode'] == 2) {
                CGlobal::$website_title = 'Lưu bút - Shop ' . CGlobal::$user_profile['user_name'];
            }
            if (!CGlobal::$shop_setting['default_mode']) {
                if (Url::get('mode') == 'shop' || DB::select('item', 'user_id=' . CGlobal::$user_profile['id'] . ' AND status=1')) {
                    //Nếu có sp, mặc định là vào shop
                    CGlobal::$shop_setting['default_mode'] = 1;
                    $mode_default = 'shop';
                } else {
                    //Nếu ko có sản phẩm, mặc định vào lưu bút
                    CGlobal::$shop_setting['default_mode'] = 2;
                    $mode_default = 'comment';
                }
            } else {
                if (CGlobal::$shop_setting['default_mode'] == 1) {
                    $mode_default = 'shop';
                } else {
                    $mode_default = 'comment';
                }
            }
        }
        if (CGlobal::$shop_label) {
            CGlobal::$website_title .= ' | ' . CGlobal::$shop_label['name'];
            $this->label_id = CGlobal::$shop_label['id'];
        } else {
            $this->label_id = (int) Url::get('label_id', 0);
            if ($this->label_id) {
                CGlobal::$shop_label = DB::select("label", "id=" . $this->label_id);
            }
            if (!CGlobal::$shop_label) {
                $this->label_id = 0;
            }
        }
        $page_shop_item = (int) Url::get('page_shop_item', 1);
        $label_id = (int) Url::get("label_id", 0);
        $list_type = (int) Url::get("list_type", 0);
        global $display;
        $display->add('top_level_id', $label_id);
        $display->add('list_type', $list_type);
        $display->add('can_edit', User::have_permit(ADMIN_ITEM) || User::id() == CGlobal::$user_profile['id']);
        $status_check = User::id() == CGlobal::$user_profile['id'] || User::have_permit(ADMIN_ITEM) ? ' status IN(0,1,2,3,4,5)' : ' status =1';
        if ($label_id) {
            $total_item = DB::fetch('SELECT count(*) AS total_row FROM label_item AS L JOIN item AS I ON L.item_id=I.id AND I.' . $status_check . ' AND I.user_id=' . CGlobal::$user_profile['id'] . ' WHERE L.user_id=' . CGlobal::$user_profile['id'] . ' AND L.label_id=' . $label_id, 'total_row', 0);
        } else {
            $total_item = DB::fetch('SELECT count(*) AS total_row FROM item WHERE ' . $status_check . ' AND user_id=' . CGlobal::$user_profile['id'], 'total_row', 0);
        }
        $pagging = '';
        $items = array();
        $divID = 'shop_item';
        $item_per_page = 0;
        if ($total_item) {
            $item_per_page = 9;
            $limit = '';
            $url_path = WEB_DIR . 'ajax.php?act=shop&code=load_shop_label&user_id=' . CGlobal::$user_profile['id'] . '&label_id=' . $label_id . (!$list_type ? '' : '&list_type=' . $list_type);
            $pagging = AZPagging::AjaxPaging($limit, $total_item, $item_per_page, 5, 'page_shop_item', '', false, false, $url_path, $divID, true);
            if ($label_id) {
                $display->add('label_name', CGlobal::$shop_label['name']);
                $select = 'SELECT I.id, I.name,I.sapo, I.user_name, I.user_id,I.description,I.category_id, I.read_count, I.reply_count, I.currency_id, I.price, I.province_id, I.up_time,I.price_out, I.brief, I.img_url, I.status, I.state, I.img_server
				FROM label_item AS L JOIN item AS I ON L.item_id=I.id AND I.' . $status_check . ' AND I.user_id=' . CGlobal::$user_profile['id'] . ' WHERE L.user_id=' . CGlobal::$user_profile['id'] . ' AND L.label_id=' . $label_id . ' ORDER BY shop_order, up_time DESC' . $limit;
            } else {
                $select = 'SELECT id, name, sapo, user_name, user_id, description, category_id, read_count, reply_count, currency_id, price, brief, img_url, province_id, up_time, price_out, status, state, img_server,sticky FROM item WHERE ' . $status_check . ' AND user_id=' . CGlobal::$user_profile['id'] . ' ORDER BY shop_order, up_time DESC' . $limit;
            }
            $re = DB::query($select);
            if (User::is_login()) {
                $wids = User::get_wishlist('wish_list_items');
                $w_items = array();
                if ($wids) {
                    $w_items = explode(',', $wids);
                }
            }
            if ($re) {
                AZLib::getProvinces();
                AZLib::getCats();
                $item_ids = '';
                while ($item = mysql_fetch_assoc($re)) {
                    $item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']);
                    $item['price_out'] = AZLib::convertCurrency($item['price_out'], $item['currency_id']);
                    $item['currency_id'] = 1;
                    if ($item['img_url']) {
                        $item['image_url'] = AZLib::getImageThumb($item['img_url'], 200, 200, 0, $item['img_server']);
                    }
                    if (isset(CGlobal::$allCategories[$item['category_id']])) {
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_shop.ajax.php


注:本文中的AZLib::getProvinces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。