コード例 #1
0
ファイル: class.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $cmd = Url::get('cmd');
     $display->add('id_survey', $this->public_survey['id']);
     $display->add('title', stripslashes($this->public_survey['title']));
     $display->add('question', stripslashes($this->public_survey['question']));
     $display->add('url_edit', Url::build('admin_survey', array('cmd' => 'edit', 'id_survey' => $this->public_survey['id'])));
     $opts = DB::fetch_all('SELECT * FROM `public_survey_opinion` WHERE `id_survey`=' . $this->public_survey['id']);
     $i = 0;
     foreach ($opts as &$opt) {
         $i++;
         $opt['num'] = $i;
         $opt['edit'] = Url::build_current(array('id_survey' => Url::get('id_survey', 'int', 0), 'cmd' => 'edit', 'id' => $opt['id']));
         $opt['del'] = Url::build_current(array('id_survey' => Url::get('id_survey', 'int', 0), 'cmd' => 'delete', 'id' => $opt['id']));
     }
     $display->add('opts', $opts);
     if ($cmd == 'edit') {
         $public_survey_opinion = DB::select('public_survey_opinion', 'id=' . Url::get('id', 0));
         if ($public_survey_opinion) {
             $display->add('value', $public_survey_opinion['option']);
             $display->add('option_id', $public_survey_opinion['id']);
         }
     }
     $this->beginForm();
     $display->output('PublicSurveyOption');
     $this->endForm();
 }
コード例 #2
0
ファイル: FeedbackReply.php プロジェクト: duynhan07/elink
 function on_submit()
 {
     $reply_content = trim(Url::get('reply_content'));
     $subject = AZLib::stripUnicode(trim(Url::get('subject')));
     if (strlen($reply_content) > 20) {
         //Gửi mail đã:
         if ($subject == '') {
             $subject = "Tra loi lien he cua ban... ( Reply for your feedback... )";
         }
         $content = $reply_content . MAIL_FOOTER . "<hr />" . "<b>Nội dung ý kiến / liên hệ của bạn đã gửi cho chúng tôi vào lúc: " . date('H:i:s d/m/Y', $this->contact['time']) . ":</b><br />\n\t\t\t\t\t\t<b>&quot;</b>" . stripslashes($this->contact['content']) . "<b>&quot;</b>";
         if (System::sendEBEmail($this->contact['email'], "[" . WEB_NAME . "] {$subject}", $content)) {
             $reply_content = stripslashes($this->contact['reply_content']) . "<a href='" . Url::build('profile', array('id' => User::id())) . "'>" . User::user_name() . "</a> Gửi lúc: " . date('H:i:s d/m/Y', TIME_NOW) . "<br /><b>Email Subject:</b> " . $subject . "<br /><br />" . $reply_content . '<hr />';
             if (DB::update('feedback', array('reply_content' => addslashes($reply_content), 'status' => 1), 'id=' . $this->contact['id'])) {
                 //Gửi mail cho admin
                 System::sendEBEmail(FEEDBACK_EMAIL, "[" . WEB_NAME . "] " . 'Reply for feedback: ' . $this->contact['name'] . ' - ' . $this->contact['address'] . ' - ' . $this->contact['email'], $content);
                 Url::redirect_current();
             } else {
                 $this->setFormError('', 'Không cập nhật được dữ liệu');
             }
         } else {
             $this->setFormError('subject', 'Không gửi được email tới khách hàng!');
         }
         //End gửi mail
     } else {
         $this->setFormError('reply_content', 'Nội dung phản hồi phải lớn hơn 20 ký tự');
     }
 }
コード例 #3
0
ファイル: NewsPage.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $cat_newss = array();
     $display->add('is_admin', User::have_permit(ADMIN_NEWS));
     $display->add('url_home', WEB_DIR);
     $display->add('time_now', News::displayTime());
     $display->add('cat_name', $this->news_cat['name']);
     $display->add('cat_url', URL::build('news_list', array('news_catid' => $this->news_cat['id'], 'azname' => AZLib::safe_title($this->news_cat['name']))));
     $condition = ' status=1 ';
     $total = DB::count("news", $condition);
     $limit = '';
     //$pagging	= AZPagging::paging_list($limit,20,'page_no');
     $pagging = AZPagging::paging_list($limit, $total, 20);
     $re = DB::query('SELECT * FROM news WHERE ' . $condition . ' ORDER BY id DESC' . $limit);
     if ($re) {
         while ($news = mysql_fetch_assoc($re)) {
             $news['title'] = stripslashes($news['title']);
             $news['brief'] = stripslashes($news['brief']);
             $news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
             if ($news['image']) {
                 $news['image'] = AZLib::getImageThumb($news['image'], 150, 0, 0, $news['img_server']);
             }
             $news['news_h'] = date('H:i', $news['time_created']);
             $news['news_d'] = date('d-m-Y', $news['time_created']);
             $news['admin_link'] = News::admin_link($news);
             $cat_newss[$news['id']] = $news;
         }
     }
     $display->add('pagging', $pagging);
     $display->add('cat_newss', $cat_newss);
     $display->output("NewsPage");
 }
コード例 #4
0
ファイル: NewsHomeHot.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $news_ids = '';
     $hot_newss = array();
     $configs = @CGlobal::$configs['NewsHomeHot']['conf_val'];
     if ($configs) {
         $configs = unserialize(stripslashes($configs));
         $title_news = $configs['title'];
         $news_ids = $configs['news_ids'];
     } else {
         $title_news = "TIN HOT";
         $news_ids = '';
     }
     if ($news_ids != '') {
         $re = DB::query("SELECT id, title, news_catid FROM news WHERE id IN({$news_ids}) AND status = 1 ORDER BY find_in_set(id,'{$news_ids}')");
         if ($re) {
             while ($news = mysql_fetch_assoc($re)) {
                 $news['title'] = stripslashes($news['title']);
                 $news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
                 $hot_newss[$news['id']] = $news;
             }
         }
     }
     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_news', $title_news);
     $display->add('news_ids', $news_ids);
     $display->add('hot_newss', $hot_newss);
     $display->output("NewsHomeHot");
 }
コード例 #5
0
ファイル: NewsLetter.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     if (User::is_admin()) {
         $display->add('edit', '<a title="Quản trị Các email" target="_blank" href="' . Url::build('news_letter_admin') . '"><img src="style/images/edit.gif" alt="Sửa" border="0"/></a>');
     }
     $this->beginForm();
     $display->output("NewsLetter");
     $this->endForm();
 }
コード例 #6
0
ファイル: register_success.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     if (Url::get('cmd') == 'activated') {
         //Kích hoạt thành công
         $display->add('title', 'Kích hoạt tài khoản thành công!');
         $this->setFormSucces('', 'Tài khoản của bạn đã được kích hoạt thành công!');
         $display->add('msg', $this->showFormSuccesMessages(1));
     } else {
         $display->add('title', 'Đăng ký thành công!');
     }
     $display->add('url_shop', Url::build('profile', array('user_id' => User::id(), 'user_name' => User::user_name())));
     $display->output('success');
 }
コード例 #7
0
ファイル: Cart.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $display->add('msg', $this->showFormErrorMessages(1));
     $quantity_total = 0;
     $price_total = 0;
     $cart_items = array();
     if (Cart::$cart_items) {
         foreach (Cart::$cart_items as $cart_item_id => $cart_item) {
             $item = Cart::$items[$cart_item['item_id']];
             if (isset(CGlobal::$allCategories[$item['category_id']])) {
                 $cart_item['url'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
             } else {
                 $cart_item['url'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
             }
             $cart_item['name'] = $item['name'];
             $cart_item['price_num'] = $item['price'];
             $cart_item['price'] = number_format($item['price'], 0, ',', '.');
             if ($item['img_url']) {
                 $cart_item['img_url'] = AZLib::getImageThumb($item['img_url'], 120, 120, 0, $item['img_server']);
             } else {
                 $item['img_url'] = '';
             }
             $cart_item['row_total'] = $cart_item['checked'] ? number_format($item['price'] * $cart_item['quantity'], null, null, '.') . ' VNĐ' : '';
             $cart_item['delete'] = Url::build_current(array('cmd' => 'delete', 'id' => $cart_item['id']));
             $price_total += $cart_item['checked'] ? $item['price'] * $cart_item['quantity'] : 0;
             $quantity_total += $cart_item['checked'] ? $cart_item['quantity'] : 0;
             $cart_items[$cart_item['id']] = $cart_item;
         }
     }
     $display->add('quantity_total', number_format($quantity_total, null, null, '.'));
     $display->add('price_total', number_format($price_total, null, null, '.'));
     $display->add('url_finish', Url::build_current(array('cmd' => 'finish')));
     $display->add('cart_items', $cart_items);
     $display->add("print_link", Url::open_popup(Url::build('cart_print', array('id' => Cart::$cart['id'])), 1000, 800, false, false, false, false, false, 1, 1));
     $this->beginForm();
     $display->output('Cart');
     $this->endForm();
 }
コード例 #8
0
ファイル: NewsDetail.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     if (User::is_admin()) {
         $display->add("is_admin", 1);
     }
     $display->add('url_home', WEB_DIR);
     $display->add('time_create', News::displayTime($this->news['time_created']));
     $display->add('title', stripslashes($this->news['title']));
     $display->add('brief', stripslashes($this->news['brief']));
     $display->add('content', stripslashes($this->news['content']));
     $display->add('pen_name', stripslashes($this->news['pen_name']));
     if ($this->news['source'] != '') {
         $display->add('source', " ( theo <i>" . stripslashes($this->news['source']) . "</i> )");
     } else {
         $display->add('source', "");
     }
     if (User::have_permit(ADMIN_NEWS)) {
         $display->add('admin_link', News::admin_link($this->news));
     }
     if ($this->news['image']) {
         $display->add('img_full_url', "http://" . CGlobal::$img_server[$this->news['img_server']] . $this->news['image']);
         $display->add('img_max_path', AZLib::getImageThumbMax($this->news['image'], '', 1, $this->news['img_server']));
         $display->add('image_title', stripslashes($this->news['image_title']));
         $display->add('image_url', AZLib::getImageThumb($this->news['image'], 180, 0, 0, $this->news['img_server']));
         //AZLib::safe_title($this->news['title']))
         $display->add('image_oringin', $this->news['image']);
     }
     $news_cart = CGlobal::$allNewsCategories[$this->news['news_catid']];
     $display->add('news_home_link', Url::build('news'));
     if ($news_cart) {
         $display->add('cat_link', Url::build('news', array('news_catid' => $news_cart['id'], 'azname' => AZLib::safe_title($news_cart['name']))));
         $display->add('cat_name', $news_cart['name']);
     }
     $display->add("share_title", urlencode(CGlobal::$website_title));
     $display->add("share_url", "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     $display->add("share_des", urlencode(trim(CGlobal::$meta_desc)));
     $display->output("NewsDetail");
 }
コード例 #9
0
ファイル: News.php プロジェクト: duynhan07/elink
 static function admin_link($row)
 {
     $str = '';
     if (User::have_permit(ADMIN_NEWS)) {
         $href = urlencode(Url::build_all());
         $str = '<br />';
         $str .= '<a href="' . Url::build('news_admin', array('cmd' => 'add')) . '"><b>Thêm tin</b></a> | ';
         $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'edit', 'href' => $href)) . '"><b>Sửa tin</b></a> | ';
         if (!$row['status']) {
             $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'pub', 'act' => 'Publish', 'href' => $href)) . '" )"><b>Hiển thị tin</b></a> | ';
         } else {
             $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'pub', 'act' => 'UnPublish', 'href' => $href)) . '" )"><b>Ẩn tin</b></a> | ';
         }
         $str .= '<a href="' . Url::build('news_admin', array('id' => $row['id'], 'cmd' => 'delete', 'href' => $href)) . '" onclick="return confirm(\'Bạn có chắc chắn xóa không?\')"><b>Xóa tin</b></a> ';
         $str .= '<br />[ <b>Thêm:</b> <a href="' . Url::build('profile', array('username' => $row['username'])) . '"><b>' . $row['username'] . '</b></a> - ' . date('d/m/Y H:i', $row['time_created']) . ' || ';
         $str .= '<b>Sửa:</b> <a href="' . Url::build('profile', array('username' => $row['user_modify'])) . '"><b>' . $row['user_modify'] . '</b></a> - ' . date('d/m/Y H:i', $row['time_modify']) . ' ]';
         if ($row['admin_comment'] != '') {
             $str .= '<br /><b><font color="red">Ghi chú: </font></b><font color="red">' . $row['admin_comment'] . '</font></b>';
         }
         // Hien thi comment cua Bien tap
     }
     return $str;
 }
コード例 #10
0
ファイル: EditBookingVip.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     AZLib::getCats();
     $this->beginForm();
     $item = Item::get_item($this->booking_vip['item_id']);
     if (!$item || $item && $item['status'] == -1) {
         $this->setFormError("item_id", "Tin không tồn tại!");
     } else {
         $display->add('item_name', stripslashes($item['name']));
         $display->add('item_link', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
     }
     $top_catid = $item['level_1_catid'];
     $cat_id = $item['category_id'];
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('item_id', $this->booking_vip['item_id']);
     if ($this->booking_vip['top_cat']) {
         $display->add('category', 1);
     } else {
         if ($this->booking_vip['cat_id']) {
             $display->add('category', 2);
         }
     }
     $display->add('num_contract', $this->booking_vip['num_contract']);
     $display->add('top_cat_name', CGlobal::$allCategories[$top_catid]['name']);
     $display->add('cat_name', CGlobal::$allCategories[$cat_id]['name']);
     $display->add('note', stripslashes(Url::get("note", $this->booking_vip['note'])));
     $display->add('time_start', Url::get("time_start", date('d-m-Y', $this->booking_vip['time_start'])));
     if ($this->booking_vip['time_end']) {
         $display->add('time_end', Url::get("time_end", date('d-m-Y', $this->booking_vip['time_end'])));
     } else {
         $display->add('time_end', Url::get("time_end", ''));
     }
     $display->output('EditBookingVip');
     $this->endForm();
 }
コード例 #11
0
ファイル: footer.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $display->add('url_home', WEB_DIR);
     $footer_content = html_entity_decode(@CGlobal::$configs['footer_content']['conf_val'], ENT_QUOTES, "UTF-8");
     if ($footer_content != '') {
         $display->add("footer_content", $footer_content);
     }
     if (User::is_admin()) {
         $display->add("edit_link", Url::open_popup(Url::build('footer_edit'), 800, 600, false, false, false, false, false, 1, 1));
     }
     $display->add("web_dir", WEB_DIR);
     $total = (int) DB::fetch('SELECT count(*) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900), 'total', 1);
     $mem = (int) DB::fetch('SELECT count(total) as total FROM ( SELECT count(user_id) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900) . ' AND user_id !=0 GROUP BY user_id) as t', 'total', 1);
     $guest = (int) ($total - $mem);
     $display->add("FOOTER_CONTENT", FOOTER_CONTENT);
     $display->add("is_admin", User::is_admin());
     $display->add("online", number_format($total, null, null, '.'));
     $display->add("mem", number_format($mem, null, null, '.'));
     $display->add("guest", number_format($guest, null, null, '.'));
     $display->add("site_hit", (int) User::$site_hit);
     $display->add("site_hit_day", (int) User::$site_hit_day);
     $display->output("Footer");
 }
コード例 #12
0
ファイル: list.php プロジェクト: hqd276/bigs
 function draw()
 {
     global $display;
     $this->beginForm(false, 'post', false, Url::build_current());
     $name = trim(Url::get('name'));
     $order_by = Url::get('order_by', 'id');
     $order_dir = Url::get('order_dir', 'DESC');
     $cond = ' 1 ';
     if ($name != '') {
         $cond .= ' AND name LIKE "%' . $name . '%"';
     }
     $item_per_page = 50;
     $total_row = DB::fetch('SELECT count(*) AS total_row FROM `page` WHERE ' . $cond . ' LIMIT 0,1', 'total_row', 0);
     $items = array();
     $paging = '';
     if ($total_row) {
         $limit = '';
         require_once ROOT_PATH . 'core/ECPagging.php';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $sql = 'SELECT  id ,name,title, description FROM  `page` WHERE ' . $cond . ' ORDER BY ' . $order_by . ' ' . $order_dir . ' ' . $limit;
         $re = DB::query($sql);
         if ($re) {
             while ($row = mysql_fetch_assoc($re)) {
                 $row['href'] = Url::build('edit_page', array('id' => $row['id']));
                 $items[$row['id']] = $row;
             }
         }
     }
     if ($order_dir == 'ASC') {
         $order_dir = 'DESC';
     } else {
         $order_dir = 'ASC';
     }
     $href_id = Url::build_current(array('order_by' => 'id', 'order_dir' => $order_dir));
     $href_name = Url::build_current(array('order_by' => 'name', 'order_dir' => $order_dir));
     $href_des = Url::build_current(array('order_by' => 'description', 'order_dir' => $order_dir));
     $href_title = Url::build_current(array('order_by' => 'title', 'order_dir' => $order_dir));
     $img_id = '';
     $img_name = '';
     $img_title = '';
     $img_des = '';
     if ($order_by == 'id') {
         $img_id = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'name') {
         $img_name = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'description') {
         $img_des = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'title') {
         $img_title = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     $display->add('img_id', $img_id);
     $display->add('img_name', $img_name);
     $display->add('img_title', $img_title);
     $display->add('img_des', $img_des);
     $display->add('href_id', $href_id);
     $display->add('href_title', $href_title);
     $display->add('href_name', $href_name);
     $display->add('href_des', $href_des);
     $display->add('name', $name);
     $display->add('paging', $paging);
     $display->add('items', $items);
     $display->add('hover', EClassApi::mouse_hover('#E2F1DF', true));
     $display->output('list');
     $this->endForm();
 }
コード例 #13
0
ファイル: AZLib.php プロジェクト: duynhan07/elink
    static function Send_pm($sender_id, $sender_name, $receiver_user, $title, $content, $once_way = false, $ref_id = 0)
    {
        $num_send = 0;
        $new_row_msg = array('msg_date' => TIME_NOW, 'msg_post' => htmlspecialchars_decode($content), 'msg_author_id' => $sender_id, 'msg_author_name' => $sender_name, 'msg_ip_address' => AZLib::ip());
        // ***** CHÚ Ý *****
        // Newest = 0 - Mới nhất, = 1 - Cũ hơn (Do lỗi tạo giá trị mặc định trường này là 0, nên quy ước hơi bị ngược, để đỡ mất công chạy lệnh update database
        // ***** CHÚ Ý *****
        $msg_id = DB::insert('message_text', $new_row_msg);
        $inbox_ref_id = 0;
        if ($ref_id) {
            $msgText = DB::select('message_topics', 'mt_id = ' . $ref_id . ' AND mt_owner_id = ' . $sender_id);
            if ($msgText['mt_msg_id']) {
                // Kiểm tra xem người nhận còn tin nhắn gốc hay không
                $mtTopic = DB::select('message_topics', 'mt_msg_id = ' . $msgText['mt_msg_id'] . ' AND mt_id <> ' . $ref_id . ' AND mt_owner_id = ' . $receiver_user['id'] . ' AND mt_from_id <> ' . $receiver_user['id']);
                // Nế còn tin nhắn gốc
                if ($mtTopic['mt_id']) {
                    // Gán tin nhắn sắp gửi là tin nhắn mới nhất
                    // Lấy id tin nhắn gốc của người gửi làm ref_id cho tin nhắn sắp gửi
                    $inbox_ref_id = $mtTopic['mt_id'];
                }
            }
        }
        // Đặt cờ tin nhắn mới nhất (inbox) của các tin trong luồng của người nhận = 0
        if ($inbox_ref_id) {
            DB::query('UPDATE message_topics SET mt_newest = 1 WHERE mt_newest = 0 AND mt_vid_folder = \'inbox\' AND (mt_ref_id = ' . $inbox_ref_id . ' OR mt_id = ' . $inbox_ref_id . ') AND mt_owner_id = ' . $receiver_user["id"]);
        }
        // Đặt cờ tin nhắn mới nhất (sent) của các tin trong luồng của người gửi = 0
        if ($ref_id) {
            DB::query('UPDATE message_topics SET mt_newest = 1 WHERE mt_newest = 0 AND mt_vid_folder = \'sent\' AND (mt_ref_id = ' . $ref_id . ' OR mt_id = ' . $ref_id . ') AND mt_owner_id = ' . $sender_id);
        }
        $new_row_msg = array('mt_msg_id' => $msg_id, 'mt_date' => TIME_NOW, 'mt_title' => $title, 'mt_ref_id' => $inbox_ref_id, 'mt_newest' => 0, 'mt_to_name' => $receiver_user["user_name"], 'mt_read' => 0);
        $arrID = array($sender_id, $sender_name, $receiver_user["id"], $receiver_user["user_name"]);
        // Tạo tiêu đề tin nhắn mới
        $msg_id_inbox = AZLib::InserMessage($new_row_msg, $arrID, $status = 'inbox');
        if ($msg_id_inbox) {
            $num_send++;
            //insert vao bang feed
            $feed_sql = "(4,{$receiver_user['id']},{$msg_id_inbox},{$new_row_msg['mt_date']},{$sender_id},0)";
            $feed_sql = "INSERT INTO feed (`type`,`user_id`,`ref_id`,`time`,`act_user_id`,`item_id`) VALUES " . $feed_sql;
            DB::query($feed_sql);
        }
        if ($once_way == false) {
            $new_row_msg['mt_read'] = 1;
            $new_row_msg['mt_ref_id'] = $ref_id;
            $msg_id_sent = AZLib::InserMessage($new_row_msg, $arrID, $status = 'sent');
            $num_send++;
        } else {
            $msg_id_sent = true;
        }
        // Nếu tin được tạo mới là tin nhắn trả lời
        //if($inbox_ref_id)
        //{
        // Đặt cờ đã có tin nhắn trả lời cho tin nhắn gốc trong cả "inbox" và "sent"
        //DB::query('	UPDATE message_topics SET mt_has_reply = 1 WHERE mt_id = ' . $ref_id . ' AND mt_vid_folder = \'inbox\'');
        //	DB::query('	UPDATE message_topics SET mt_has_reply = 1 WHERE mt_id = ' . $inbox_ref_id);
        //}
        if ($msg_id_inbox && $msg_id_sent) {
            $count_pm = true;
            // Đối với tin trả lời, chỉ đếm những tin trả lời mới cho tin thuộc các luồng tin khác nhau
            if ($ref_id) {
                // Kiểm tra xem trong luồng tin hiện tại có tin trả lời nào chưa đọc hay không
                $re = DB::query('SELECT COUNT(*) AS unreadCount FROM message_topics
								WHERE mt_ref_id = ' . $ref_id . ' 
									AND mt_vid_folder = \'inbox\' AND mt_owner_id = ' . $receiver_user["id"] . '
									AND mt_read = 0');
                if ($re) {
                    $row = mysql_fetch_assoc($re);
                    // Nếu có thì không tính thêm tin này vào tổng pm
                    if ($row['unreadCount'] > 1) {
                        $count_pm = false;
                    }
                }
            }
            if ($count_pm) {
                DB::query('UPDATE user SET total_pm = total_pm + 1 WHERE id=' . $receiver_user["id"]);
            }
            User::getUser($receiver_user["id"], 0, 1);
            DB::query("UPDATE message_text SET msg_sent_to_count = {$num_send} WHERE msg_id = {$msg_id}");
            if ($receiver_user['email'] && $receiver_user['email_alert']) {
                $link = WEB_ROOT . Url::build('message');
                $content = trim(addslashes(AZLib::parseBBCode($title . ' - ' . $content, true)));
                AZLib::addCronJob('pm', $content, $receiver_user['id'], User::user_name(), '', 0, '', $link);
            }
            return true;
        } else {
            return false;
        }
    }
コード例 #14
0
ファイル: page_content.php プロジェクト: hqd276/bigs
 function draw_list($region, $modules)
 {
     $i = 0;
     $last = false;
     if ($modules) {
         foreach ($modules as $key => $item) {
             if ($i) {
                 if ($i > 1) {
                     $last['move_up'] = '<a href="' . Url::build_current(array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $last['id'], 'move' => 'up')) . '"><img src="style/images/admin/up_arrow_.gif" alt="Move up"></a>';
                     $last['move_top'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $last['id'], 'cmd' => 'move_top')) . '">MoveTop</a>';
                 }
                 $last['move_down'] = '<a href="' . Url::build('edit_page', array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $last['id'], 'move' => 'down')) . '"><img src="style/images/admin/down_arrow_.gif" alt="Move down"></a>';
                 $last['move_bottom'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $last['id'], 'cmd' => 'move_bottom')) . '">MoveBottom</a>';
             }
             $i++;
             $last =& $modules[$key];
             $last['move_up'] = '';
             $last['move_down'] = '';
         }
         if ($i > 1) {
             $modules[$key]['move_up'] = '<a href="' . Url::build('edit_page', array('cmd' => 'move', 'id' => $this->page['id'], 'block_id' => $item['id'], 'move' => 'up')) . '"><img src="style/images/admin/up_arrow_.gif" alt="Move up"></a>';
             $modules[$key]['move_top'] = '<a href="' . Url::build('edit_page', array('id' => $this->page['id'], 'block_id' => $item['id'], 'cmd' => 'move_top')) . '">MoveTop</a>';
         }
     }
     global $display;
     $display->add('hover', EClassApi::mouse_hover('#CCCCCC', true));
     $display->add('id', $this->page['id']);
     $display->add('name', $region);
     $display->add('items', $modules);
     return $display->output('list_block', true);
 }
コード例 #15
0
ファイル: ajax_comment.ajax.php プロジェクト: hqd276/bigs
 function get_comment_thoitrang($sql, $sub = 0)
 {
     global $user_id_arr, $stt, $item_per_page;
     //echo $sql;exit;
     $re = DB::query($sql);
     $items = array();
     $id_parent = '';
     while ($item = mysql_fetch_assoc($re)) {
         if ($sub == 0) {
             $stt++;
         }
         //	if($sub || ($sub == 0 && $stt<=$item_per_page)){
         //$item['created_time'] = EClassApi::duration_time($item['time']);
         $item['created_time'] = date('H:i | d.m.Y', $item['time']);
         if ($item['sender_user_id']) {
             $item['sender_link'] = Url::build('shop', array('user_name' => $item['sender_user_name']));
         } else {
             $item['sender_link'] = '';
         }
         if ($item['sender_user_id']) {
             $item['user_id'] = $item['sender_user_id'];
             if (!in_array($item['sender_user_id'], $user_id_arr)) {
                 $user_id_arr[$item['sender_user_id']] = $item['sender_user_id'];
             }
         } else {
             $item['user_id'] = 0;
             if ($item['id'] % 3 == 0) {
                 $item['sender_avatar_url'] = 'style/avatar/1.png';
             } elseif ($item['id'] % 3 == 1) {
                 $item['sender_avatar_url'] = 'style/avatar/2.png';
             } else {
                 $item['sender_avatar_url'] = 'style/avatar/3.png';
             }
             $html_content = '';
             $item['is_block'] = 0;
             $item['is_admin_mod'] = array();
         }
         $item['content'] = EClassApi::parseBBCode($item['content']);
         $item['URL_badcontent'] = Url::build('item_detail', array('id' => Url::get('id'), 'ctype' => 'comment', 'id_comment' => $item['id']));
         if ($sub) {
             $items['item'][$item['parent_id']][$item['id']] = $item;
         } else {
             if ($item['have_child'] > 0) {
                 $id_parent .= ($id_parent ? ',' : '') . $item['id'];
             }
             $items['item'][$item['id']] = $item;
         }
         $items['id_parent'] = $id_parent;
     }
     //}
     return $items;
 }
コード例 #16
0
ファイル: users.php プロジェクト: rubenvincenten/anchor-site
 public static function recover_password()
 {
     $post = Input::post(array('email'));
     $errors = array();
     if (filter_var($post['email'], FILTER_VALIDATE_EMAIL) === false) {
         $errors[] = 'Please enter a valid email address';
     } else {
         if (($user = static::find(array('email' => $post['email']))) === false) {
             $errors[] = 'Account not found';
         }
     }
     if (count($errors)) {
         Notifications::set('error', $errors);
         return false;
     }
     $hash = hash('md5', $user->id . $user->email . $user->password);
     $link = Url::build(array('path' => Url::make('admin/users/reset/' . $hash)));
     $subject = '[' . Config::get('metadata.sitename') . '] Password Reset';
     $plain = 'You have requested to reset your password. To continue follow the link below. ' . $link;
     $headers = array('From' => 'no-reply@' . Input::server('http_host'));
     Email::send($user->email, $subject, $plain, $headers);
     Notifications::set('notice', 'We have sent you an email to confirm your password change.');
     return true;
 }
コード例 #17
0
ファイル: class.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $act = Url::get('act');
     $this->beginForm();
     if (Url::get('href')) {
         $display->add('back', Url::get('href'));
     } else {
         $display->add('back', Url::build('admin_news'));
     }
     if ($act == 'Publish') {
         $display->add('status_title', "HIỂN THỊ");
     } else {
         $display->add('status_title', "ẨN");
     }
     $display->add('id', $this->news['id']);
     $display->add('title', $this->news['title']);
     $display->add('admin_comment', $this->news['admin_comment']);
     $display->add('status', $this->news['status'] ? 'Hiển thị' : 'Ẩn');
     $display->add('cat', "[" . $this->news['news_catid'] . "] " . CGlobal::$allNewsCategories[$this->news['news_catid']]['name']);
     $display->add('url', Url::build('news_detail', array('news_catid' => $this->news['news_catid'], 'news_id' => $this->news['id'])));
     $display->output('NewsPublic');
     $this->endForm();
 }
コード例 #18
0
ファイル: ManageItem.php プロジェクト: duynhan07/elink
 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) {
         $select_subcat_checked = "checked";
     }
     if ($up) {
         if ($created_time_from) {
             $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "created_time >= " . $created_time_from;
         }
         if ($created_time_to) {
             $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "created_time <= " . $created_time_to;
         }
         $up_checked = "checked";
     } else {
         if ($created_time_from) {
             $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "modify_time >= " . $created_time_from;
         }
         if ($created_time_to) {
             $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "modify_time <= " . $created_time_to;
         }
     }
     if ($have_img == 1) {
         //có ảnh
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "have_image=1";
     } elseif ($have_img == 2) {
         //ko có ảnh
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "have_image=0";
     }
     if ($id_search) {
         //ID sản phẩm
         $search_value .= ($search_value == "" ? " WHERE " : " AND ") . "id={$id_search}";
     }
     if (Url::get("up")) {
         $order_by = $order_by != "" ? $order_by : "ORDER BY created_time DESC";
     } else {
         $order_by = $order_by != "" ? $order_by : "ORDER BY modify_time DESC";
     }
     $sql = "SELECT * FROM item {$search_value} {$order_by}";
     $sql_count = "SELECT count(*) AS total_row FROM item {$search_value}";
     $total_item = (int) DB::fetch($sql_count, "total_row");
     if ($total_item) {
         $pagging = AZPagging::pagingSE($limit, $total_item, 50, 10, 'page_no', true, 'Sản phẩm', 'Trang');
         $sql .= $limit;
     }
     $re = DB::query($sql);
     if ($re) {
         $index_temp = 0;
         while ($item = mysql_fetch_assoc($re)) {
             //trạng thái sản phẩm:
             if ($item['status'] == -1) {
                 $item['bgcolor'] = "bgcolor=\"#FF6633\"";
             } elseif ($index_temp) {
                 $item['bgcolor'] = "bgcolor=\"#EFEFEF\"";
             } else {
                 $item['bgcolor'] = "";
             }
             $index_temp = 1 - $index_temp;
             $item['created_time'] = 'Đăng: <b>' . date("d/m/Y H:i", $item['created_time']) . '</b>';
             if ($item['del_time'] && $item['del_user'] && $item['status'] == -1) {
                 $item['del_time'] = '<br /><font color=red>Xoá: <b>' . date("d/m/Y H:i", $item['del_time']) . '</font></b> ( <a target="_blank" href="' . WEB_DIR . $item['del_user'] . '"><strong>' . $item['del_user'] . '</strong></a>)';
             } else {
                 $item['del_time'] = '';
             }
             if ($item['modify_user_name'] && $item['status'] != -1) {
                 $item['is_modify'] = '<br><font color=gray>Sửa: <b>' . date("d/m/Y H:i", $item['modify_time']) . '</font></b>';
                 $item['is_modify'] .= ' ( <a target="_blank" href="' . WEB_DIR . $item['modify_user_name'] . '"><strong>' . $item['modify_user_name'] . '</strong></a>)';
             } else {
                 $item['is_modify'] = '';
             }
             $item['name'] = AZLib::filter_title($item['name']);
             $item['description'] = AZLib::remove_4_js(AZLib::plainText($item['description']));
             $item['price'] = number_format($item['price'], 0, ',', '.');
             $item['price_out'] = number_format($item['price_out'], 0, ',', '.');
             $item['currency_option'] = AZLib::getOption(array(1 => "VNĐ", 2 => "\$"), $item['currency_id']);
             //$item['price']	=  "Giá bán: ".AZLib::priceFomart($item['price'],$item['currency_id']);
             //$item['price_out']	=  "<br /><font color='#999999'>Giá TT: ".AZLib::priceFomart($item['price_out'],$item['currency_id']).'</font>';
             if ($item['level_1_catid'] > 0) {
                 if (isset(CGlobal::$allCategories[$item['level_1_catid']])) {
                     $item['cat_name'] = '<b>' . CGlobal::$allCategories[$item['level_1_catid']]['name'] . ' (' . $item['level_1_catid'] . ')</b>';
                 } else {
                     $item['cat_name'] = '<b><font color=red>(' . $item['level_1_catid'] . ')</font></b>';
                 }
                 if ($item['category_id'] > 0 && $item['category_id'] != $item['level_1_catid'] || $item['cat_name'] == '') {
                     if (isset(CGlobal::$allCategories[$item['category_id']])) {
                         $item['cat_name'] .= ' - <i>' . CGlobal::$allCategories[$item['category_id']]['name'] . ' (' . $item['category_id'] . ')</i>';
                     } else {
                         $item['cat_name'] .= ' - <i><b><font color=red>(' . $item['category_id'] . ')</font></b></i>';
                     }
                 }
             }
             if ($item['img_url']) {
                 $item['image_src'] = 'http://' . CGlobal::$img_server[$item['img_server']] . $item['img_url'];
                 $item['image'] = AZLib::getImageThumb($item['img_url'], 110, 0, 1, $item["img_server"]);
             } else {
                 $item['image_src'] = '';
                 $item['image'] = '';
             }
             $item['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $item['id'] . '&ebname=' . AZLib::safe_title($item['name']));
             $item['edit'] = Url::build('post_item', array('cmd' => 'edit', 'id' => $item['id']));
             if ($item['status'] == -1) {
                 $item['del_link'] = Url::build_all(array('cmd', 'id'), 'cmd=del_forever&id=' . $item['id']);
                 $item['re_post'] = Url::build_all(array('cmd', 'id'), 'cmd=re_post&id=' . $item['id']);
             } elseif ($item['status'] == 2) {
                 $item['del_link'] = Url::build_all(array('cmd', 'id'), 'cmd=delete&id=' . $item['id']);
                 $item['show_link'] = Url::build_all(array('cmd', 'id'), 'cmd=show&id=' . $item['id']);
             } else {
                 $item['del_link'] = Url::build_all(array('cmd', 'id'), 'cmd=delete&id=' . $item['id']);
                 $item['hide_link'] = Url::build_all(array('cmd', 'id'), 'cmd=hide&id=' . $item['id']);
             }
             $item['del_cache'] = Url::build_all(array('cmd', 'id'), 'cmd=del_cache&id=' . $item['id']);
             $items[$item['id']] = $item;
         }
     }
     $display->add('items', $items);
     $type_arr = array(1 => "-Sản phẩm không ẩn-", 2 => "-Sản phẩm ẩn-");
     if (User::have_permit(ADMIN_DEL_ITEM)) {
         $type_arr[-1] = "-Sản phẩm đã xoá-";
         $type_arr[9] = "-Tất cả các sản phẩm (Cả sản phẩm xóa)-";
     }
     $option_censor = AZLib::getOption($type_arr, Url::get('censor', 1));
     $display->add('censor', $censor);
     $display->add('option_censor', $option_censor);
     $display->add('have_img_option', $opt_have_img);
     $display->add('lock_checked', $lock_checked);
     $display->add('user_name', $user_name);
     $display->add('created_time', $time_from);
     $display->add('created_time_to', $time_to);
     $display->add('phrase_checked', $phrase_checked);
     $display->add('free_cat_checked', $free_cat_checked);
     $display->add('up_checked', $up_checked);
     $display->add('select_subcat_checked', $select_subcat_checked);
     $display->add('id_search', $id_search);
     $item_cat_search = $this->GetCatTree();
     $display->add('list_top_cat_js', AZLib::getOption(AZLib::getTopCats(), 999999999));
     $display->add('IS_ADMIN', User::is_admin());
     $display->add('page_no', Url::get('page_no'));
     $display->add('paging', $pagging);
     $display->add('total_item', $total_item);
     $display->add('item_cat', AZLib::getOption($this->getOtionCats(), Url::get('id_cats')));
     $display->add('category_tree', json_encode($item_cat_search));
     $display->add('catSelected', Url::get('searchByCat', 0));
     $display->add('catSelectedType', Url::get('searchByCatType', 0));
     $display->add('subCatSelected', Url::get('searchBySubCat', 0));
     $display->add('subCatSelectedType', Url::get('searchBySubCatType', 0));
     $display->add('keywords', $keywords);
     $display->add('sort_type', $sort_type);
     $display->output('ManageItem');
     $this->endForm();
 }
コード例 #19
0
ファイル: PageEnd.php プロジェクト: duynhan07/elink
    echo DB::num_queries();
    ?>
	                    | <a href="<?php 
    echo Url::build('page');
    ?>
">Page list</a> 
	                    | <a href="<?php 
    echo Url::build('edit_page', array('id' => AZNet::$page['id']));
    ?>
">Bố cục trang</a> 
	                    | <a href="<?php 
    echo Url::build('page', array('id' => AZNet::$page['id'], 'cmd' => 'edit'));
    ?>
">Sửa trang</a>
	                    | <a href="<?php 
    echo Url::build('page', array('id' => AZNet::$page['id'], 'cmd' => 'refresh', 'href' => '?' . $_SERVER['QUERY_STRING']));
    ?>
">Xoá cache trang</a>
    		</center>
    </td>
    </tr>
    </table>
</div>
<?php 
}
global $start_rb;
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$end_rb = $mtime;
$page_load_time = round($end_rb - $start_rb, 5) . "s";
コード例 #20
0
ファイル: ManageBookingVip.php プロジェクト: duynhan07/elink
 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) {
             if (!$zone_id || $zone_id && isset(CGlobal::$allCategories[$topid]) && in_array($zone_id, CGlobal::$allCategories[$topid]['zones'])) {
                 if (isset(CGlobal::$allCategories[$topid])) {
                     $arr[$topid] = CGlobal::$allCategories[$topid]['name'] . " ({$topid})";
                 } else {
                     $arr[$topid] = "({$topid})";
                 }
                 foreach ($subcats as $cid => $cat) {
                     $arr[$cid] = "--------{$cat['name']} ({$cid})";
                 }
             }
         }
     }
     $display->add('cat_option', AZLib::getOption($arr, $catid));
     $display->add('item_id', $item_id);
     $display->add('status', $status);
     $display->add('user_add', $user_add);
     $display->add('num_contract', $num_contract);
     $re = DB::query("SELECT * FROM bookings_vip {$where} ORDER BY {$order}");
     $item_ids = '';
     if ($re) {
         while ($v_item = mysql_fetch_assoc($re)) {
             $zid = 0;
             $zone_name = 0;
             $topcid = 0;
             $cid = 0;
             if ($v_item['cat_id']) {
                 $cid = $v_item['cat_id'];
                 if (isset(CGlobal::$allCategories[$cid])) {
                     $topcid = CGlobal::$allCategories[$cid]['parent_id'];
                 }
             } elseif ($v_item['top_cat']) {
                 $topcid = $v_item['top_cat'];
             }
             if (!$topcid && $cid) {
                 if (isset(CGlobal::$allCategories[$cid])) {
                     $topcid = CGlobal::$allCategories[$cid]['parent_id'];
                 }
             }
             if ($topcid) {
                 if (isset(CGlobal::$allCategories[$topcid])) {
                     foreach (CGlobal::$allCategories[$topcid]['zones'] as $zoneid) {
                         if ($zoneid) {
                             $zid = $zoneid;
                             break;
                         }
                     }
                 }
             }
             $zone_name = "[{$zid}] ";
             if ($zid && isset(CGlobal::$allZones[$zid])) {
                 $zone_name .= CGlobal::$allZones[$zid]['name'];
             }
             if (!$zone_id || $zone_id && $zid == $zone_id) {
                 $v_item['zone'] = $zone_name;
                 $v_item['time'] = "<b>Tạo:</b> " . date("d/m/Y H:i", $v_item['time_add']) . " bởi <b>" . $v_item['user_add'] . "</b>";
                 if ($v_item['time_add'] != $v_item['time_edit']) {
                     $v_item['time'] .= "<br /><b>Sửa:</b> " . date("d/m/Y H:i", $v_item['time_edit']) . " bởi <b>" . $v_item['user_edit'] . "</b>";
                 }
                 if ($v_item['user_update_status'] != '' && $v_item['time_update_status'] != 0) {
                     $v_item['time'] .= "<br /><b>Update:</b> " . date("d/m/Y H:i", $v_item['time_update_status']) . " bởi <b>" . $v_item['user_update_status'] . "</b>";
                 }
                 switch ($v_item['status']) {
                     case -1:
                         $v_item['str_status'] = "<font color=red><b>Đã xóa <br/>{$v_item['user_del']}</b></font>";
                         break;
                     case 1:
                         $v_item['str_status'] = "<font color=black><b>Đã xử lý</b></font>";
                         break;
                     default:
                         $v_item['str_status'] = "<font color=green><b>Chưa xử lý</b></font>";
                         $v_item['permis'] = 0;
                         if (User::have_permit(ADMIN_VIP_ITEM)) {
                             $v_item['permis'] = 1;
                             $v_item['update_status'] = Url::build_current(array('cmd' => 'update_status', 'id' => $v_item['id']));
                             $v_item['active'] = Url::build_current(array('cmd' => 'active', 'id' => $v_item['id']));
                         }
                         $v_item['edit'] = Url::build_current(array('cmd' => 'edit', 'id' => $v_item['id']));
                         $v_item['delete'] = Url::build_current(array('cmd' => 'delete', 'id' => $v_item['id']));
                         break;
                 }
                 if ($v_item['time_start'] > TIME_NOW) {
                     $v_item['time_start'] = '<font color="#c00"><b>' . date("d/m/Y", $v_item['time_start']) . '</b></font>';
                 } else {
                     $v_item['time_start'] = date("d/m/Y", $v_item['time_start']);
                 }
                 if ($v_item['time_end']) {
                     if ($v_item['time_end'] < TIME_NOW) {
                         $v_item['time_end'] = '<font color="#f00"><b>' . date("d/m/Y", $v_item['time_end']) . '</b></font>';
                     } else {
                         $v_item['time_end'] = date("d/m/Y", $v_item['time_end']);
                     }
                 } else {
                     $v_item['time_end'] = '';
                 }
                 $item_ids .= ($item_ids != '' ? ',' : '') . $v_item['item_id'];
                 //check vi tri vip
                 $v_item['top_cat'] != 0 ? $cat_id = $v_item['top_cat'] : ($cat_id = $v_item['cat_id']);
                 $item_vip = DB::select_all('item_vip', "(catid = {$cat_id} OR level_1_catid = {$cat_id}) AND status = 1 AND time_end >" . TIME_NOW);
                 $i = 0;
                 $sa = $v_item['time_start'];
                 $ea = $v_item['time_end'];
                 foreach ($item_vip as $item) {
                     if ($sa > $item['time_start'] && $sa < $item['time_end']) {
                         $i++;
                     } elseif ($ea > $item['time_start'] && $ea < $item['time_end']) {
                         $i++;
                     } elseif ($sa < $item['time_start'] && $ea > $item['time_end']) {
                         $i++;
                     }
                 }
                 $v_item['over_slot'] = 0;
                 if ($i >= 2) {
                     $v_item['over_slot'] = 1;
                 }
                 //end check vi tri
                 //check trung ID
                 $v_item['exist_id'] = 0;
                 foreach ($item_vip as $item) {
                     if ($v_item['item_id'] == $item['item_id']) {
                         $v_item['exist_id'] = 1;
                     }
                 }
                 //end check trung ID
                 $item_bookings[$v_item['id']] = $v_item;
             }
         }
     }
     if ($item_ids != '') {
         $re = DB::query("SELECT * FROM item WHERE id IN({$item_ids})");
         if ($re) {
             while ($item = mysql_fetch_assoc($re)) {
                 $item['item_link'] = Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name'])));
                 $items[$item['id']] = $item;
             }
         }
     }
     foreach ($item_bookings as &$v_item) {
         if (isset($items[$v_item['item_id']])) {
             $v_item['item_link'] = $items[$v_item['item_id']]['item_link'];
             $v_item['item_name'] = stripslashes($items[$v_item['item_id']]['name']);
             if ($items[$v_item['item_id']]['status'] == -1) {
                 $v_item['item_name'] .= ' <font color="#c00">Tin xoá</font>';
             } elseif ($items[$v_item['item_id']]['status'] != 1) {
                 $v_item['item_name'] .= ' <font color="#c00">KD</font>';
             }
             $top_catid = $items[$v_item['item_id']]['level_1_catid'];
             $catid = $items[$v_item['item_id']]['category_id'];
             $v_item['top_cat_name'] = $v_item['top_cat'] ? CGlobal::$allCategories[$v_item['top_cat']]['name'] : '';
             $v_item['cat_name'] = $v_item['cat_id'] ? CGlobal::$allCategories[$v_item['cat_id']]['name'] : '';
             if ($v_item['cat_id'] && $v_item['cat_id'] != $catid) {
                 $v_item['wrong_cat'] = '<font color="red">(sai chủng loại)</font>';
             }
             $v_item['item_cat_name'] = "<font color=blue>" . CGlobal::$allCategories[$top_catid]['name'] . '</font> /<br /><font color=green>' . CGlobal::$allCategories[$catid]['name'] . '</font>';
             if (isset(CGlobal::$allCategories[$v_item['cat_id']])) {
                 $v_item['cat_vip'] = CGlobal::$allCategories[$v_item['cat_id']]['name'];
             } else {
                 $v_item['cat_vip'] = '';
             }
         } else {
             $v_item['item_name'] = 'Tin không tồn tại';
             $v_item['cat_name'] = '';
         }
     }
     $display->add('items', $item_bookings);
     $display->output('ManageBookingVip');
     $this->endForm();
 }
コード例 #21
0
ファイル: response.php プロジェクト: liuzhaowei55/think
 /**
  * URL重定向
  * @access protected
  * @param string $url 跳转的URL表达式
  * @param array $params 其它URL参数
  * @return void
  */
 public static function redirect($url, $params = [])
 {
     $url = Url::build($url, $params);
     header('Location: ' . $url);
 }
コード例 #22
0
ファイル: register.php プロジェクト: duynhan07/elink
 function on_submit()
 {
     if (User::checkLock4Ever(1)) {
         Url::redirect_current();
     }
     //check bảo mật
     $just_registed_s = 0;
     $just_registed_c = 0;
     if (isset($_SESSION['just_registed'])) {
         $just_registed_s = $_SESSION['just_registed'];
     }
     if (isset($_COOKIE['just_registed'])) {
         $just_registed_c = $_COOKIE['just_registed'];
     }
     if ($just_registed_s > TIME_NOW - 120 || $just_registed_c > TIME_NOW - 120 || !REG_ON) {
         Url::redirect_current();
     }
     //END check bảo mật
     // check de ban IP
     $ip = AZLib::ip();
     $arr_badwords = AZLib::checkBadWord($ip, true);
     if ($arr_badwords["bad"] != "" && $arr_badwords["bad_key"] != "") {
         $this->setFormError('ban_ip', "Có lỗi xẩy ra");
     }
     // end check de ban IP
     $full_name = Url::get('full_name');
     $email = Url::get('email');
     $user_name = Url::get('register_user_name');
     $mobile_phone = AZLib::trimSpace(Url::get('mobile_phone'));
     $password = AZLib::trimSpace(Url::get('register_password'));
     $confirm_password = AZLib::trimSpace(Url::get('confirm_password'));
     $this->checkFormInput('Tên đầy đủ', 'full_name', $full_name, 'str', false, '', 0, 50);
     $this->checkFormInput('Email', 'email', $email, 'email', true, '', 6, 50);
     $this->checkFormInput('Tên truy cập', 'user_name', $user_name, 'uname', true, '', 4, 50);
     $this->checkFormInput('Điện thoại di động', 'mobile_phone', $mobile_phone, 'str', false, '', 0, 50);
     $this->checkFormInput('Mật khẩu truy cập', 'register_password', $password, 'str', true, '', 6, 50);
     $this->checkFormInput('Nhập lại mật khẩu', 'confirm_password', $confirm_password, 'str', true, '', 6, 50);
     if (!$this->errNum) {
         if ($password != $confirm_password) {
             $this->setFormError('captcha_register', "Nhập lại Mật khẩu truy cập không khớp!");
             return;
         }
     }
     $captcha_register = Url::get('captcha_register');
     if ($mobile_phone && !AZLib::is_mobile($mobile_phone)) {
         $mobile_phone = "";
     }
     if ($captcha_register == '') {
         $this->setFormError('captcha_register', "Bạn chưa nhập <b>Mã bảo mật</b>!");
     } else {
         if (!isset($_SESSION["enbac_validate"]) || $captcha_register != $_SESSION["enbac_validate"]) {
             $this->setFormError('captcha_register', "<b>Mã bảo mật</b> không chính xác!");
         }
     }
     if ((int) Url::get('confirm_register') != 1) {
         $this->setFormError('confirm_register', "Bạn phải đọc và đồng ý với những <a target=\"_blank\" href=\"http://help.enbac.com/content/4/5/en/Quy-che-thanh-vien.html\" >điều khoản của Enbac.com</a>!");
     }
     if (!$this->errNum) {
         if (DB::exists('SELECT id FROM `user` WHERE `email`="' . $email . '"')) {
             $this->setFormError('email', "<b>Email</b> bạn chọn đã tồn tại, hãy chọn lại một <b>Email</b> khác!");
         } elseif (DB::exists('SELECT id FROM `user` WHERE `user_name`="' . $user_name . '"')) {
             $this->setFormError('email', "<b>Tên truy cập</b> bạn chọn đã tồn tại, hãy chọn lại một <b>Tên truy cập</b> khác!");
         } else {
             $user_info = array('user_name' => $user_name, 'email' => $email, 'password' => User::encode_password($password), 'full_name' => $full_name, 'mobile_phone' => $mobile_phone, 'create_time' => TIME_NOW, 'is_active' => (int) (bool) USER_ACTIVE_ON, 'reg_ip' => AZLib::ip());
             $id = DB::insert('user', $user_info);
             if ($id) {
                 $_SESSION['just_registed'] = TIME_NOW;
                 AZLib::my_setcookie('just_registed', TIME_NOW);
                 if (USER_ACTIVE_ON && $user_info['is_active'] == 1) {
                     global $display;
                     $active = DB::select('user_active', 'user_id=' . $id);
                     $active_code = md5(TIME_NOW . $user_info['password']);
                     if ($active) {
                         $active = array('id' => $active['id'], 'user_id' => $id, 'active_code' => $active_code, 'time' => TIME_NOW);
                     } else {
                         $active = array('user_id' => $id, 'active_code' => $active_code, 'time' => TIME_NOW);
                     }
                     DB::insert('user_active', $active, true);
                     $display->add('eb_url', WEB_ROOT);
                     $display->add('user_id', $id);
                     $display->add('user_name', $user_info['user_name']);
                     $display->add('active_code', $active_code);
                     $display->add('WEB_NAME', WEB_NAME);
                     $display->add('MAIL_FOOTER', MAIL_FOOTER);
                     $content_email = $display->output('send_active_mail', 1, 'RegisterSuccess');
                     //Send email here;
                     if (System::sendEBEmail($user_info['email'], 'Kích hoạt tài khoản!', $content_email)) {
                         //$this->setFormSucces('','<b>Chúc mừng bạn đã đăng ký tài khoản thành công!</b><br /><br />Mã kích hoạt đã được gửi đi tới E-mail: "'.$user_info['email'].'"<br />Bạn hãy check lại Email để kích hoạt tài khoản của mình!');
                         Url::redirect('reg_success', array('cmd' => 'notify'));
                     } else {
                         $this->setFormError('', '<b>Chúc mừng bạn đã đăng ký tài khoản thành công!</b><br /><br />Tuy nhiên hệ thống chưa gửi được Mã kích hoạt tới E-mail: "' . $user_info['email'] . '"!<br />Bạn có thể <a href="' . Url::build('reg_success', array('cmd' => 'active')) . '">click vào đây</a> để hệ thống gửi lại mã kích hoạt vào Email của mình!');
                     }
                     $this->show_form = false;
                 } else {
                     User::Login($id);
                     Url::redirect('reg_success');
                 }
             } else {
                 $this->setFormError('', "Chưa đăng ký được, mời bạn thử lại!");
             }
         }
     }
 }
コード例 #23
0
ファイル: ajax_build_url.ajax.php プロジェクト: hqd276/bigs
 /**
  * Make link fix news
  * 
  * @author MinhNV
  * Date 2010/07/07
  */
 private function makeLinkNews()
 {
     $news_id = Url::get('news_id');
     $news_title = Url::get('news_title');
     $page = 'news_detail';
     $aryParams = array('news_id' => $news_id, 'title' => EClassApi::safe_title($news_title));
     $url_serialize = '';
     $arySerialize = array('page' => $page, 'params' => $aryParams);
     if (is_array($arySerialize) && count($arySerialize) > 0) {
         $url_serialize = serialize($arySerialize);
     }
     $link_url = Url::build($page, $aryParams);
     $aryData = array();
     $aryData['link_news_fix'] = $link_url;
     $aryData['url_serialize'] = $url_serialize;
     $aryData['intIsOK'] = 1;
     echo json_encode($aryData);
     exit;
 }
コード例 #24
0
 function show_log_up_item()
 {
     $item_id = (int) Url::get('item_id', 0);
     if ($item_id > 0 && User::is_login() && !User::is_block()) {
         $log_ups = array();
         $item = Item::get_item($item_id);
         if ($item) {
             if (User::id() == $item['user_id']) {
                 global $display;
                 $re = DB::query("SELECT * FROM up_item_log WHERE item_id={$item_id} ORDER BY id DESC LIMIT 200");
                 if ($re) {
                     $stt = 1;
                     while ($log_up = mysql_fetch_assoc($re)) {
                         $log_up['stt'] = $stt++;
                         $log_up['up_time'] = date('d.m.Y H\\hi:s', $log_up['up_time']);
                         if ($log_up['up_id']) {
                             $log_up['type'] = '<font color=green><b>Up tự động</b></font>';
                         } else {
                             $log_up['type'] = 'Thành viên up';
                         }
                         $arr = explode(' ', $log_up['run_order']);
                         $log_up['run_order'] = $arr[0];
                         if ($log_up['status'] == 0) {
                             $log_up['status'] = '<font color="orange">Chưa kích hoạt</font>';
                         } elseif ($log_up['status'] == 1) {
                             $log_up['status'] = '<font color="green">Hoạt động</font>';
                         } elseif ($log_up['status'] == 2) {
                             $log_up['status'] = '<font color="brown">Hết lượt up</font>';
                         } elseif ($log_up['status'] == 3) {
                             $log_up['status'] = '<span title="Tạm ngừng do tin bị xoá hoặc kiểm duyệt"><font color="red">Tạm ngừng</font></span>';
                         }
                         $log_up['del_link'] = Url::build_current(array('cmd' => 'del_log', 'log_id' => $log_up['id']));
                         $log_up['href'] = '?page=item_detail&id=' . $log_up['item_id'];
                         $log_up['item_c_time'] = '';
                         $log_up['item_up_time'] = '';
                         $log_ups[] = $log_up;
                     }
                 }
                 if ($log_ups) {
                     $display->add('item_id', $item['id']);
                     $display->add('item_name', $item['name']);
                     $display->add('post_time', date('H\\hi d.m.Y', $item['created_time']));
                     $display->add('up_time', date('H\\hi d.m.Y', $item['up_time']));
                     $display->add('item_url', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
                     $display->add('log_ups', $log_ups);
                     $display->output('UpTinLog', false, 'Personal');
                     System::halt();
                 }
             }
         }
     }
     echo 'no_log';
     exit;
 }
コード例 #25
0
ファイル: DocumentList.php プロジェクト: duynhan07/elink
 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();
 }
コード例 #26
0
ファイル: Response.php プロジェクト: ssdphp/ssdphp
 /**
  * URL重定向
  * @access protected
  * @param string $url 跳转的URL表达式
  * @param array|int $params 其它URL参数或http code
  * @return void
  */
 public static function redirect($url, $params = [])
 {
     $http_response_code = 301;
     if (in_array($params, [301, 302])) {
         $http_response_code = $params;
         $params = [];
     }
     $url = preg_match('/^(https?:|\\/)/', $url) ? $url : Url::build($url, $params);
     header('Location: ' . $url, true, $http_response_code);
 }
コード例 #27
0
ファイル: class.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $config = @CGlobal::$configs['AdvCover']['conf_val'];
     $status = 0;
     $url_detail = '';
     $type_ = 0;
     if ($config != '') {
         $config = unserialize(stripslashes($config));
         $status = (int) $config['status'];
         $type_ = (int) $config['type'];
         $url_detail = $config['url_detail'];
     }
     if ($type_ == 0) {
         $type_ = 'promotion';
     } else {
         $type_ = 'f_promotion';
     }
     $display->add('type_promotion', $type_);
     if (!isset($_SESSION['adv_cover_top']) || isset($_SESSION['adv_cover_top']) && (int) $_SESSION['adv_cover_top'] < 1) {
         if ($status) {
             if ($url_detail != '') {
                 $display->add('url_detail', $url_detail);
             }
             $_SESSION['adv_cover_top'] = 1;
         }
         $display->add('adv_on', $status);
     } else {
         $display->add('adv_on', 0);
     }
     if (User::have_permit(ADMIN_ADV)) {
         $display->add('beginform', $this->beginForm(true, 'POST', false, false, true));
         $display->add('endform', $this->endForm(true));
         $display->add('url', $url_detail);
         $display->add('msg', $this->showFormErrorMessages(1));
         $type_arr = array(0 => 'Ảnh', 1 => 'Flash');
         $type = (int) Url::get('type', 0);
         $display->add('type_option', AZLib::getOption($type_arr, $type));
         $status_arr = array(0 => 'Tắt', 1 => 'Bật');
         $display->add('status_option', AZLib::getOption($status_arr, $status));
         $display->add('admin_url', Url::build('admin_promotion'));
     }
     $display->output("AdvCover");
 }
コード例 #28
0
ファイル: class.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $survey_config = @CGlobal::$configs['survey_config']['conf_val'];
     if ($survey_config != '') {
         $survey_config = unserialize(stripslashes($survey_config));
     } else {
         $survey_config = array();
     }
     $id_survey = @(int) $survey_config[Module::$block_id];
     $admin = '';
     if (User::is_admin()) {
         $admin = '<a href="' . Url::build('admin_survey', array('href' => urlencode(Url::build_all()), 'block_id' => Module::$block_id)) . '"><img src="style/images/nav_right_arrow.gif"  border="0" title="Chọn thăm dò ý kiến" /></a>';
         $display->add('is_admin', 1);
     }
     $public_survey = DB::select("public_survey", "id={$id_survey}");
     if ($public_survey) {
         if ($public_survey['view'] == 1) {
             $display->add('show_survey', 1);
             $display->add('title', stripslashes($public_survey['title']));
             $display->add('question', stripslashes($public_survey['question']));
             $display->add('id', $public_survey['id']);
             $opts = array();
             $re = DB::query('SELECT * FROM public_survey_opinion WHERE `id_survey`=' . $public_survey['id']);
             $i = 0;
             if ($re) {
                 while ($opt = mysql_fetch_assoc($re)) {
                     $i++;
                     if ($public_survey['type'] == 1) {
                         $opt['control'] = '<input name="survey_id[]" type="radio" value="' . $opt['id'] . '" id="survey_id_' . $opt['id'] . '">';
                     } else {
                         $opt['control'] = '<input name="survey_id[]" type="checkbox" value="' . $opt['id'] . '" id="survey_id_' . $opt['id'] . '">';
                     }
                     $opts[$opt['id']] = $opt;
                 }
             }
             $display->add('opts', $opts);
             $url_detail = Url::build('view_survey', array('id' => $public_survey['id']));
             $display->add('onclick_rate', Url::open_popup($url_detail . "&ids='+survey_list('survey_id[]')+'", 600, 100 + 50 * $i, false, false, false, false, false, 1, false, false, false));
             $display->add('onclick_view', Url::open_popup($url_detail, 600, 100 + 50 * $i, false, false, false, false, false, 1, false, false, false));
         }
         $display->add('edit', AZLib::button(Url::build('admin_survey', array('cmd' => 'edit', 'id_survey' => $public_survey['id'])), 'style/images/edit.gif', "Sửa Thăm dò ý kiến"));
         $display->add('delete', AZLib::buttonDel(Url::build_current(array('cmd' => 'remove_survey', 'id_survey' => $public_survey['id'], 'block_id' => Module::$block_id)), 'style/images/delete.gif', "Bỏ chọn dò ý kiến"));
     }
     $display->add('admin', $admin);
     $display->output('PublicSurvey');
 }
コード例 #29
0
ファイル: list.php プロジェクト: hqd276/bigs
 function draw()
 {
     global $display;
     //$this->beginForm(false,'post',false,Url::build_current());
     $this->beginForm();
     $name = trim(Url::get('name'));
     $order_by = Url::get('order_by', 'id');
     $order_dir = Url::get('order_dir', 'DESC');
     $cond = ' 1 ';
     if ($name != '') {
         $cond .= ' AND name LIKE "%' . $name . '%"';
     }
     $item_per_page = 50;
     $total_row = DB::fetch('SELECT count(*) AS total_row FROM `module` WHERE ' . $cond . ' LIMIT 0,1', 'total_row', 0);
     $items = array();
     $paging = '';
     if ($total_row) {
         $limit = '';
         require_once ROOT_PATH . 'core/ECPagging.php';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $sql = 'SELECT  id ,name FROM  `module` WHERE ' . $cond . ' ORDER BY ' . $order_by . ' ' . $order_dir . ' ' . $limit;
         $re = DB::query($sql);
         if ($re) {
             while ($row = mysql_fetch_assoc($re)) {
                 if (Url::check('page_id')) {
                     $row['onclick'] = ' onclick="location=\'' . Url::build('edit_page', array('module_id' => $row['id'], 'id' => (int) Url::get('page_id', 0), 'region', 'after', 'replace', 'href')) . '\';"  style="cursor:pointer;" title="Click vào đây để cắm Module vào Page"';
                 } else {
                     $row['onclick'] = '';
                 }
                 $re2 = DB::query('SELECT page.id,page.name FROM block INNER JOIN page ON page.id=block.page_id WHERE module_id="' . $row['id'] . '"');
                 if ($re2) {
                     while ($page = mysql_fetch_assoc($re2)) {
                         $row['pages'][$page['id']] = $page;
                     }
                 } else {
                     $row['pages'] = array();
                 }
                 $items[$row['id']] = $row;
             }
         }
     }
     if ($order_dir == 'ASC') {
         $order_dir = 'DESC';
     } else {
         $order_dir = 'ASC';
     }
     $href_id = Url::build_current(array('order_by' => 'id', 'order_dir' => $order_dir));
     $href_name = Url::build_current(array('order_by' => 'name', 'order_dir' => $order_dir));
     $img_id = '';
     $img_name = '';
     if ($order_by == 'id') {
         $img_id = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     if ($order_by == 'name') {
         $img_name = '<img src="style/images/admin/' . ($order_dir != 'DESC' ? 'down' : 'up') . 'arrow.png" alt="">';
     }
     $display->add('img_id', $img_id);
     $display->add('img_name', $img_name);
     $display->add('href_id', $href_id);
     $display->add('href_name', $href_name);
     $display->add('name', $name);
     $display->add('paging', $paging);
     $display->add('items', $items);
     $display->add('hover', EClassApi::mouse_hover('#E2F1DF', true));
     $display->output('list');
     $this->endForm();
 }
コード例 #30
0
ファイル: class.php プロジェクト: duynhan07/elink
 function draw()
 {
     global $display;
     $this->beginForm();
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('txt_title', stripslashes(Url::get('txt_title', $this->public_survey['title'])));
     $display->add('type_option', AZLib::getOption(array(0 => "Nhiều lựa chọn", 1 => "Một lựa chọn"), Url::get('type', $this->public_survey['type'])));
     $display->add('txt_question', stripslashes(Url::get('txt_question', $this->public_survey['question'])));
     $display->add('url_admin', Url::build('admin_survey'));
     $display->output('EditSurvey');
     $this->endForm();
 }