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


PHP AZLib::getOption方法代码示例

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


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

示例1: draw

 function draw()
 {
     global $display;
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add("url_admin", Url::build_current());
     $status_select = Url::get('status_select', 6);
     //1:Chưa cập nhật; 2: Đã gửi đơn hàng ; 3: Đã TT; 4: Hủy đơn hàng; 5: Đã duyệt
     $status_arr = array(6 => "--Tất cả--", 2 => "Đã gửi đơn hàng", 1 => "Chưa cập nhật", 3 => "Đã Thanh toán", 5 => "Đã duyệt", 4 => "Đã hủy");
     $display->add("status_option", AZLib::getOption($status_arr, $status_select));
     $date_begin = Url::get('date_begin');
     $date_end = Url::get('date_end');
     $display->add("date_begin", $date_begin);
     $display->add("date_end", $date_end);
     $created_time_from = 0;
     $created_time_to = 0;
     if ($date_begin) {
         $date_arr = explode("-", $date_begin);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_from = mktime(0, 0, 0, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     if ($date_end) {
         $date_arr = explode("-", $date_end);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_to = mktime(23, 59, 59, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     $condition = "";
     if ($status_select != 6) {
         $condition .= "status=" . $status_select;
     }
     if ($created_time_from) {
         $condition .= ($condition != '' ? ' AND ' : '') . ' time_create >=' . $created_time_from;
     }
     if ($date_end) {
         $condition .= ($condition != '' ? ' AND ' : '') . " time_create <={$created_time_to}";
     }
     $total = DB::count("cart", $condition);
     $limit = '';
     $display->add('paging', AZPagging::paging_list($limit, $total, 40, 10, 'page_no', '', true, 'Đơn hàng'));
     $all_carts = array();
     $re = DB::query("SELECT * FROM cart " . ($condition != '' ? 'WHERE ' : '') . $condition . " ORDER BY id DESC {$limit}");
     if ($re) {
         while ($Cart = mysql_fetch_assoc($re)) {
             $Cart["time_create"] = date('d/m/Y H:i:s', $Cart['time_create']);
             $Cart["time_change"] = date('d/m/Y H:i:s', $Cart['time_change']);
             $Cart["url"] = Url::build_current(array('cmd' => 'edit', 'id' => $Cart['id']));
             $Cart["status"] = $status_arr[$Cart['status']];
             $Cart["delete"] = Url::build_current(array('cmd' => 'delete', 'id' => $Cart['id']));
             $Cart["price"] = number_format($Cart['price'], null, null, '.');
             $all_carts[$Cart['id']] = $Cart;
         }
     }
     $display->add('all_carts', $all_carts);
     $display->add('is_admin', User::is_admin());
     $this->beginForm();
     $display->output('CartAdmin');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:59,代码来源:CartAdmin.php

示例2: draw

 function draw()
 {
     global $display;
     $this->beginForm();
     if (Url::get('cmd') == 'edit') {
         $display->add('mode', "Sửa");
     } elseif (Url::get('cmd') == 'copy') {
         $display->add('mode', "Copy");
     } else {
         $display->add('mode', "Thêm");
     }
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('name', Url::get('name', $this->page['name']));
     $display->add('title', Url::get('title', $this->page['title']));
     $display->add('description', Url::get('description', $this->page['description']));
     $display->add('option_layout', AZLib::getOption($this->get_all_layouts(), Url::get('status', $this->page['layout'])));
     $display->output('edit');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:19,代码来源:edit.php

示例3: draw

 function draw()
 {
     global $display;
     $re = DB::query('SELECT block.id, block.module_id, block.page_id, block.region, block.position,module.name FROM `block`  INNER JOIN module ON module.id=module_id WHERE page_id=' . $_REQUEST['id'] . ' ORDER BY position');
     $this->all_blocks = array();
     if ($re) {
         while ($block = mysql_fetch_assoc($re)) {
             $this->all_blocks[$block['id']] = $block;
         }
     }
     if (file_exists($this->page['layout'])) {
         $this->layout_text = file_get_contents($this->page['layout']);
     }
     $this->get_regions();
     $text = $this->layout_text . ($this->undefined_regions ? '<p><h1>Các module ngoài Layout</h1>[[|undefined_regions|]]</p>' : '');
     $result = '';
     while (($pos = strpos($text, '[[|')) !== false) {
         if ($pos2 = strpos($text, '|', $pos + 3)) {
             $var = substr($text, $pos + 3, $pos2 - $pos - 3);
             if (isset($this->regions[$var])) {
                 $item = $this->regions[$var];
             }
             if ($item) {
                 $result .= substr($text, 0, $pos) . $item;
                 $text = substr($text, $pos2 + 3, strlen($text) - $pos2 - 3);
             } else {
                 $result .= substr($text, 0, $pos + 3);
                 $text = substr($text, $pos + 3, strlen($text) - $pos - 3);
             }
         } else {
             $result .= substr($text, 0, $pos + 3);
             $text = substr($text, $pos + 3, strlen($text) - $pos - 3);
         }
     }
     $regions = $result . $text;
     $display->add('name', $this->page['name']);
     $display->add('id', $this->page['id']);
     $display->add('regions', $regions);
     $display->add('option_layout', AZLib::getOption($this->get_all_layouts(), Url::get('status', $this->page['layout'])));
     $display->add('page_content', $this->page);
     $display->output('page_content');
 }
开发者ID:duynhan07,项目名称:elink,代码行数:42,代码来源:page_content.php

示例4: draw

 function draw()
 {
     global $display;
     $this->beginForm();
     if (Url::get('cmd') == 'edit') {
         $display->add('mode', "Sửa");
     } else {
         $display->add('mode', "Thêm");
     }
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('name', Url::get('name', $this->province['name']));
     $display->add('brief_name', Url::get('brief_name', $this->province['brief_name']));
     $display->add('area', Url::get('url', $this->province['area']));
     $display->add('position', (int) Url::get('position', $this->province['position']));
     $display->add('total_item', (int) Url::get('position', $this->province['total_item']));
     $display->add('option_area', AZLib::getOption(array(1 => 'Bắc', 2 => 'Trung', 3 => 'Nam'), Url::get('area', $this->province['area'])));
     $display->add('option_status', AZLib::getOption(array('SHOW' => 'Hiện', 'HIDE' => 'Ẩn', 'HOME' => 'HOME'), Url::get('status', $this->province['status'])));
     $display->output('edit');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:20,代码来源:edit.php

示例5: draw

 function draw()
 {
     global $display;
     $this->beginForm(true);
     $cmd = Url::get('cmd');
     $display->add('cmd', $cmd);
     $re = DB::query("SELECT id,name,parent_id ,position FROM category ORDER BY parent_id,position");
     $all_cats = array();
     $all_subcats = array();
     $all_top_cat = array(0 => '-Chọn danh mục cha-');
     $level1_cats = array();
     $level2_cats = array();
     if ($re) {
         while ($cat = mysql_fetch_assoc($re)) {
             $cat['name'] = "[{$cat['id']}] {$cat['name']}";
             if ($cat['parent_id']) {
                 if (!isset($all_cats[$cat['parent_id']])) {
                     $level1_cats[$cat['parent_id']] = array('id' => $cat['parent_id'], 'name' => "[{$cat['parent_id']}] Đã xóa (ko tồn tại)", "max" => $cat['position']);
                 }
                 $all_subcats[$cat['parent_id']][$cat['id']] = $cat;
                 $cat['max'] = 0;
                 if ($cat['position'] > $level1_cats[$cat['parent_id']]['max']) {
                     $level1_cats[$cat['parent_id']]['max'] = $cat['position'];
                 }
                 $level2_cats[$cat['id']] = $cat;
             } else {
                 $cat['max'] = 0;
                 $level1_cats[$cat['id']] = $cat;
                 if (!isset($all_subcats[$cat['id']])) {
                     $all_subcats[$cat['id']] = array();
                 }
             }
             $all_cats[$cat['id']] = $cat;
         }
     }
     $display->add('level1_cats', json_encode($level1_cats));
     $display->add('level2_cats', json_encode($level2_cats));
     foreach ($all_subcats as $topid => $subcats) {
         if (isset($level1_cats[$topid]) && $level1_cats[$topid]['max']) {
             if (!isset($all_cats[$topid])) {
                 $all_cats[$topid] = array('id' => $topid, 'name' => "[{$topid}] Đã xóa (ko tồn tại)");
             }
             $all_cats[$topid]['name'] .= " ({$level1_cats[$topid]['max']})";
         }
         $all_top_cat[$topid] = $all_cats[$topid]['name'];
         foreach ($subcats as $subcat) {
             if (isset($level2_cats[$subcat['id']]) && $level2_cats[$subcat['id']]['max']) {
                 $subcat['name'] .= " ({$level2_cats[$subcat['id']]['max']})";
             }
             $all_top_cat[$subcat['id']] = "-----" . $subcat['name'];
         }
     }
     if (!isset($this->cat['id'])) {
         $this->cat['id'] = 0;
     }
     $display->add('cat_image', AZLib::getImageThumb('category/' . $this->cat['id'] . '.gif', 200, 200, 0, $this->cat['img_server']));
     $display->add('msg', $this->showFormErrorMessages(true));
     $display->add('name', Url::get('name', $this->cat['name']));
     $display->add('brief_name', Url::get('brief_name', $this->cat['brief_name']));
     $display->add('keywords', Url::get('keywords', $this->cat['keywords']));
     $display->add('description', Url::get('description', $this->cat['description']));
     $display->add('option_parent_id', AZLib::getOption($all_top_cat, Url::get('parent_id', $this->cat['parent_id'])));
     $display->add('option_status', AZLib::getOption(array('HIDE' => 'Ẩn', 'SHOW' => 'SHOW', 'HOME' => 'HOME'), Url::get('status', $this->cat['status'])));
     $max_pos = 1 + DB::fetch("SELECT MAX(position) AS max_pos FROM category WHERE parent_id=0", "max_pos", 0);
     $display->add('max_pos', $max_pos);
     if (Url::get('cmd') == 'add' || Url::get('cmd') == 'edit' && $this->cat['parent_id'] == 0) {
         //Sửa danh mục
         $zones = array();
         if (Url::get('cmd') == 'edit' && $this->cat['parent_id'] == 0) {
             //Sửa danh mục
             $zones = $this->zones;
         }
         $re = DB::query("SELECT id,name, status FROM category_zone ORDER BY position");
         $all_zone = array();
         if ($re) {
             while ($zone = mysql_fetch_assoc($re)) {
                 if ($zone['status'] == 0) {
                     $zone['name'] .= ' (Ẩn)';
                 }
                 $all_zone[$zone['id']] = $zone['name'];
             }
         }
         $display->add('option_zones', AZLib::getOptionMulti($all_zone, array_keys($zones)));
     }
     if (Url::get('cmd') == 'edit') {
         //Sửa danh mục
         $display->add('option_position', AZLib::getOptionNum(1, $max_pos, Url::get('position', $this->cat['position'])));
         $display->add('cur_position', $this->cat['position']);
     } else {
         $display->add('option_position', AZLib::getOptionNum(1, $max_pos, Url::get('position', $max_pos)));
         $display->add('cur_position', 0);
     }
     $filter_groups = array();
     $other_filter_groups = CGlobal::$all_gfilters;
     $max_pos_gfilter = 1;
     if ($this->cat['id']) {
         /*$max_pos_gfilter = 1 + DB::fetch("SELECT MAX(pos) AS max_pos FROM filter_group WHERE catid=".$this->cat['id']."","max_pos",0);
         	
         		$re = DB::query("SELECT * FROM filter_group WHERE catid=".$this->cat['id']." ORDER BY pos");
         		
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:CategoryEdit.php

示例6: draw

 function draw()
 {
     global $display;
     AZLib::getCats();
     $this->beginForm(false, 'post', false, Url::build_current());
     $created_time_from = 0;
     $created_time_to = 0;
     $time_from = "";
     $time_to = "";
     $phrase_checked = "";
     $free_cat_checked = "";
     $up_checked = "";
     $pagging = "";
     $limit = "";
     $lock_checked = '';
     $select_subcat_checked = '';
     $items = array();
     $id_search = (int) Url::get("id_search");
     $censor = Url::get("censor", 1);
     $user_name = AZLib::getParam("user_name");
     $zone_id = Url::get("zone_id");
     $searchByCat = Url::get("searchByCat");
     $searchByCatType = Url::get("searchByCatType", 0);
     $searchBySubCat = Url::get("searchBySubCat");
     $searchBySubCatType = Url::get("searchBySubCatType", 0);
     $sort_type = Url::get("sort_type", 1);
     $keywords = Url::get("keywords");
     $have_img = Url::get("have_img", 0);
     $lock_item = Url::get("lock");
     $phrase_selected = Url::get("phrase");
     $free_cat_selected = Url::get("free_cat");
     $up = Url::get("up");
     $select_subcat = Url::get("select_subcat", "");
     $opt_have_img = AZLib::getOption(array(0 => "-Tìm theo ảnh-", 1 => "-Có ảnh-", 2 => "-Không ảnh-"), $have_img);
     if (isset($_REQUEST["created_time"]) && $_REQUEST["created_time"]) {
         $time_from = Url::get("created_time");
     }
     if (isset($_REQUEST["created_time_to"]) && $_REQUEST["created_time_to"]) {
         $time_to = Url::get("created_time_to");
     }
     if ($time_from) {
         $date_arr = explode("-", $time_from);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_from = mktime(0, 0, 0, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     if ($time_to) {
         $date_arr = explode("-", $time_to);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_to = mktime(23, 59, 59, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     $search_value = "";
     $where = "";
     //$order_by   	= "ORDER BY del_time DESC";
     $order_by = "";
     $total_item = 0;
     if ($keywords) {
         $search_value = ($search_value == "" ? " WHERE " : " AND ") . "id IN (0)";
     }
     if ($sort_type == 1) {
         $order_by = "ORDER BY id DESC";
     } elseif ($sort_type == 2) {
         $order_by = "ORDER BY modify_time DESC";
     } elseif ($sort_type == 3) {
         $order_by = "ORDER BY item_order ASC";
     }
     if ($free_cat_selected) {
         $free_cat_checked = "checked";
         $catids = implode(",", array_keys(CGlobal::$allCategories));
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "category_id NOT IN({$catids})";
         $order_by = $order_by != "" ? $order_by : "ORDER BY id DESC";
     } else {
         if ($searchBySubCat) {
             if ($searchBySubCatType) {
                 // Nếu chỉ tìm trong danh mục con của danh mục cấp 2
                 $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "level_2_catid = " . $searchBySubCat;
                 // Lọc những item có trường level_2_catid là danh mục cấp 2
             } else {
                 $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "category_id = " . $searchBySubCat;
                 // Ngược lại, lấy các bản ghi thuộc chính danh mục cấp 2
             }
         } elseif ($searchByCat) {
             // Nếu chỉ tìm trong danh mục con của danh mục cấp 1
             if ($searchByCatType) {
                 // Lọc những item có trường level_1_catid là danh mục cấp 1
                 $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "level_1_catid = " . $searchByCat;
             } else {
                 // Ngược lại, lấy các bản ghi thuộc chính danh mục cấp 1
                 $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "category_id = " . $searchByCat;
             }
         }
     }
     if ($censor != 9) {
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "status=" . $censor;
     }
     if ($user_name != "") {
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "user_name ='{$user_name}'";
     }
     if ($select_subcat) {
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ManageItem.php

示例7: draw

 function draw()
 {
     require_once 'modules/ManageContent/forms/ManageContent.php';
     $this->beginForm();
     global $display;
     $display->add('action', AZLib::getParam('action'));
     $total = $this->total_record ? $this->total_record : Url::get('total');
     if ($total) {
         $this->setFormSucces("", "Đã gửi tin nhắn cho {$total} thành viên!");
     }
     $display->add('msg', $this->showFormSuccesMessages(1));
     $display->add('send_all', AZLib::getParam('send_all'));
     $display->add('user_sell', AZLib::getParam('user_sell'));
     $display->add('subject', AZLib::getParam('subject'));
     $display->add('content', AZLib::getParam('content'));
     $display->add('item_cat', AZLib::getOption(ManageContentForm::getOtionCats(), Url::get('id_cats')));
     $display->output('send_multi_mess');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:19,代码来源:send_multi_mess.php

示例8: draw

 function draw()
 {
     global $display;
     $this->beginForm(true);
     $display->add('mode', "Thêm");
     $display->add('msg', $this->showFormErrorMessages(1));
     $status_arr = array(1 => "OK", 2 => "Disable");
     $display->add('status_option', AZLib::getOption($status_arr, Url::get('status', $this->a_row['status'])));
     $display->add('h_start_option', AZLib::getOptionNum(0, 23, Url::get('h_start', date('h', $this->a_row['time_start']))));
     $display->add('min_start_option', AZLib::getOptionNum(0, 59, Url::get('min_start', date('i', $this->a_row['time_start']))));
     $display->add('date_start', Url::get('date_start', date('d-m-Y', $this->a_row['time_start'])));
     $display->add('h_end_option', AZLib::getOptionNum(0, 23, Url::get('h_end', date('h', $this->a_row['time_end']))));
     $display->add('min_end_option', AZLib::getOptionNum(0, 59, Url::get('min_end', date('i', $this->a_row['time_end']))));
     $display->add('date_end', Url::get('date_end', date('d-m-Y', $this->a_row['time_end'])));
     $display->add('title', Url::get('title', $this->a_row['title']));
     $display->add('note', Url::get('note', $this->a_row['note']));
     $display->output('e_product_add');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:19,代码来源:EventEdit.php

示例9: draw


//.........这里部分代码省略.........
         $yahoo_open_id_href = OID_URL . 'index.html?openid_identifier=http://me.yahoo.com/&long_redirect=' . base64_encode(CGlobal::$query_string);
         $google_open_id_href = OID_URL . 'index.html?openid_identifier=https://www.google.com/users/o8/id&long_redirect=' . base64_encode(CGlobal::$query_string);
         $display->add('show_openid', TRUE);
     }
     $display->add('OID_URL', $yahoo_open_id_href);
     $display->add('OID_URL_GOG', $google_open_id_href);
     $display->add('referer_login_url', $referer_login_url);
     $display->add('google_open_id_href', $google_open_id_href);
     $display->add('yahoo_open_id_href', $yahoo_open_id_href);
     $display->add('openid_on', OPENID_ON);
     $display->add('num_mess', $num_mess);
     $display->add('is_login', (int) User::is_login());
     $display->add('is_admin', (int) User::is_az_team());
     $display->add('is_admin_item', (int) User::have_permit(ADMIN_ITEM));
     $display->add('is_root', User::is_root());
     //End Top menu
     $display->add('category_id', CGlobal::$curCategory);
     $display->add('keywords', AZLib::cleanHtml(Url::get('keywords', '')));
     $display->add('not_error_page', (int) (AZNet::$page['name'] != 'error'));
     $display->add('is_load_page_first', $_SESSION['is_load_page_first']);
     // Tỷ giá
     AZLib::get_config();
     //$exchange = CGlobal::$configs['exchange']['conf_val'];
     //$display->add('exchange', number_format($exchange, 0, ',', '.'));
     // End Tỷ giá
     if ($_SESSION['is_load_page_first'] == 1) {
         $_SESSION['is_load_page_first'] = 0;
     }
     //End of top menu
     $curMainCat = CGlobal::$curMainCat;
     $curLevel2Cat = CGlobal::$curLevel2Cat;
     //Cat menu
     $sub_menu = FALSE;
     $sub_menu = $curMainCat && isset(CGlobal::$allCategories[$curMainCat['id']]) && isset(CGlobal::$subCategories[$curMainCat['id']]);
     $display->add('CURENT_TOP_CATID', (int) @$curMainCat['id']);
     $display->add('CURENT_LEVEL2_CATID', (int) @$curLevel2Cat['id']);
     $display->add('CURENT_CITY_ID', CGlobal::$curCity);
     $display->add('cur_page', Url::get('page'));
     $display->add('sub_menu', $sub_menu);
     $display->add('block_id', Module::$block_id);
     // System::debug($display->get_template_vars());
     //End Cat menu
     if (User::is_root()) {
         $display->add("DEBUG", DEBUG);
         $display->add("show_bug_url", AZRewrite::formatUrl(Url::build_all(array(), "ebug=" . (int) (!DEBUG))));
     }
     ################################################################################################################
     #Event config
     $event_on = @CGlobal::$configs['event_on']['conf_val'];
     $submit = Url::get('submit', '');
     if (User::is_admin()) {
         if ($submit == 'Cập nhật') {
             $display->add('msg', $this->showFormErrorMessages(1));
         }
         $status_arr = array(0 => 'Tắt', 1 => 'Bật');
         $display->add('status_option', AZLib::getOption($status_arr, $event_on));
     }
     $display->add('event', $event_on);
     $display->add("data_path", DATA_PATH);
     #Event config
     ################################################################################################################
     ################################################################################################################
     #Search
     $search_catid = (int) Url::get('search_catid');
     $search_cat_arr = array(-1 => '--Tất cả danh mục--');
     foreach (CGlobal::$subCategories as $top_id => $sub_cats) {
         if (isset(CGlobal::$allCategories[$top_id]) && CGlobal::$allCategories[$top_id]['parent_id'] == 0) {
             $topcat = CGlobal::$allCategories[$top_id];
             if ($topcat['status'] != "HIDE") {
                 $search_cat_arr[$top_id] = $topcat['name'];
                 if ($sub_cats) {
                     foreach ($sub_cats as $sid => $subcat) {
                         if ($subcat['status'] != "HIDE") {
                             $search_cat_arr[$sid] = "-----" . $subcat['name'];
                         }
                     }
                 }
             }
         }
     }
     $display->add('search_cat_option', AZLib::getOption($search_cat_arr, $search_catid));
     #Search
     ################################################################################################################
     /*   System::debug($topcats);*/
     $cat_newss = array();
     $news_cat_id = Url::get('news_catid', 'id', 0);
     AZLib::getNewsCats();
     $display->add('news_cat_id', $news_cat_id);
     if (CGlobal::$allNewsCategories) {
         foreach (CGlobal::$allNewsCategories as $news_cat) {
             if ($news_cat['public']) {
                 $news_cat['url'] = URL::build('news_list', array('news_catid' => $news_cat['id'], 'azname' => AZLib::safe_title($news_cat['name'])));
                 $cat_newss[$news_cat['id']] = $news_cat;
             }
         }
     }
     $display->add('cat_newss', $cat_newss);
     $display->output("Header");
     // $display->output("header_old");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:header.php

示例10: draw

 function draw()
 {
     global $display;
     $catid = Url::get('catid', 0);
     $max_name = 0;
     $baners = array();
     $h_banner = array();
     $configs = @CGlobal::$configs['home_banner']['conf_val'];
     if ($configs) {
         $configs = unserialize(stripslashes($configs));
     } else {
         $configs = array();
     }
     $dir = scandir(DATA_PATH . "home_banner/");
     $i = 1;
     foreach ($dir as $fd) {
         if (is_file(DATA_PATH . "home_banner/{$fd}")) {
             $ext = strtolower(AZLib::getExtension($fd));
             if (in_array($ext, array('.swf', '.gif', '.jpg', '.jpeg', '.png'))) {
                 $arr = array();
                 if ($ext == '.swf') {
                     $arr['type'] = 1;
                 } else {
                     $arr['type'] = 2;
                 }
                 $arr['stt'] = $i++;
                 $arr['name'] = (int) basename($fd, $ext);
                 if ($max_name < $arr['name']) {
                     $max_name = $arr['name'];
                 }
                 $arr['path'] = DATA_PATH . "home_banner/{$fd}";
                 $arr['del'] = "?cmd=del_hb&id={$arr['name']}";
                 if (isset($configs[$arr['name']])) {
                     $h_banner[$arr['name']] = $configs[$arr['name']]['time'] . '000';
                     $arr['time'] = $configs[$arr['name']]['time'];
                     if ($configs[$arr['name']]['url'] != '') {
                         $arr['url'] = urldecode($configs[$arr['name']]['url']);
                     } else {
                         $arr['url'] = '';
                     }
                 } else {
                     $h_banner[$arr['name']] = 15000;
                     $arr['time'] = 15;
                     $arr['url'] = '';
                 }
                 $baners[$arr['name']] = $arr;
             }
         }
     }
     $display->add("baners", $baners);
     $display->add("h_banner", json_encode($h_banner));
     $display->add("max", $i - 1);
     $arr = array(0 => "Up mới!");
     if ($max_name > 0) {
         for ($i = 1; $i <= $max_name; $i++) {
             $arr[$i] = "Thay banner {$i}";
         }
     }
     $display->add("hb_option", AZLib::getOption($arr, 0));
     if (User::is_admin()) {
         $display->add("is_admin", 1);
         $display->add("msg", $this->showFormErrorMessages(1));
         $display->add('begin_form', $this->beginForm(TRUE, 'post', FALSE, FALSE, 1));
         $display->add('end_form', $this->endForm(TRUE));
     }
     //ngannv settting   JW Image Rotator
     $display->add("jw_swf_file", STATIC_URL . FOLDER_JS . 'imagerotator/imagerotator.swf');
     $settingFile = DATA_PATH . 'banner_home.php';
     if (!file_exists(ROOT_PATH . $settingFile)) {
         $settingFile = DATA_PATH . 'banner_setting_default.xml';
         //không có file này nữa thì ^^
     }
     $display->add("jw_xml_file", $settingFile);
     //end   JW Image Rotator
     $display->output("IntroBanner");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:76,代码来源:IntroBanner.php

示例11: draw

 function draw()
 {
     global $display;
     $this->beginForm();
     AZLib::getCats();
     $items = array();
     $item_bookings = array();
     $where = '';
     $order = 'id DESC';
     $catid = Url::get('catid', 0);
     $item_id = Url::get('item_id', 0);
     $user_add = Url::get('user_add', '');
     $num_contract = Url::get('num_contract', '');
     $status = Url::get('status', 0);
     $time_start = 0;
     $time_end = 0;
     $date_start = Url::get('date_start');
     $date_end = Url::get('date_end');
     if ($date_start) {
         $arr = explode('-', $date_start);
         $time_start = mktime(0, 0, 0, $arr[1], $arr[0], $arr[2]);
     }
     if ($date_end) {
         $arr = explode('-', $date_end);
         $time_end = mktime(23, 59, 59, $arr[1], $arr[0], $arr[2]);
     }
     if ($time_start >= $time_end) {
         $date_end = '';
         $time_end = 0;
     }
     if ($time_start) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " time_start >= {$time_start}";
         $order = 'time_start ASC, id DESC';
     }
     if ($time_end) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " time_start <= {$time_end}";
     }
     $display->add('date_start', $date_start);
     $display->add('date_end', $date_end);
     $time_start2 = 0;
     $time_end2 = 0;
     $date_start2 = Url::get('date_start2');
     $date_end2 = Url::get('date_end2');
     if ($date_start2) {
         $arr = explode('-', $date_start2);
         $time_start2 = mktime(0, 0, 0, $arr[1], $arr[0], $arr[2]);
     }
     if ($date_end2) {
         $arr = explode('-', $date_end2);
         $time_end2 = mktime(23, 59, 59, $arr[1], $arr[0], $arr[2]);
     }
     if ($time_start2 >= $time_end2) {
         $date_end2 = '';
         $time_end2 = 0;
     }
     if ($time_start2) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " time_end >= {$time_start2}";
         if ($order != 'time_start ASC, id DESC') {
             $order = 'time_end ASC, id DESC';
         }
     }
     if ($time_end2) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " time_end <= {$time_end2}";
     }
     $display->add('date_start2', $date_start2);
     $display->add('date_end2', $date_end2);
     if ($status != 3) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " status = {$status}";
     } elseif ($status == 3) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " status in (0,1)";
     }
     if ($item_id) {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " item_id = {$item_id}";
     }
     if ($user_add != '') {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " user_add = '{$user_add}'";
     }
     if ($num_contract != '') {
         $where .= ($where != '' ? ' AND ' : 'WHERE ') . " num_contract = '{$num_contract}'";
     }
     $zone_id = Url::get("zone_id", 0);
     $arr = array(0 => "-- Tất cả Zone --");
     foreach (CGlobal::$allZones as $zone) {
         $arr[$zone['id']] = $zone['name'];
     }
     $display->add('zone_option', AZLib::getOption($arr, $zone_id));
     $arr = array(0 => "-- Tất cả Danh mục --");
     if (isset(CGlobal::$allCategories[$catid])) {
         if (CGlobal::$allCategories[$catid]['parent_id']) {
             $where .= ($where != '' ? ' AND ' : 'WHERE ') . " cat_id = {$catid}";
         } else {
             if (isset(CGlobal::$subCategories[$catid]) && CGlobal::$subCategories[$catid]) {
                 $where .= ($where != '' ? ' AND ' : 'WHERE ') . " (top_cat = {$catid} OR cat_id IN(" . implode(",", array_keys(CGlobal::$subCategories[$catid])) . "))";
             } else {
                 $where .= ($where != '' ? ' AND ' : 'WHERE ') . " top_cat = {$catid}";
             }
         }
     }
     if (CGlobal::$allCategories && CGlobal::$subCategories) {
         foreach (CGlobal::$subCategories as $topid => $subcats) {
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ManageBookingVip.php

示例12: draw

 function draw()
 {
     global $display;
     //For ajax_upload form
     $display->add('url_gallery', WEB_ROOT . AZRewrite::formatUrl('?page=gallery&is_popup=1&user_id=' . User::id()));
     //$display->add('no_img_upload',AZLib::getImageSrc('',100,100));
     $display->add('no_img_upload', $this->no_image);
     // Keep item avatar when update false
     if (isset($_POST["avatar_img_server"]) && $_POST["avatar_img_server"]) {
         $avatar['img_server'] = $_POST["avatar_img_server"];
         $avatar['img_url'] = $_POST["avatar_img_url"];
         $avatar['thumb280_280'] = AZLib::getImageThumb($_POST["avatar_img_url"], 280, 280, 0, $_POST["avatar_img_server"]);
         $avatar['max_path'] = AZLib::getImageThumbMax($_POST["avatar_img_url"], 'thumb_max', 1, $_POST["avatar_img_server"]);
         $display->add('avatarInfo', $avatar);
         $display->add('avatar', json_encode($avatar));
     }
     $display->add('item_user_id', User::id());
     $display->add('user_name', User::user_name());
     $display->add('user_id', User::id());
     $display->add('is_can_edit', (int) User::have_permit(ADMIN_ITEM));
     $display->add('browser_is_ie', $this->browser_is_ie);
     $display->output('ajax_upload');
     //For ajax_upload form
     $this->beginForm(true);
     $display->add('max_image_page', $this->max_image_page);
     $display->add('images_per_page', $this->images_per_page);
     $display->add('post_item_images', $this->item_images);
     $display->add('jsImages', json_encode($this->jsImages));
     $display->add('first_combo', (int) Url::get('first_combo'));
     $display->add('second_combo', (int) Url::get('second_combo'));
     //$display->add('category_tree',json_encode(AZLib::getCategoriesTree(0,true)));
     $display->add('category_tree', json_encode(AZLib::getCategoriesTree(true)));
     $display->add('currency_tree', json_encode(CGlobal::$currency));
     $display->add('az_filters', json_encode(CGlobal::$filters));
     $display->add('image_path', 'http://' . IMAGE_PATH);
     $display->add('img_cur_server', IMAGE_SERVER_NO);
     $display->add('img_server', json_encode(CGlobal::$img_server));
     $display->add('no_img', $this->no_image);
     $display->add('multi_upload', User::have_permit(ADMIN_ITEM));
     $display->add('post_img', $display->output('post_img', true));
     $display->add('currency_id_option', AZLib::getOption(CGlobal::$currency, Url::get('currency_id', 1)));
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('mode', "ĐĂNG");
     $display->add('sku', Url::get('sku'));
     $display->add('name', stripslashes(Url::get('name')));
     $display->add('offer', stripslashes(Url::get('offer')));
     $display->add('brief', stripslashes(Url::get('brief')));
     $display->add('item_description', stripslashes(Url::get('item_description')));
     $display->add('price', number_format(Url::cdouble(Url::get('price')), 0, ',', '.'));
     $display->add('price', number_format(Url::cdouble(Url::get('price')), 0, ',', '.'));
     $display->add('price_out', number_format(Url::cdouble(Url::get('price_out')), 0, ',', '.'));
     $display->add('quantity', number_format(Url::cdouble(Url::get('quantity')), 0, ',', '.'));
     $display->add('item_order', (int) Url::get('item_order'));
     $display->add('made_in', Url::get('made_in'));
     $display->add('warranty', Url::get('warranty'));
     $display->add('add_for_user', User::have_permit(ADMIN_ITEM));
     $display->output('post_sale');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:59,代码来源:PostItemForm.php

示例13: draw

 function draw()
 {
     global $display;
     $this->item['price'] = AZLib::convertCurrency($this->item['price'], $this->item['currency_id']);
     $this->item['price_out'] = AZLib::convertCurrency($this->item['price_out'], $this->item['currency_id']);
     $this->item['currency_id'] = 1;
     //For ajax_upload form
     $display->add('url_gallery', WEB_ROOT . AZRewrite::formatUrl('?page=gallery&is_popup=1&user_id=' . $this->item['user_id']));
     ////$display->add('no_img_upload',AZLib::getImageSrc('',100,100));
     $display->add('browser_is_ie', $this->browser_is_ie);
     $display->add('no_img_upload', $this->no_image);
     $display->add('user_id', User::id());
     $display->add('item_user_id', $this->item['user_id']);
     $display->add('is_can_edit', (int) User::have_permit(ADMIN_ITEM));
     $display->add('user_name', $this->item['user_name']);
     if (isset($_POST["avatar_img_server"])) {
         $avatar['img_server'] = $_POST["avatar_img_server"];
         $avatar['img_url'] = $_POST["avatar_img_url"];
         $avatar['thumb280_280'] = AZLib::getImageThumb($_POST["avatar_img_url"], 280, 280, 0, $_POST["avatar_img_server"]);
         $avatar['max_path'] = AZLib::getImageThumbMax($_POST["avatar_img_url"], 'thumb_max', 1, $_POST["avatar_img_server"]);
         $display->add('avatarInfo', $avatar);
         $display->add('avatar', json_encode($avatar));
     } elseif ($this->item['img_url']) {
         $avatar['img_server'] = $this->item['img_server'];
         $avatar['img_url'] = $this->item['img_url'];
         $avatar['thumb280_280'] = AZLib::getImageThumb($this->item['img_url'], 280, 280, 0, $this->item['img_server']);
         $avatar['max_path'] = AZLib::getImageThumbMax($this->item['img_url'], $this->item['name'], 1, $this->item['img_server']);
         $display->add('avatarInfo', $avatar);
         $display->add('avatar', json_encode($avatar));
     }
     $display->output('ajax_upload');
     //For ajax_upload form
     $this->beginForm(true);
     //$display->add('img_fnkjgk',json_encode($bakjgkj));
     $display->add('max_image_page', $this->max_image_page);
     $display->add('images_per_page', $this->images_per_page);
     $display->add('post_item_images', $this->item_images);
     $display->add('jsImages', json_encode($this->jsImages));
     if ($this->item['level_1_catid'] != $this->item['category_id']) {
         $first = $this->item['level_1_catid'];
         $second = $this->item['category_id'];
     } else {
         $first = $this->item['category_id'];
         $second = 0;
     }
     $display->add('first_combo', (int) Url::get('first_combo', $first));
     $display->add('second_combo', (int) Url::get('second_combo', $second));
     ///$display->add('category_tree',json_encode(AZLib::getCategoriesTree(0,true)));
     $display->add('category_tree', json_encode(AZLib::getCategoriesTree(true)));
     $display->add('currency_tree', json_encode(CGlobal::$currency));
     $display->add('az_filters', json_encode(CGlobal::$filters));
     $display->add('item_filters', $this->item['filter_ids']);
     $display->add('image_path', 'http://' . IMAGE_PATH);
     $display->add('img_cur_server', IMAGE_SERVER_NO);
     $display->add('img_server', json_encode(CGlobal::$img_server));
     $display->add('multi_upload', User::have_permit(ADMIN_ITEM));
     $display->add('no_img', $this->no_image);
     $display->add('post_img', $display->output('post_img', true));
     $display->add('currency_id_option', AZLib::getOption(CGlobal::$currency, Url::get('currency_id', $this->item['currency_id'])));
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('name', stripslashes(Url::get('name', $this->item['name'])));
     $display->add('sku', Url::get('sku', $this->item['sku']));
     $display->add('offer', stripslashes(Url::get('offer', $this->item['offer'])));
     if (isset(CGlobal::$allCategories[$this->item['category_id']])) {
         $item_href = WEB_DIR . CGlobal::$allCategories[$this->item['category_id']]['nice_name'] . "/p{$this->item['id']}/" . AZLib::safe_title($this->item['name']) . ".html";
     } else {
         $item_href = WEB_DIR . "p{$this->item['id']}/" . AZLib::safe_title($this->item['name']) . ".html";
     }
     $display->add('item_href', $item_href);
     $display->add('name_length', 120 - mb_strlen(AZLib::stripUnicode(Url::get('name', $this->item['name'])), "UTF-8"));
     $display->add('brief', stripslashes(Url::get('brief', $this->item['brief'])));
     $display->add('item_description', stripslashes(Url::get('item_description', $this->item['description'])));
     $display->add('mode', "CẬP NHẬT");
     $display->add('price', number_format(Url::get('price', $this->item['price']), 0, ',', '.'));
     $display->add('price_out', number_format(Url::get('price_out', $this->item['price_out']), 0, ',', '.'));
     $display->add('quantity', number_format(Url::cdouble(Url::get('quantity', $this->item['quantity'])), 0, ',', '.'));
     $display->add('item_order', (int) Url::get('item_order', $this->item['item_order']));
     $display->add('made_in', Url::get('made_in', $this->item['made_in']));
     $display->add('warranty', Url::get('warranty', $this->item['warranty']));
     $display->output('post_sale');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:82,代码来源:EditItemForm.php

示例14: draw

 function draw()
 {
     global $display;
     AZLib::getNewsCats();
     $display->add('url_add', Url::build_current(array('cmd' => 'add')));
     $display->add('msg', $this->showFormErrorMessages(1));
     $news_catid = Url::get('news_catid', 0);
     $status = Url::get('status', 3);
     $date_begin = Url::get('date_begin');
     $date_end = Url::get('date_end');
     $keyword = Url::get('searchtext');
     $hot = Url::get('hot', 1);
     for ($i = 1; $i <= 3; $i++) {
         $display->add('selected_' . $i, '');
     }
     $display->add('selected_' . Url::get('status', 3), 'selected');
     for ($i = 1; $i <= 2; $i++) {
         $display->add('tinnhanh_' . $i, '');
     }
     $display->add('tinnhanh_' . Url::get('tinnhanh', 2), 'selected');
     $condition = ' 1 ';
     if ($news_catid) {
         $condition .= " AND news_catid ={$news_catid} ";
     }
     if ($keyword != '') {
         $condition .= " AND ((title like '%{$keyword}%') OR (brief like '%{$keyword}%')) ";
     }
     $created_time_from = 0;
     $created_time_to = 0;
     if ($date_begin) {
         $date_arr = explode("-", $date_begin);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_from = mktime(0, 0, 0, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     if ($date_end) {
         $date_arr = explode("-", $date_end);
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_to = mktime(23, 59, 59, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     if ($created_time_from) {
         $condition .= ' AND  time_created >=' . $created_time_from;
     }
     if ($date_end) {
         $condition .= " AND  time_created <={$created_time_to}";
     }
     if ($status != 3) {
         $condition .= ' and  status=' . $status;
     }
     if ($hot == 2) {
         $condition .= ' and  hot=' . $hot;
     }
     $cat_arr = array(0 => "--Danh mục tin--");
     if (CGlobal::$allNewsCategories) {
         foreach (CGlobal::$allNewsCategories as $news_cat) {
             $cat_arr[$news_cat['id']] = "[{$news_cat['id']}] " . $news_cat['name'] . ($news_cat['public'] == 0 ? ' (Đã ẩn)' : '');
         }
     }
     //$news_catid
     $display->add('news_cat_option', AZLib::getOption($cat_arr, $news_catid));
     $display->add('hot_option', AZLib::getOption(array('1' => "Tất cả", 2 => "Tin Hot"), $hot));
     $display->add('status_option', AZLib::getOption(array(3 => "Tất cả", 1 => "Hiện", 2 => "Ẩn"), $status));
     $display->add('keyword', $keyword);
     $display->add('date_begin', $date_begin);
     $display->add('date_end', $date_end);
     $totalRows = DB::count("news", $condition);
     $limit = '';
     $pagging = AZPagging::pagingSE($limit, $totalRows, 20, 10, 'page_no', "tin");
     //$pagging = AZPagging::paging_list($limit,20,'page_no');
     $items = array();
     $re = DB::query('SELECT * FROM news WHERE ' . $condition . " ORDER BY id DESC " . $limit, __LINE__ . __FILE__, false, false, false, true);
     if ($re) {
         while ($item = mysql_fetch_assoc($re)) {
             $item['admin_link'] = News::admin_link($item);
             if ($item['image']) {
                 $item['image'] = AZLib::getImageThumb($item['image'], 150, 0, 0, $item['img_server']);
             }
             $item['cat'] = "[{$item['news_catid']}] " . @CGlobal::$allNewsCategories[$item['news_catid']]['name'];
             $item['time_created'] = date('d/m/Y', $item['time_created']);
             $item['brief'] = stripslashes($item['brief']);
             $item['title'] = stripslashes($item['title']);
             $item['url'] = Url::build('news_detail', array('news_catid' => $item['news_catid'], 'news_id' => $item['id']));
             $items[$item['id']] = $item;
         }
     }
     $display->add('items', $items);
     $display->add('pagging', $pagging);
     $this->beginForm();
     $display->output("NewsAdmin");
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:92,代码来源:NewsAdmin.php

示例15: draw

 function draw()
 {
     global $display;
     $config = @CGlobal::$configs['AdvHomeBottom']['conf_val'];
     $status = 0;
     $url_detail = '';
     $type_display = 1;
     if ($config != '') {
         $config_arr = explode("\n", $config);
         $status = (int) $config_arr[0];
         $url_detail = $config_arr[1];
         $type_display = (int) $config_arr[2];
     }
     if ($status) {
         //Bật
         if ($type_display == 1) {
             $display->add('adv_banner', DATA_PATH . 'adv/AdvHomeBottom.gif');
         } else {
             $display->add('adv_banner', DATA_PATH . 'adv/AdvHomeBottom.swf');
         }
         $display->add('type_display', $type_display);
         $display->add('url_detail', $url_detail);
     } else {
         //tắt
         $display->add('adv_banner', '');
     }
     $display->add('status', $status);
     if (User::have_permit(ADMIN_ADV)) {
         $display->add('beginform', $this->beginForm(true, 'POST', false, false, true));
         $display->add('endform', $this->endForm(true));
         $display->add('msg', $this->showFormErrorMessages(1));
         $status_arr = array(0 => 'Tắt', 1 => 'Bật');
         $display->add('status_option', AZLib::getOption($status_arr, $status));
         $display->add('is_admin', 1);
         $display->add('url', $url_detail);
         $type_arr = array(1 => 'Ảnh', 2 => 'Flash');
         $type = URL::get('type', 'int', $type_display);
         $display->add('type_option', AZLib::getOption($type_arr, $type));
     } else {
         $display->add('adv_config', '');
         $display->add('is_admin', 0);
     }
     $display->add('adv_width', 1000);
     $display->add('adv_height', 200);
     $display->output("AdvHomeBottom");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:46,代码来源:class.php


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