function draw() { global $display; $item_ids = ''; $item_news = array(); $configs = @CGlobal::$configs['ItemNew']['conf_val']; if ($configs) { $configs = unserialize(stripslashes($configs)); $title_new = $configs['title']; $item_ids = $configs['item_ids']; } else { $title_new = "SẢN PHẨM MỚI"; $item_ids = ''; } if ($item_ids) { $re = DB::query("SELECT * FROM item WHERE id IN({$item_ids}) AND status = 1 ORDER BY find_in_set(id,'{$item_ids}')"); if ($re) { while ($product = mysql_fetch_assoc($re)) { if ($product['img_url']) { $product['image'] = AZLib::getImageThumb($product['img_url'], 160, 150, 0, $product['img_server']); } else { $product['image'] = ""; //"style/images/no-images-35x35.gif"; } if (isset(CGlobal::$allCategories[$product['category_id']])) { $product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html"; } else { $product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html"; } $product['name'] = stripslashes($product['name']); if ($product['list_brief'] == '') { $product['list_brief'] = $product['brief']; } $product['list_brief'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($product['list_brief'], ENT_QUOTES, "UTF-8")))); $product['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $product['list_brief']); $product['list_brief'] = str_replace(array("'", "\""), array("", " "), $product['list_brief']); $product['list_brief'] = AZLib::word_limit($product['list_brief'], 50, ''); $product['list_brief'] = '<b>' . str_replace(array("'", "\""), array("", " "), $product['name']) . '</b><br />' . $product['list_brief']; $product['price_num'] = $product['price']; $product['price'] = AZLib::getPrice($product['price'], $product['currency_id']); $item_news[$product['id']] = $product; } } } 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)); } $display->add('title_new', $title_new); $display->add('item_ids', $item_ids); $display->add('item_news', $item_news); $display->output("ItemNew"); }
function draw() { $this->beginForm(); global $display; $display->add('created_time_from', Url::get('created_time_from')); $display->add('created_time_to', Url::get('created_time_to')); $display->add('sender_user_name', Url::get('sender_user_name')); $display->add('processed', Url::get('processed')); //search theo ngay thang nam $created_time_from = 0; $created_time_to = 0; if (Url::get('created_time_from')) { $date_arr = explode('-', Url::get('created_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 (Url::get('created_time_to')) { $date_arr = explode('-', Url::get('created_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 = ' 1 '; if ($created_time_from) { $search_value .= ' AND time_post >= ' . $created_time_from; } if ($created_time_to) { $search_value .= ' AND time_post <= ' . $created_time_to; } // search ô textbox if (Url::get('sender_user_name') != '') { $search_value .= ' AND b.user_name like "%' . Url::get('sender_user_name') . '%" '; } if (Url::get('processed') == 1) { $search_value .= ' AND b.status = 0'; } $item_per_page = 50; $sql_count = 'SELECT COUNT(*) AS total_item FROM `bad_content` AS b WHERE b.type = 1 AND ' . $search_value; $total = DB::fetch($sql_count, 'total_item', 0); $items = array(); if ($total) { $limit = ''; $paging = AZPagging::pagingSE($limit, $total, $item_per_page, 10, 'page_no', true, 'Phản hồi', 'Trang'); $sql = 'SELECT i.name,i.transaction_type,i.category_id, b.id, b.admin_name, b.status, b.type,b.id_item, b.reason,b.user_id,b.user_name, b.note, b.time_post FROM `bad_content` b LEFT JOIN item i ON i.id = b.id_item WHERE b.type = 1 AND ' . $search_value . ' ORDER BY b.status, b.time_post DESC, b.type ASC ' . $limit; $result = DB::query($sql); if ($result) { while ($row = mysql_fetch_assoc($result)) { $row['content'] = $row['name']; $row['time_post'] = date('d/m/y H:i', $row['time_post']); $row['content_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['content'])); $row['content'] = AZLib::word_limit($row['content'], 12, '...'); $row['reason_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['reason'])); $row['reason'] = AZLib::word_limit($row['reason'], 12, '...'); $row['note_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['note'])); $row['note'] = AZLib::word_limit($row['note'], 12, '...'); $row['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $row['id_item'] . '&ebname=' . AZLib::safe_title($row['name'])); $row['del_link'] = Url::build_all(array('chk_id', 'del_all', 'cmd', 'id'), 'cmd=delete&id=' . $row['id']); $items[$row['id']] = $row; } } } else { $paging = ''; } $display->add('items', $items); $display->add('paging', $paging); $display->output('list'); $this->endForm(); }
function get_feed_notify_bar() { AZLib::getCats(); $json = ""; if (!User::is_login()) { $json = '({"msg":"no_login"})'; echo $json; exit; } $item_comment_ids = ""; //Id các phản hồi giao dịch $user_comment_ids = ""; //Id các lưu bút $entry_comment_ids = ""; //Id các bài viết /*$follow_ids = "";//Id các theo đuôi*/ $blast_user_ids = ""; // Id các balst $arr_data = array(); $user = User::getUser(User::id()); if ($user["total_pm"]) { // neu co PM moi $arr_data = array("new_pm" => $user["total_pm"]); } $where = "WHERE user_id = " . User::id(); $limit = " LIMIT 20"; $sql = "SELECT * FROM feed {$where} ORDER BY time DESC {$limit}"; $re = DB::query($sql); if ($re) { while ($feed = mysql_fetch_assoc($re)) { if ($feed['type'] == 1 || $feed['type'] == 2) { // phan hoi $item_comment_ids .= ($item_comment_ids != '' ? ',' : '') . $feed['ref_id']; } elseif ($feed['type'] == 3) { // luu but $user_comment_ids .= ($user_comment_ids != '' ? ',' : '') . $feed['ref_id']; } elseif ($feed['type'] == 5 || $feed['type'] == 6) { // bai viet $entry_comment_ids .= ($entry_comment_ids != '' ? ',' : '') . $feed['ref_id']; } /*elseif($feed['type']==7){// theo duoi $follow_ids.=($follow_ids!=''?',':'').$feed['ref_id']; }*/ } } //Phản hồi giao dịch $item_comment_arr = array(); if ($item_comment_ids != '') { $item_ids = ""; $re = DB::query("SELECT time, item_id, parent_id, COUNT(item_id) AS total_comment FROM comment WHERE id IN({$item_comment_ids}) GROUP BY item_id"); if ($re) { while ($comment = mysql_fetch_assoc($re)) { $item_ids .= ($item_ids != '' ? ',' : '') . $comment['item_id']; $comment['time'] = AZLib::duration_time($comment['time']); $item_comment_arr[$comment['item_id']] = $comment; } if ($item_comment_arr && $item_ids) { // Query de lay ID va Tieu de tin $re = DB::query("SELECT id, name, level_1_catid FROM item WHERE id IN({$item_ids})"); while ($item = mysql_fetch_assoc($re)) { if ($item["id"] == $item_comment_arr[$item["id"]]["item_id"]) { $item_comment_arr[$item["id"]]["item_name"] = AZLib::word_limit($item["name"], 7, '...'); $ebname = AZLib::safe_title($item['name']); if (isset(CGlobal::$allCategories[$item['level_1_catid']])) { $cat_name = CGlobal::$allCategories[$item['level_1_catid']]['name']; $item_comment_arr[$item["id"]]["url_link"] = WEB_DIR . AZLib::safe_title($cat_name) . "/p{$item['id']}/{$ebname}.html"; } else { $item_comment_arr[$item["id"]]["url_link"] = WEB_DIR . "/p{$item['id']}/{$ebname}.html"; } } } } } if ($item_comment_arr) { $item_comment_arrs["comment"] = $item_comment_arr; $arr_data += $item_comment_arrs; } } // End Phan hoi giao dich //Luu but $total_comment_arr = array(); if ($user_comment_ids != '') { $re = DB::query("SELECT time, COUNT(id) AS total_comment_user FROM comment_user WHERE id IN({$user_comment_ids}) GROUP BY receiver_user_id ORDER BY time DESC"); if ($re) { $comment_user = mysql_fetch_assoc($re); $total_comment_arr["total"] = $comment_user["total_comment_user"]; $total_comment_arr['time'] = AZLib::duration_time($comment_user['time']); $total_comment_arr["url_link"] = WEB_DIR . 'Shop/' . User::user_name() . '/Luu-but'; } if ($total_comment_arr) { $total_comment_arrs["comment_user"] = $total_comment_arr; $arr_data += $total_comment_arrs; } } //End Luu but // Theo duoi /*$follow_arr = array(); if($follow_ids!=''){ $re = DB::query("SELECT id, follower_name, time FROM follow WHERE id IN($follow_ids) ORDER BY time DESC"); if($re){ while ($follow = mysql_fetch_assoc($re)){ $follow['time'] = AZLib::duration_time($follow['time']); $follow["url_link"] = WEB_DIR.$follow['follower_name']; $follow_arr[$follow['id']] = $follow; } } if($follow_arr){ $follow_arrs["follow"] = $follow_arr; $arr_data += $follow_arrs; } }*/ // end Theo duoi // Phản hồi bài viết $entry_comment_arr = array(); if ($entry_comment_ids != '') { $entry_ids = ""; $re = DB::query("SELECT time, entry_id, parent_id FROM user_entry_comment WHERE id IN({$entry_comment_ids})"); if ($re) { while ($comment_entry = mysql_fetch_assoc($re)) { $entry_ids .= ($entry_ids != '' ? ',' : '') . $comment_entry['entry_id']; $comment_entry['time'] = AZLib::duration_time($comment_entry['time']); $comment_entry['total_comment_entry'] = count(explode(',', $entry_comment_ids)); $entry_comment_arr[$comment_entry['entry_id']] = $comment_entry; } if ($entry_comment_arr && $entry_ids) { // Query de lay ID va Tieu de bai viet $re = DB::query("SELECT id, title FROM user_entry WHERE id IN({$entry_ids})"); while ($entry = mysql_fetch_assoc($re)) { if ($entry["id"] == $entry_comment_arr[$entry["id"]]["entry_id"]) { $entry_comment_arr[$entry["id"]]["title"] = AZLib::word_limit($entry["title"], 7, '...'); $ebname = AZLib::safe_title($entry['title']); $entry_comment_arr[$entry["id"]]["url_link"] = WEB_DIR . "Bai-viet/" . User::user_name() . "/e{$entry['id']}/{$ebname}"; } } } } if ($entry_comment_arr) { $item_comment_arrs["entry"] = $entry_comment_arr; $arr_data += $item_comment_arrs; } } // End Phan hoi bài viết $json = json_encode($arr_data); echo $json; exit; }
function on_submit() { $gfsubmit = Url::get("gfsubmit"); if ($gfsubmit) { $fgroup_id = (int) implode(array_keys($gfsubmit)); if ($fgroup_id) { $fgroup = DB::select("filter_group", "id={$fgroup_id}"); if ($fgroup) { $gf_name = Url::get('gf_name'); $gf_pos = Url::get('gf_pos'); if (isset($gf_name[$fgroup_id], $gf_pos[$fgroup_id]) && $gf_name[$fgroup_id] && $gf_pos[$fgroup_id]) { $gf_name = $gf_name[$fgroup_id]; $gf_pos = $gf_pos[$fgroup_id]; if ($fgroup['name'] != $gf_name || $fgroup['pos'] != $gf_pos) { $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0); if ($gf_pos > $max_pos) { $gf_pos = $max_pos; } elseif ($gf_pos <= 0) { $gf_pos = $fgroup['pos']; } DB::update('filter_group', array("name" => $gf_name, "pos" => $gf_pos), "id={$fgroup_id}"); if (DB::select('filter_group', "pos={$gf_pos} AND id!={$fgroup_id}")) { DB::query("UPDATE filter_group SET pos=pos+1 WHERE pos>={$gf_pos} AND pos<={$fgroup['pos']} AND id!={$fgroup_id}"); } AZLib::getFilters(1); } } } } Url::redirect_current(array('cmd', 'id')); } $submit = Url::get("submit"); if ($submit == "Thêm nhóm thuộc tính") { $gfilter_name = Url::get('gfilter_name'); $gfilter_pos = Url::get('gfilter_pos'); if ($gfilter_name != '' && $gfilter_pos) { $gfilter_group = array('name' => $gfilter_name, 'catids' => $this->cat['id'], 'pos' => $gfilter_pos); $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0); if ($gfilter_pos > $max_pos || $gfilter_pos <= 0) { $gfilter_pos = $max_pos + 1; } $gfilter_group['pos'] = $gfilter_pos; $id = DB::insert('filter_group', $gfilter_group); if ($id && DB::select('filter_group', 'pos="' . $gfilter_pos . '" AND id!=' . $id)) { DB::query('UPDATE filter_group SET pos=pos+1 WHERE pos>=' . $gfilter_pos . ' AND id!=' . $id); } } AZLib::getFilters(1); Url::redirect_current(array('cmd', 'id')); } $name = Url::get('name'); $brief_name = Url::get('brief_name'); $keywords = Url::get('keywords'); $description = Url::get('description'); $parent_id = Url::get('parent_id'); $zoneids = Url::get('zoneids'); $ref_id = Url::get('ref_id'); $status = Url::get('status', 'HIDE'); $position = Url::get('position'); $tag_search = Url::get('tag_search'); $price_str = trim(Url::get('price_str')); $recomend = trim(Url::get('recomend')); if ($price_str) { function check_price_str($price) { return Url::cdouble(trim($price)); } $price_ar = array_unique(array_map('check_price_str', explode(",", $price_str))); $price_str = ''; if ($price_ar) { asort($price_ar); foreach ($price_ar as $price) { if ($price > 0) { $price_str .= ($price_str != '' ? ',' : '') . $price; } } } } $this->checkFormInput('Tên Danh mục', 'name', $name, 'str', true, '', 1, 255); $this->checkFormInput('Tên vắn tắt', 'brief_name', $brief_name, 'str', false, '', 1, 255); //$this->checkFormInput('Từ khoá','keywords',$keywords,'str',false,'',0,20); $this->checkFormInput('Mô tả', 'description', $description, 'str', false, '', 0, 250); if (Url::get('cmd') == 'edit' && $this->cat['parent_id'] == 0 && $parent_id && DB::select("category", 'parent_id=' . $this->cat['id'])) { $this->setFormError("parent_id", 'Không thể chuyển "Danh mục có danh mục con" thành một "Danh mục con" của "Danh mục khác" được!'); } if (!$this->errNum) { $new_row = array('name' => $name, 'brief_name' => $brief_name ? $brief_name : $name, 'keywords' => AZLib::word_limit($keywords, 20, ''), 'description' => $description, 'parent_id' => $parent_id, 'ref_id' => $ref_id, 'status' => $status, 'tag_search' => $tag_search, 'img_server' => IMAGE_SERVER_NO, 'price_str' => $price_str, 'recomend' => $recomend); if (Url::get('cmd') == 'edit') { if ($position > 0 && $position != $this->cat['position']) { $max_pos = (int) DB::fetch("SELECT max(position) AS max_pos FROM category WHERE parent_id=" . $parent_id, 'max_pos'); if ($position > $max_pos) { $position = $max_pos + 1; } $new_row['position'] = $position; } else { $position = $this->cat['position']; } $id = $this->cat['id']; DB::update('category', $new_row, 'id=' . $this->cat['id']); /*if($this->cat['parent_id']==0 && $parent_id){ DB::update('category', array('parent_id'=>0),'parent_id='.$this->cat['parent_id']); }*/ } else { $max_pos = (int) DB::fetch("SELECT max(position) AS max_pos FROM category WHERE parent_id=" . $parent_id, 'max_pos'); if ($position > $max_pos || $position == 0) { $position = $max_pos + 1; } $new_row['position'] = $position; $id = DB::insert('category', $new_row); } if ($_FILES['cat_image']['tmp_name']) { if (Url::get('cmd') == 'edit') { AZLib::ftp_image_delete_file('category/' . $this->cat['id'] . '.gif', $this->cat['img_server']); } /*if(AZLib::ftp_image_connect(IMAGE_SERVER_NO)){ if(!AZLib::ftp_check_dir('category/',true,IMAGE_SERVER_NO)){ break ; } $file_name ='category/'.$id.'.gif'; $sourceName =$_FILES['cat_image']['tmp_name']; AZLib::ftp_image_put_file($file_name,$sourceName,IMAGE_SERVER_NO); //@fopen('http://'.IMAGE_PATH.'?del_cat=1',"r"); }*/ if (AZLib::ftp_check_dir('category/', true, IMAGE_SERVER_NO)) { $file_name = 'category/' . $id . '.gif'; $sourceName = $_FILES['cat_image']['tmp_name']; AZLib::ftp_image_put_file($file_name, $sourceName, IMAGE_SERVER_NO); //@fopen('http://'.IMAGE_PATH.'?del_cat=1',"r"); } } if ($id && DB::select('category', 'position="' . $position . '" AND id!="' . $id . '" AND parent_id="' . $parent_id . '"')) { DB::query('UPDATE category SET position=position+1 WHERE position>=' . $position . ' AND position<=' . $this->cat['position'] . ' AND parent_id="' . $parent_id . '" AND id!=' . $id); } $all_zones = $this->zones; $sql_inset = ""; if ($zoneids) { foreach ($zoneids as $zoneid) { if (isset($all_zones[$zoneid])) { unset($all_zones[$zoneid]); } else { $sql_inset .= ($sql_inset != '' ? ',' : '') . "({$zoneid},{$id})"; } } } if ($sql_inset) { $sql_inset = "INSERT INTO category_zone_cat (zoneid, catid) VALUES " . $sql_inset; DB::query($sql_inset); } if ($all_zones) { $zoneids = implode(",", array_keys($all_zones)); if ($zoneids) { DB::query("DELETE FROM category_zone_cat WHERE catid={$id} AND zoneid IN({$zoneids})"); } } //AZLib::del_cache_zone_cat(); AZLib::getCats(1, true); if (Url::get('cmd') == 'edit' && $this->cat['parent_id'] != $parent_id) { //đổi danh mục cha => cập nhật lại tin $catid = $this->cat['id']; $level_1 = 0; $level_2 = 0; if ($parent_id) { if (CGlobal::$allCategories[$parent_id]['parent_id']) { $level_1 = CGlobal::$allCategories[$parent_id]['parent_id']; $level_2 = $parent_id; } else { $level_1 = $parent_id; $level_2 = $catid; } } else { $level_1 = $catid; $level_2 = 0; } DB::update("item", array("level_1_catid" => $level_1, "level_2_catid" => $level_2), "category_id={$catid}"); if (MEMCACHE_ON) { AZMemcache::clear(); } } if ($this->cat) { Url::redirect_current(); } else { Url::redirect_current(array('cmd')); } } }
function show_mes_outbox() { $search_text = AZLib::getParam('search_text'); $is_archive = Url::get('is_archive', 0); $table_topics = 'message_topics'; $table_text = 'message_text'; $url_archive = ''; $url_cmd = ''; if ($is_archive) { $table_topics = $table_topics . '_archive'; $table_text = $table_text . '_archive'; $url_cmd = '?cmd=archive'; $url_archive = '&is_archive=1'; } $condition = $table_topics . '.mt_owner_id =' . User::id() . ' AND ' . $table_topics . '.mt_vid_folder = "sent" AND ' . $table_topics . '.mt_newest = 0'; if ($search_text && $search_text != "Account thành viên") { $condition .= " AND mt_to_name LIKE '%{$search_text}%' "; } $str_content = '<form name="message"> <div id="boxFunctions"> Chọn: <a style="cursor:pointer" id="select_all">Tất cả</a>, <a style="cursor:pointer" id="select_read">Đã đọc</a>, <a style="cursor:pointer" id="select_unchecked">Không chọn</a> <div id="boxFunctionRight"> <div id="btn_del_mess" align="center" class="btnAllNewFeedback" onmouseout="this.className=\'btnAllNewFeedback\'" onmouseover="this.className=\'btnAllNewFeedbackHover\'" style="width:40px;"> <div class="btnRightAllFeedback" align="center" style="width:40px"><a title="Xóa tất cả tin nhặn đã chọn" href="javascript:void(0)" onClick="return delMessage(0,\'true\',\'outbox\')">Xoá</a></div> </div> </div> </div> '; $str_content .= '<table cellpadding="3" cellspacing="0" border="0" width="100%">'; $sql_count = 'SELECT COUNT(mt_id) AS total_row FROM ' . $table_topics . ' WHERE ' . $condition; $total_item = DB::fetch($sql_count, 'total_row', 0); $item_per_page = 15; $limit = ''; $divID = 'mess_content'; $url_path = WEB_DIR . 'ajax.php?act=personal&code=show_mes_outbox' . $url_archive . '&search_text=' . $search_text; $paging = AZPagging::AjaxPaging($limit, $total_item, $item_per_page, 5, 'page_mes', '', false, false, $url_path, $divID, true); $sql = 'SELECT ' . $table_text . '.msg_id, ' . $table_text . '.msg_author_name, ' . $table_text . '.msg_date, ' . $table_text . '.msg_post, ' . $table_topics . '.mt_id, ' . $table_topics . '.mt_ref_id, ' . $table_topics . '.mt_title, ' . $table_topics . '.mt_from_id, ' . $table_topics . '.mt_owner_id, ' . $table_topics . '.mt_read, ' . $table_topics . '.mt_owner_name, ' . $table_topics . '.mt_to_name, user.avatar_url, user.img_server FROM ' . $table_text . ', ' . $table_topics . ', user WHERE ' . $table_text . '.msg_id = ' . $table_topics . '.mt_msg_id AND ' . $table_topics . '.mt_from_id = user.id AND ' . $condition . ' ORDER BY ' . $table_text . '.msg_date DESC ' . $limit; //echo $sql; //exit; $result = DB::query($sql); $stt = 0; if ($result) { while ($row = mysql_fetch_assoc($result)) { if ($stt < $item_per_page) { if ($row['mt_ref_id']) { $sourceTitle = DB::select($table_topics, 'mt_id = ' . $row['mt_ref_id']); if ($sourceTitle['mt_title']) { $row['mt_title'] = $sourceTitle['mt_title']; } //else //{ // $sentTitle = DB::select($table_topics,'mt_mgsid = ' . $row['mt_ref_id']); //} $row["mt_id"] = $row['mt_ref_id']; $row['mt_ref_id'] = 0; } if ($row['avatar_url']) { $row['avatar_url'] = AZLib::getImageThumb($row['avatar_url'], 50, 50, 0, $row['img_server']); } else { $row['avatar_url'] = "style/images/50x50.gif"; } //$row['msg_date'] = AZLib::duration_time($row['msg_date']); $msg_date = date('H:i | ', $row['msg_date']); if (date('d.m.y', $row['msg_date']) == date('d.m.y', TIME_NOW)) { $msg_date .= '<font color="green">Hôm nay</font>'; } else { $msg_date .= date('d.m.y', $row['msg_date']); } $row['msg_date'] = $msg_date; $row['msg_post'] = preg_replace("/\n/", "<br />", $row['msg_post']); $row['msg_post'] = strip_tags(AZLib::parseBBCode(AZLib::convert_one_br($row['msg_post'])), '<br />'); if (strlen($row['msg_post']) > 40) { $row['msg_post_short'] = AZLib::word_limit($row['msg_post'], 40, ' ...'); //$row['msg_post_short'] = AZLib::cleanHtml(AZLib::word_limit($row['msg_post'],40,' ...')); } else { $row['msg_post_short'] = $row['msg_post']; //$row['msg_post_short'] = AZLib::cleanHtml($row['msg_post']); } //$str_title = '<a onclick="fn_show_mes_detail('.$row["mt_id"].')" rel="history" href="message.html'.$url_cmd.'#outbox/'.$row["mt_id"].'" id="a_'.$row["mt_id"].'" title="Hiển thị chi tiết" >'.$row["mt_title"].'</a> - <span class="textMestime">'.$row['msg_date'].'</span>'; if ($row['mt_owner_id'] != User::id()) { $strUser = '******' . $row["mt_owner_name"] . '">' . $row["mt_owner_name"] . '</a>'; } else { $strUser = '******' . $row["mt_to_name"] . '">' . $row["mt_to_name"] . '</a>'; } if ($row["mt_read"] == 0 && !$is_archive) { $str_title = '<a onclick="detail_reload_jcache = true;fn_show_mes_detail(' . $row["mt_id"] . ',1,\'outbox\')" rel="history" id="a_' . $row["mt_id"] . '" href="message.html' . $url_cmd . '#outbox/' . $row["mt_id"] . '" title="Hiển thị chi tiết" ><b>' . $row["mt_title"] . '</b></a>'; $read_class = ' unreadMessage'; } else { $str_title = '<a onclick="detail_reload_jcache = true;fn_show_mes_detail(' . $row["mt_id"] . ',1,\'outbox\')" rel="history" id="a_' . $row["mt_id"] . '" href="message.html' . $url_cmd . '#outbox/' . $row["mt_id"] . '" title="Hiển thị chi tiết">' . $row["mt_title"] . '</a>'; $read_class = ''; } $str_content .= '<tr id="' . $row["mt_id"] . '"> <td align="center" class="listMessage' . $read_class . '"><input type="checkbox" class="rowbox' . $read_class . '" id="inbox_' . $row["mt_id"] . '" name="inbox[]" value="' . $row["mt_id"] . '"></td> <td align="center" class="listMessage' . $read_class . '"> <a href="' . $row["msg_author_name"] . '"><img src="' . $row["avatar_url"] . '"/></a> </td> <td valign="top" class="listMessage' . $read_class . '" style="white-space:nowrap; padding-right:15px; vertical-align:middle;"> <div>' . $strUser . '</div> <div class="textMestime">' . $row['msg_date'] . '</div> </td> <td valign="top" class="listMessage clickable' . $read_class . '" style="padding-right:15px;width:65%;" lang="' . $row["mt_id"] . '"> <div style="margin-top:6px;">' . $str_title . '</div> <div style="margin:6px 0;color:#808080">' . $row['msg_post_short'] . '</div> </td> <td align="center" class="listMessage' . $read_class . '" style="padding-right:10px;"> <span><a title="Xóa tin nhắn" onClick="return delMessage(' . $row["mt_id"] . ',\'false\',\'inbox\')" href="javascript:void(0)" style="padding:20px;" class="deleteButton"> </a></span></td> </tr> '; /*$str_content .= '<tr id="'.$row["mt_id"].'"> <td align="center" class="listMessage' . $read_class . '"><input type="checkbox" id="inbox_'.$row["mt_id"].'" name="inbox[]" value="'.$row["mt_id"].'"></td> <td align="center" class="listMessage' . $read_class . '"> <a href="'.$row["mt_to_name"].'"><img src="'.$row["avatar_url"].'" vspace="4" hspace="4"/></a> <div><a href="'.$row["mt_to_name"].'">'.$row["mt_to_name"].'</a></div> </td> <td valign="top" style="width:65%;" class="listMessage' . $read_class . '"> <div>'.$str_title.'</div> <div style="margin-top:6px">'.$row['msg_post_short'].'</div> </td> <td align="center" class="listMessage' . $read_class . '"> <span><a title="Xóa tin nhắn" onClick="delMessage('.$row["mt_id"].',\'false\',\'sent\')" href="javascript:void(0)"> <img src="style/images/icon_delete.gif" width="9" height="9" /></a></span></td> </tr>';*/ } $stt++; } } if ($stt > 0) { $str_content .= '<tr><td></td><td> </td><td colspan="2"><div style="float:right">' . $paging . '</div><div style="clear:right"></div></td></tr>'; } else { $str_content .= '<tr><td></td><td colspan="3"> <center><div class="noMess">Không có Tin nhắn nào trong tin đã gửi</div></center> </td></tr>'; } $str_content .= '</table></form>'; echo $str_content; exit; }
function draw() { global $display; $this->beginForm(false, "POST", false, Url::build_current()); $key_word = Url::get('key_word'); $condition = " status=1"; $display->add('key_word', $key_word); if ($key_word) { $key_word_s = ''; $arr = explode(' ', $key_word); if ($arr) { foreach ($arr as $key) { $key = trim($key); if ($key != '') { $key_word_s .= ($key_word_s == '' ? '+' : ' +') . "{$key}"; } } } if ($key_word_s != '') { $condition .= " AND MATCH(title, des) AGAINST ('{$key_word_s}' IN BOOLEAN MODE)"; } //$condition .= ' AND (title LIKE "%'.$key_word.'%" OR des LIKE "%'.$key_word.'%")'; } $total_item = DB::count('document', $condition); $limit = ''; $paging = AZPagging::paging_list($limit, $total_item, 10, 10, 'page_no', '', true, 'Tài liệu', 'Trang'); $display->add('paging', $paging); $condition = 'WHERE' . $condition; $documents = array(); $sql = 'SELECT * FROM document ' . $condition . ' ORDER BY id DESC ' . $limit; $re = DB::query($sql); if ($re) { $i = 1; while ($row = mysql_fetch_assoc($re)) { $row['title'] = stripslashes($row['title']); $row['des'] = AZLib::remove_4_js(AZLib::plainText(html_entity_decode($row['des'], ENT_QUOTES, "UTF-8"))); $row['des'] = str_replace(array("'", "\""), array("", " "), $row['des']); $row['des'] = AZLib::word_limit($row['des'], 200, ''); if (++$i % 2) { $row['bgcolor'] = "#FFFFFF"; } else { $row['bgcolor'] = "#D9D9D9"; } $row['time_m'] = $row['time_m'] ? date("d/m/Y", $row['time_m']) : ''; if (User::is_admin()) { $row['change'] = AZLib::button(Url::build_current(array('cmd' => 'change', 'id' => $row['id'], "href" => urlencode(Url::build_all()))), 'style/images/unexam.gif', 'Disable'); $row['edit'] = AZLib::button(Url::build('document', array('cmd' => 'edit', 'id' => $row['id'], "href" => urlencode(Url::build_all()))), 'style/images/edit.gif', 'Sửa tài liệu'); $row['delete'] = AZLib::buttonDel(Url::build_current(array('cmd' => 'delete', 'id' => $row['id'], "href" => urlencode('?' . $_SERVER['QUERY_STRING']))), 'style/images/delete.gif', 'Sửa tài liệu'); } if ($row['url']) { $row['document_detail'] = $row['url']; } else { $row['document_detail'] = WEB_DIR . "download-{$row['id']}/" . AZLib::safe_title($row['title']) . ".html"; } $documents[$row['id']] = $row; } } $display->add('documents', $documents); if (User::is_admin()) { $display->add("is_admin", 1); } $display->output('DocumentList'); $this->endForm(); }
function __construct($row) { Module::Module($row); require_once 'forms/header.php'; if (AZNet::$page['name'] == 'zone') { $zone_id = (int) Url::get("zone_id"); if (!$zone_id || $zone_id && !isset(CGlobal::$allZones[$zone_id])) { //Url::access_denied(); Url::redirect('home'); } } if (AZNet::$page['name'] == 'item_detail') { $item_id = (int) Url::get('id', 0); if (Item::$id == -1) { Item::$id = $item_id; Item::$item = Item::get_item($item_id); AZLib::checkItem(); if (Item::$item && Item::$item['display']) { CGlobal::$curCategory = Item::$item['category_id']; } } } $curCategory = false; if (CGlobal::$curCategory && isset(CGlobal::$allCategories[CGlobal::$curCategory])) { $curCategory = CGlobal::$allCategories[CGlobal::$curCategory]; } $str_keywords = ''; $str_catSub = ''; $meta_desc = ''; if ($curCategory) { if ($curCategory['parent_id'] && isset(CGlobal::$allCategories[$curCategory['parent_id']])) { $parent_cat = CGlobal::$allCategories[$curCategory['parent_id']]; CGlobal::$curMainCat = CGlobal::$allCategories[$curCategory['parent_id']]; CGlobal::$curLevel2Cat = $curCategory; } else { CGlobal::$curMainCat = $curCategory; } } if (CGlobal::$curMainCat && isset(CGlobal::$curMainCat['zones'])) { foreach (CGlobal::$curMainCat['zones'] as $zid) { if ($zid && isset(CGlobal::$allZones[$zid])) { CGlobal::$curZone = CGlobal::$allZones[$zid]; if (CGlobal::$curMainCat['id'] != 100) { break; } } } } if (!CGlobal::$curZone) { $zid = (int) Url::get("zone_id", 0); if ($zid && isset(CGlobal::$allZones[$zid])) { CGlobal::$curZone = CGlobal::$allZones[$zid]; } } if (AZNet::$page['name'] == 'zone') { if (REWRITE_ON) { //tuannk add 2010.07.28 fix redirect 301 với các url link sai $ebname = CGlobal::$curZone['ebname']; $eburl = WEB_DIR . "z" . CGlobal::$curZone['id'] . "/{$ebname}.html"; if ($ebname != '' && strpos($_SERVER['REQUEST_URI'], $eburl) !== 0) { Url::redirect_url($eburl, 301); } } ########################################## #For SEO if (isset(CGlobal::$curZone['cats'])) { foreach (CGlobal::$curZone['cats'] as $catid) { if (isset(CGlobal::$allCategories[$catid])) { $str_catSub .= ($str_catSub ? ', ' : '') . CGlobal::$allCategories[$catid]['name']; if (CGlobal::$allCategories[$catid]['keywords']) { $str_keywords .= ($str_keywords ? ', ' : '') . CGlobal::$allCategories[$catid]['keywords']; } if (CGlobal::$allCategories[$catid]['description']) { $meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$allCategories[$catid]['description']; } } } } if (!$str_keywords) { if ($str_catSub) { $str_keywords = $str_catSub; } else { $str_keywords = CGlobal::$curZone['name']; } } if (!$meta_desc) { if ($str_catSub) { $meta_desc = $str_catSub; } else { $meta_desc = CGlobal::$curZone['name']; } } CGlobal::$keywords = $str_keywords; CGlobal::$meta_desc = $meta_desc; CGlobal::$website_title = CGlobal::$curZone['name']; #For SEO ########################################## } else { $catid = CGlobal::$curCategory; if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['ref_id']) { //redirected $ref_id = CGlobal::$allCategories[$catid]['ref_id']; $ebname = ''; if (isset(CGlobal::$allCategories[$ref_id])) { $ebname = CGlobal::$allCategories[$ref_id]['ebname']; if (CGlobal::$allCategories[$ref_id]['parent_id']) { //DM cấp 2 hoặc 3 $pid = CGlobal::$allCategories[$ref_id]['parent_id']; if (isset(CGlobal::$allCategories[$pid])) { $pcat = CGlobal::$allCategories[$pid]; $ebname = "{$pcat['ebname']}-" . CGlobal::$allCategories[$ref_id]['ebname']; if (CGlobal::$allCategories[$pid]['parent_id']) { //DM cấp 3 $ppid = CGlobal::$allCategories[$pid]['parent_id']; if (isset(CGlobal::$allCategories[$ppid])) { $ppcat = CGlobal::$allCategories[$ppid]; $ebname = "{$ppcat['ebname']}-{$pcat['ebname']}-" . CGlobal::$allCategories[$ref_id]['ebname']; } } } } Url::redirect_url(WEB_DIR . "c{$ref_id}/{$ebname}", 301); } } if (AZNet::$page['name'] == 'list_detail' && REWRITE_ON) { //tuannk add 2010.07.28 fix redirect 301 với các url link sai $ebname_req = Url::get("ebname"); $page_no = (int) Url::get("page_no", 1); if ($page_no <= 1) { $page_no = 0; } $ebname = ''; $eburl = ''; if (CGlobal::$curMainCat) { $ebname = CGlobal::$curMainCat['ebname']; if (CGlobal::$curLevel2Cat) { $ebname .= "-" . CGlobal::$curLevel2Cat['ebname']; $eburl = WEB_DIR . "c" . CGlobal::$curLevel2Cat['id'] . "/" . $ebname; } else { $eburl = WEB_DIR . "c" . CGlobal::$curMainCat['id'] . "/" . $ebname; } } if ($ebname != '') { if ($page_no) { $eburl .= "/page-{$page_no}"; } if (strpos($_SERVER['REQUEST_URI'], $eburl) !== 0 || $ebname_req != $ebname || isset($_GET['page_no']) && $page_no <= 1) { Url::redirect_url($eburl, 301); } } } if (CGlobal::$curLevel2Cat) { //Nếu có cả 2 cấp $str_catSub = CGlobal::$curLevel2Cat['name'] . ', ' . CGlobal::$curMainCat['name']; //Cho subcat if (CGlobal::$curLevel2Cat['keywords']) { CGlobal::$keywords = CGlobal::$curLevel2Cat['keywords']; } if (CGlobal::$curLevel2Cat['description']) { $meta_desc = CGlobal::$curLevel2Cat['description']; } //End Cho subcat if (CGlobal::$curMainCat['description']) { $meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$curMainCat['description']; } //End Cho maincat } elseif (CGlobal::$curMainCat) { //Nếu chỉ có 1 cấp if (isset(CGlobal::$allCategories[CGlobal::$curMainCat['id']]) && isset(CGlobal::$subCategories[CGlobal::$curMainCat['id']])) { $subCats = CGlobal::$subCategories[CGlobal::$curMainCat['id']]; foreach ($subCats as $catSub) { if ($catSub['name']) { $str_catSub .= ($str_catSub ? ', ' : '') . $catSub['name']; } if ($catSub['description']) { $meta_desc .= ($meta_desc ? ', ' : '') . $catSub['description']; } } } $str_catSub .= ($str_catSub ? ', ' : '') . CGlobal::$curMainCat['name']; if (CGlobal::$curMainCat['keywords']) { CGlobal::$keywords = CGlobal::$curMainCat['keywords']; } if (CGlobal::$curMainCat['description']) { $meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$curMainCat['description']; } } //CGlobal::$curCategory if (AZNet::$page['name'] == 'item_detail') { if (Item::$item && Item::$item['status'] == 1) { CGlobal::$meta_desc = AZLib::word_limit(AZLib::descriptionText(Item::$item['brief'] . ' ' . Item::$item['description']), 30, ''); } elseif ($meta_desc) { CGlobal::$meta_desc = $meta_desc; } } elseif ($meta_desc) { CGlobal::$meta_desc = $meta_desc; } } //limit character description and keyword CGlobal::$keywords = AZLib::word_limit(CGlobal::$keywords, 20, ''); CGlobal::$meta_desc = AZLib::word_limit(CGlobal::$meta_desc, 250, ''); //Gán title cho các trang trong! $page_title_arr = array(); $page_title_arr['post_item'] = "Đăng sản phẩm"; $page_title_arr['sign_in'] = "Đăng nhập - Đăng ký thành viên"; if (isset($page_title_arr[AZNet::$page['name']])) { CGlobal::$website_title = $page_title_arr[AZNet::$page['name']] . ' | ' . CGlobal::$website_title; } $this->add_form(new HeaderForm()); }
function build_rss_cat($cat_id = '0', $cat_name = 'home', $limit = 100, $user_id = false) { $rss2 = ''; // content of rss2 file // start:begin rss2 $rss2 = '<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel>'; $rss2 .= '<title>' . $cat_name . ' - ' . WEB_NAME . '</title>'; $rss2 .= '<description>' . $cat_name . ' - ' . WEB_NAME . '</description>'; //$rss2.= '<link>'.trim(XMLLib::_xml_encode_attribute(WEB_ROOT.'?page=list_detail&category_id='.$cat_id)).'</link>'; //$cat_id ? $rss2.= '<link>'.WEB_ROOT.'?page=list_detail&category_id='.$cat_id.'</link>' : $rss2.='<link>'.WEB_ROOT.'?page=list_detail</link>'; $rss2 .= '<link>' . WEB_ROOT . '</link>'; //$rss2.= '<link>'.WEB_ROOT.'?page=list_detail&category_id='.$cat_id.'</link>'; $rss2 .= '<copyright>' . WEB_NAME . ': http://' . strtolower(WEB_NAME) . ' , Powered by AzNet Team: contact@aznetgroup.com</copyright>'; $rss2 .= '<docs>http://backend.userland.com/rss</docs>'; $rss2 .= '<generator>' . WEB_NAME . ':http://' . strtolower(WEB_NAME) . '/rss.html</generator>'; $rss2 .= '<image><title>' . WEB_NAME . '</title><url>' . WEB_ROOT . 'style/img/header/logo.png</url><link>http://' . strtolower(WEB_NAME) . '</link><width>150</width><height>83</height></image>'; $user_id ? $sql = "SELECT item.id, category_id, item.name, item.description, item.created_time \r\n\t\t\t\t\t\t\tFROM item WHERE status=1 AND user_id=" . $user_id . " \r\n\t\t\t\t\t\t\tORDER BY created_time DESC LIMIT 0,25" : ($sql = "SELECT item.id, category_id, item.name, item.description, item.created_time \r\n\t\t\t\t\t\t\tFROM item, category \r\n\t\t\t\t\t\t\tWHERE category.id = item.category_id AND item.status=1 \r\n\t\t\t\t\t\t\tAND (category_id='" . $cat_id . "' OR category.parent_id='" . $cat_id . "') \r\n\t\t\t\t\t\t\tORDER BY created_time DESC LIMIT 0," . $limit); $re = DB::query($sql); if ($re) { while ($item = mysql_fetch_assoc($re)) { $page = 'item_detail'; $item['name'] = trim(XMLLib::_xml_encode_attribute(strip_tags(html_entity_decode($item['name'])))); $item['description'] = trim(XMLLib::_xml_encode_attribute(strip_tags(html_entity_decode(AZLib::word_limit($item['description'], 150), ENT_QUOTES, "UTF-8")))); //$item['url'] = trim(XMLLib::_xml_encode_attribute(WEB_ROOT."?page=".$page."&id=".$item['id']."&category_id=".$item['category_id']."&ebname=".AZLib::safe_title($item['name']))); $item['url'] = WEB_ROOT . "p" . $item['id'] . "/" . AZLib::safe_title($item['name']) . ".html"; //$item['url'] = AZLib::remove_4_js($item['url']); //rss2 $rss2 .= "<item>"; $rss2 .= "<title>" . $item['name'] . " - " . WEB_NAME . "</title>"; $rss2 .= "<description>(" . WEB_NAME . ") - " . $item['description'] . "</description>"; $rss2 .= "<link>" . $item['url'] . "</link>"; $rss2 .= '<guid isPermaLink="True">' . $item['url'] . '</guid>'; $rss2 .= "<pubDate>" . date("D, d M Y H:i:s", $item['created_time']) . " GMT</pubDate>"; $rss2 .= "</item>"; } } //content:end // end:begin $rss2 .= '</channel></rss>'; // end:end return $rss2; }
function BuildPrint($row) { Module::Module($row); ################################################################################################## $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val']; if ($build_catids != '') { $arr = explode(',', $build_catids); $build_catids = ''; if ($arr) { foreach ($arr as $catid) { if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['status'] != 'HIDE') { $build_catids .= ($build_catids != '' ? ',' : '') . $catid; BuildPrint::$cats[$catid] = array('id' => $catid, 'name' => CGlobal::$allCategories[$catid]['name'], 'img' => AZLib::getImageThumb("category/{$catid}.gif", 40, 40, 0, 0), 'item_id' => 0, 'item_name' => '', 'item_url' => '', 'item_price' => '', 'item_warranty' => '', 'list_brief' => ''); } } } } self::$bcatid = (int) Url::get('bcatid'); if (self::$bcatid) { if (isset(BuildPrint::$cats[self::$bcatid])) { self::$bcat = BuildPrint::$cats[self::$bcatid]; } else { Url::redirect_current(array('mode')); } } else { self::$bcat = reset(BuildPrint::$cats); if (self::$bcat) { self::$bcatid = (int) self::$bcat['id']; } } ################################################################################################## $item_ids = ''; $build_ids = isset($_SESSION['build_ids']) ? $_SESSION['build_ids'] : ''; $build_price = 0; if ($build_ids != '') { $items = array(); $re = DB::query("SELECT * FROM item WHERE id IN(" . $build_ids . ") AND status=1 AND price>0 AND quantity>0 ORDER BY find_in_set(category_id,'" . $build_catids . "')"); if ($re) { while ($item = mysql_fetch_assoc($re)) { if (isset(BuildPrint::$cats[$item['category_id']]) && BuildPrint::$cats[$item['category_id']]['item_id'] == 0) { $item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']); BuildPrint::$price += $item['price']; $item_ids .= ($item_ids != '' ? ',' : '') . $item['id']; if (isset(CGlobal::$allCategories[$item['category_id']])) { $item_url = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html"; } else { $item_url = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html"; } if ($item['list_brief'] == '') { $item['list_brief'] = $item['brief']; } $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']); $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']); $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, ''); BuildPrint::$items[$item['id']] = $item; BuildPrint::$cats[$item['category_id']]['item_id'] = $item['id']; BuildPrint::$cats[$item['category_id']]['item_name'] = $item['name']; BuildPrint::$cats[$item['category_id']]['item_url'] = $item_url; BuildPrint::$cats[$item['category_id']]['item_price'] = number_format($item['price'], 0, ',', '.'); BuildPrint::$cats[$item['category_id']]['item_warranty'] = $item['warranty']; BuildPrint::$cats[$item['category_id']]['list_brief'] = $item['list_brief']; } } } } $_SESSION['build_ids'] = "{$item_ids}"; require_once 'forms/BuildPrint.php'; $this->add_form(new BuildPrintForm()); }
function draw() { global $display; $items = array(); $bcats = array(); $filter_groups = array(); if (Build::$bcatid) { $filter_ids = trim(DB::fetch("SELECT GROUP_CONCAT(filter_ids SEPARATOR ',') AS filter_ids FROM (SELECT filter_ids FROM item WHERE " . CGlobal::$item_condition . " AND filter_ids != '') AS filter", 'filter_ids', '')); $pf_array = array(); if ($filter_ids != '') { $f_array = array_count_values(explode(',', $filter_ids)); foreach ($f_array as $fid => $count) { if (isset(CGlobal::$allFilters[$fid])) { $fgid = CGlobal::$allFilters[$fid]['fgid']; if (isset(CGlobal::$all_gfilters[$fgid])) { $pf_array[$fgid][$fid] = $count; } } } } //Tạo Menu Filter if ($this->filter_groups) { foreach ($this->filter_groups as $fgid => $gfilter) { if (isset($pf_array[$fgid])) { if ($gfilter['filters']) { $group_filter = array(); foreach ($gfilter['filters'] as $fid => $filter) { if (isset($pf_array[$fgid][$fid])) { if (!$group_filter) { $group_filter = array('name' => CGlobal::$all_gfilters[$fgid]['name'], 'filters' => array()); } $link = AZRewrite::formatUrl(Url::build_all(array('min', 'max', 'filter', 'page_no'))); if ($this->filter_get) { foreach ($this->filter_get as $get_gid => $get_fid) { if ($get_gid != $fgid) { $link .= "&filter[{$get_gid}]={$get_fid}"; } } } if (isset($this->filter_get[$fgid]) && $this->filter_get[$fgid] == $filter['id']) { if ($this->min) { $link .= "&min=" . $this->min; } if ($this->max) { $link .= "&max=" . $this->max; } $group_filter['filters'] = array($fid => array('link' => $link, 'name' => $filter['name'], 'count' => $pf_array[$fgid][$fid], 'remove' => 1)); break; } else { $link .= "&filter[{$fgid}]={$filter['id']}"; //$link = str_replace(array('?filter=&','?filter=','&filter='),array('?','',''),$link); if ($this->min) { $link .= "&min=" . $this->min; } if ($this->max) { $link .= "&max=" . $this->max; } } $group_filter['filters'][$fid] = array('link' => $link, 'name' => $filter['name'], 'count' => $pf_array[$fgid][$fid]); } } if ($group_filter) { $filter_groups[$fgid] = $group_filter; } } } } } $display->add('url_filter', Url::build_current(array('mode', 'bcatid' => Build::$bcatid))); $display->add('cat_name', CGlobal::$allCategories[Build::$bcatid]['name']); if (isset(Build::$cats[Build::$bcatid]['next_id']) && Build::$cats[Build::$bcatid]['next_id']) { $display->add('next_url', Url::build_current(array('mode', 'bcatid' => Build::$cats[Build::$bcatid]['next_id']))); } else { $display->add('next_url', Url::build_current()); } $display->add('recomend', str_replace(chr(13) . chr(10), "<br />", CGlobal::$allCategories[Build::$bcatid]['recomend'])); $display->add('filter_groups', $filter_groups); $display->add('filter_price', $this->filter_price); $sql = 'SELECT * FROM item WHERE '; $where = ''; $sql .= CGlobal::$item_condition . " ORDER BY price ASC"; $total_row = DB::count("item", CGlobal::$item_condition); ####################################################################################### #Paging $filter_get = Url::get('filter'); $min = Url::get('min'); $max = Url::get('max'); $order = Url::get('order'); $paging = AZPagging::paging_list($limit, $total_row, 10, 10, 'page_no', '', true, 'Linh kiện', 'Trang'); $sql .= $limit; #Paging ####################################################################################### $re = DB::query($sql); if ($re) { while ($item = mysql_fetch_assoc($re)) { 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['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']); if ($item['price']) { $item['price'] = number_format($item['price'], 0, ',', '.') . " VNĐ"; } else { $item['price'] = 'Liên hệ'; } if ($item['list_brief'] == '') { $item['list_brief'] = $item['brief']; } $item['list_brief'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['list_brief'], ENT_QUOTES, "UTF-8")))); $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']); $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']); $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, ''); $item['select'] = Url::build_current(array('bcatid' => $item['category_id'], 'mode', 'item_id' => $item['id'])); $items[$item['id']] = $item; } } $display->add('items', $items); $display->add('paging', $paging); } $display->add('bcats', Build::$cats); if (Build::$price) { $display->add('total_price', number_format(Build::$price, 0, ',', '.') . " VNĐ"); } $display->add('bitems', Build::$items); $display->add('bcatid', Build::$bcatid); $display->add('cur_url', $_SERVER['REQUEST_URI']); $display->add("print_link", Url::open_popup(Url::build('build_print'), 1000, 800, false, false, false, false, false, 1, 1)); $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val']; $display->add('build_catids', $build_catids); $display->add('is_admin', User::is_admin()); $display->add('begin_form', $this->beginForm(false, 'post', false, false, 1)); $display->add('end_form', $this->endForm(1)); $display->output('Build'); }
function Build($row) { Module::Module($row); ################################################################################################## $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val']; if ($build_catids != '') { $arr = explode(',', $build_catids); $build_catids = ''; $last = 0; if ($arr) { foreach ($arr as $catid) { if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['status'] != 'HIDE') { $build_catids .= ($build_catids != '' ? ',' : '') . $catid; Build::$cats[$catid] = array('id' => $catid, 'name' => CGlobal::$allCategories[$catid]['name'], 'recomend' => str_replace(chr(13) . chr(10), "<br />", CGlobal::$allCategories[$catid]['recomend']), 'img' => AZLib::getImageThumb("category/{$catid}.gif", 40, 40, 0, 0), 'item_id' => 0, 'item_name' => '', 'item_url' => '', 'item_price' => '', 'item_warranty' => '', 'list_brief' => ''); if ($last) { Build::$cats[$last]['next_id'] = $catid; } $last = $catid; } } } } self::$bcatid = (int) Url::get('bcatid'); if (self::$bcatid) { if (isset(Build::$cats[self::$bcatid])) { self::$bcat = Build::$cats[self::$bcatid]; } else { Url::redirect_current(array('mode')); } } else { self::$bcat = reset(Build::$cats); if (self::$bcat) { self::$bcatid = (int) self::$bcat['id']; } } ################################################################################################## $item_ids = ''; $build_ids = isset($_SESSION['build_ids']) ? $_SESSION['build_ids'] : ''; $build_price = 0; if ($build_ids != '') { $items = array(); $re = DB::query("SELECT * FROM item WHERE id IN(" . $build_ids . ") AND status=1 AND price>0 AND quantity>0 ORDER BY find_in_set(category_id,'" . $build_catids . "')"); if ($re) { while ($item = mysql_fetch_assoc($re)) { if (isset(Build::$cats[$item['category_id']]) && Build::$cats[$item['category_id']]['item_id'] == 0) { Build::$price += $item['price']; $item_ids .= ($item_ids != '' ? ',' : '') . $item['id']; if (isset(CGlobal::$allCategories[$item['category_id']])) { $item_url = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html"; } else { $item_url = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html"; } if ($item['list_brief'] == '') { $item['list_brief'] = $item['brief']; } $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']); $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']); $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, ''); Build::$items[$item['id']] = $item; Build::$cats[$item['category_id']]['item_id'] = $item['id']; Build::$cats[$item['category_id']]['item_name'] = $item['name']; Build::$cats[$item['category_id']]['item_url'] = $item_url; Build::$cats[$item['category_id']]['item_price'] = number_format($item['price'], 0, ',', '.') . " VNĐ"; Build::$cats[$item['category_id']]['item_warranty'] = $item['warranty']; Build::$cats[$item['category_id']]['list_brief'] = $item['list_brief']; } } } } $item_id = (int) Url::get('item_id'); $bcatid = (int) Url::get('bcatid'); if ($item_id && $bcatid) { $item = Item::get_item($item_id); if ($item && $item['status'] == 1 && $item['price'] > 0 && $item['quantity'] > 0 && isset(Build::$cats[$item['category_id']])) { if (!isset(Build::$items[$item['id']])) { if (Build::$cats[$item['category_id']]['item_id'] > 0) { unset(Build::$items[Build::$cats[$item['category_id']]['item_id']]); } Build::$items[$item['id']] = $item; //$item_ids .= ($item_ids!='' ? ',' : '') . $item['id']; $item_ids = implode(',', array_keys(Build::$items)); $_SESSION['build_ids'] = "{$item_ids}"; $last = 0; foreach (array_keys(Build::$cats) as $catid) { if ($last == self::$bcatid) { Url::redirect_current(array('mode', 'bcatid' => $catid), '#select_item'); } $last = $catid; } } } Url::redirect_current(array('mode', 'bcatid')); } $_SESSION['build_ids'] = "{$item_ids}"; $cmd = Url::get('cmd'); switch ($cmd) { case 'success': require_once 'forms/BuildSuccess.php'; $this->add_form(new BuildSuccessForm()); break; case 'reset': $_SESSION['build_ids'] = ""; Url::redirect_current(); break; case 'order': if ($item_ids != '') { $cart_item_ids = isset($_COOKIE['cart_items']) ? $_COOKIE['cart_items'] : ''; if ($cart_item_ids != '') { $buil_item_arr = explode(',', $item_ids); $item_ids = $cart_item_ids; $cat_item_arr = explode(',', $cart_item_ids); foreach ($buil_item_arr as $item_id) { if (!in_array($item_id, $cat_item_arr)) { $item_ids .= ($item_ids != '' ? ',' : '') . $item_id; } } } if ($item_ids != $cart_item_ids) { AZLib::my_setcookie('cart_items', $item_ids, time() + 3600 * 24 * 365); } $_SESSION['build_ids'] = ""; Url::redirect('cart'); } Url::redirect_current(); break; case '': default: require_once 'forms/Build.php'; $this->add_form(new BuildForm()); break; } }
function processItem($item, $admin_item) { 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'] = AZLib::convertCurrency($item['price'], $item['currency_id']); $item['price_out'] = AZLib::convertCurrency($item['price_out'], $item['currency_id']); $item['currency_id'] = 1; $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']); if ($admin_item) { $item['description'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['description'], ENT_QUOTES, "UTF-8")))); $item['description'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['description']); $item['description'] = str_replace(array("'", "\""), array("", " "), $item['description']); $item['description'] = AZLib::word_limit($item['description'], 200, ''); } $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']}"; } } return $item; }
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']])) { $item['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $item['id'] . '&ebname=' . AZLib::safe_title(AZLib::word_limit($item['name'], 12, '')) . '&nice_name=' . CGlobal::$allCategories[$item['category_id']]['nice_name']); } else { $item['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $item['id'] . '&ebname=' . AZLib::safe_title(AZLib::word_limit($item['name'], 12, ''))); } $tooltip = ''; $tooltip .= 'Xem: ' . $item['read_count'] . ' - Phản hồi: ' . $item['reply_count']; $item['time_label'] = ''; $up_time = date('H:i | ', $item['up_time']); if (date('d.m.y', $item['up_time']) == date('d.m.y', TIME_NOW)) { $up_time .= '<font color="green">Hôm nay</font>'; } else { $up_time .= date('d.m.y', $item['up_time']); } //$item['created_time'] = 'đăng '.AZLib::duration_time($item['up_time']); $item['created_time'] = $up_time; if ($item['price']) { $item['price'] = number_format($item['price'], 0, ',', '.'); $item['currency_id'] = CGlobal::$currency[$item['currency_id']]; } else { $item['price'] = ''; $item['currency_id'] = ''; } $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['no_base_source'] = AZLib::remove_4_js(str_replace(array("<br>", "<br />"), '', $item['brief'])); $item['description'] = AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['description'], ENT_QUOTES, "UTF-8"))); $item['description'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['description']); $item['description'] = str_replace(array("'", "\""), array("", " "), $item['description']); $item['description'] = AZLib::word_limit($item['description'], 250, ''); /* if($item['sapo']!=''){ $item['brief'] = $item['sapo']; $item['brief'] = AZLib::subString(AZLib::filter_title($item['brief']),0,255,true); $item['brief'] = AZLib::word_limit($item['brief'],30,''); } else{ $item['brief'] = String::display_sort_title($item['description'],30); } */ $item['brief'] = ''; $item['parent_name'] = ''; if (isset(CGlobal::$allCategories[$item['category_id']]) && CGlobal::$allCategories[$item['category_id']]['parent_id']) { $parent_id = CGlobal::$allCategories[$item['category_id']]['parent_id']; if (isset(CGlobal::$allCategories[$parent_id])) { $item['parent_name'] = CGlobal::$allCategories[$parent_id]['name'] . ' - '; } } if (isset(CGlobal::$allCategories[$item['category_id']]['name'])) { $item['category_name'] = $item['parent_name'] . CGlobal::$allCategories[$item['category_id']]['name']; } else { $item['category'] = ''; $item['category_name'] = ''; } $item['safe_title'] = AZLib::safe_title($item['parent_name'] . $item['category_name']); $item['category_href'] = WEB_DIR . AZRewrite::formatUrl('?page=list_detail&category_id=' . $item['category_id'] . '&ebname=' . $item['safe_title']); $item['name'] = AZLib::subString(AZLib::filter_title($item['name']), 0, 115, true); $item['name'] = AZLib::word_limit($item['name'], 12, ''); $item['user_name'] = $item['user_name']; $item['profile_url'] = WEB_DIR . $item['user_name']; $item['city'] = CGlobal::$provinces[$item['province_id']]['name']; if ($item['img_url']) { $item['img_url'] = AZLib::getImageThumb($item['img_url'], 110, 0, 1, $item['img_server']); } else { $item['img_url'] = 'style/images/no-images-69x53.jpg'; } if (isset($_GET['ebname'])) { $item['up_url'] = Url::build_current(array('action' => 'up', 'id' => $item['id'], 'category_id' => CGlobal::$curCategory, 'type' => Url::get('type'), 'ebname' => $_GET['ebname'])); $item['down_url'] = Url::build_current(array('action' => 'down', 'id' => $item['id'], 'category_id' => CGlobal::$curCategory, 'type' => Url::get('type'), 'ebname' => $_GET['ebname'])); } else { $item['up_url'] = Url::build_current(array('action' => 'up', 'id' => $item['id'], 'category_id' => CGlobal::$curCategory, 'type' => Url::get('type'))); $item['down_url'] = Url::build_current(array('action' => 'down', 'id' => $item['id'], 'category_id' => CGlobal::$curCategory, 'type' => Url::get('type'))); } $item['in_wish_list'] = false; if (User::is_login()) { if (in_array($item['id'], $w_items)) { $item['in_wish_list'] = true; } else { $item['in_wish_list'] = false; } } else { if (isset($_COOKIE['wish_list_item_ids'])) { $arr = explode(',', $_COOKIE['wish_list_item_ids']); foreach ($arr as $k => $v) { if ($v == $item['id']) { $item['in_wish_list'] = true; } } } } if (CGlobal::$user_profile['id'] == User::id()) { $tooltip .= ' - <strong>ID tin: ' . $item['id'] . '</strong>'; } $item['invalid'] = ''; if ($item['status'] == 2) { $tooltip .= '<div style=\\\'color:red\\\'>(Đang kiểm duyệt)</div>'; $item['invalid'] = '<font color="red">(Đang kiểm duyệt)</font>'; } elseif ($item['status'] == 3) { $tooltip .= '<div style=\\\'color:red\\\'>(Tin theo dõi lừa đảo)</div>'; $item['invalid'] = '<font color="red">(Theo dõi lừa đảo)</font>'; } elseif ($item['status'] == 0) { $tooltip .= '<div style=\\\'color:red\\\'>(Đang ẩn)</div>'; $item['invalid'] = '<font color="red">(Đang ẩn)</font>'; } elseif ($item['status'] == 5) { $tooltip .= '<div style=\\\'color:red\\\'>(Đang kiểm duyệt chờ chứng thực)</div>'; $item['invalid'] = '<font color="red">(KD chờ chứng thực)</font>'; } elseif ($item['status'] == 4) { $tooltip .= '<div style=\\\'color:red\\\'>(Tin trùng)</div>'; $item['invalid'] = '<font color="red">(Tin trùng)</font>'; } elseif ($item['state'] == 1) { $tooltip .= '<div style=\\\'color:red\\\'>(Đang khóa)</div>'; $item['invalid'] = '<font color="red">(Đang khóa)</font>'; } $item['tooltip'] = $tooltip; $item['lids'] = ''; $item_ids .= ($item_ids != '' ? ',' : '') . $item['id']; $items[$item['id']] = $item; } } if ($item_ids) { $item_labels = array(); //Label của tất cả sp đang đc hiển thị $re = DB::query("SELECT id, label_id, item_id FROM label_item WHERE item_id IN({$item_ids})"); if ($re) { while ($l_item = mysql_fetch_assoc($re)) { if (isset($items[$l_item['item_id']])) { $items[$l_item['item_id']]['lids'] .= ($items[$l_item['item_id']]['lids'] != '' ? ',' : '') . $l_item['label_id']; } } } } } $display->add('loading_ajax', true); $display->add('is_admin', (int) User::have_permit(ADMIN_ITEM)); $display->add('cur_id', (int) User::id()); $display->add('total_sp', (int) $total_item); $display->add('items', $items); $display->add('paging', $pagging); $display->add('item_per_page', $item_per_page); $display->add('page_num', $page_shop_item); $display->add('shop_user_id', CGlobal::$user_profile['id']); $display->add('shop_user_name', CGlobal::$user_profile['user_name']); $display->output($list_type != 1 ? 'ShopItem' : 'ShopItemListDetail', false, 'Shop'); }