function draw() { $this->beginForm(); global $display; $item_per_page = 20; $sql_count = 'SELECT COUNT(*) AS total_item FROM support'; $total = DB::fetch($sql_count, 'total_item', 0); $items = array(); if ($total) { $limit = ''; require_once ROOT_PATH . 'core/ECPagging.php'; $paging = ECPagging::pagingSE($limit, $total, $item_per_page, 10, 'page_no', true, 'Tin', 'Trang'); $sql = 'SELECT * FROM support ORDER BY id DESC ' . $limit; $result = DB::query($sql); if ($result) { while ($row = mysql_fetch_assoc($result)) { $row['del_link'] = Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'contents'), 'cmd=delete&id=' . $row['id']); if ($row['created']) { $row['created'] = date("d/m/Y", $row['created']); } $items[$row['id']] = $row; } } } else { $paging = ''; } $display->add('items', $items); $display->add('contents', Url::get('contents')); $display->add('paging', $paging); $display->output('list'); $this->endForm(); }
function on_submit() { $email_list = Url::get('email_list'); $count = 0; if ($email_list) { $arr = explode("\n", $email_list); $arr_tmp = array(); $email_list = ''; if ($arr) { foreach ($arr as $email) { $email = str_replace(array(chr(13), chr(10)), '', stripslashes($email)); if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\\.[A-Z]{2,6}\$", $email) && !isset($arr_tmp[$email])) { $email_list .= ($email_list ? "\n" : '') . $email; $arr_tmp[$email] = 1; $count++; } } } } $this->email_list = array('email_list' => addslashes($email_list), 'time' => TIME_NOW, 'time_modify' => TIME_NOW); $this->checkFormInput('Danh sách email', 'email_list', $email_list, 'str', true, '', 1); if ($count > 50) { $this->setFormError('', "Bạn đã nhập vào {$count} email, số mail nhập vào phải <=50!"); } if (!$this->errNum) { $id = DB::insert('spam_mail', $this->email_list); if ($id) { Url::redirect_current(array('cmd' => 'email_list')); } else { $this->setFormError('', 'Không cập nhật được CSDL!'); } } }
function draw() { $this->beginForm(); global $display; $id = (int) Url::get("id", 0); $cmd = Url::get("cmd"); if ($id && $cmd == "edit") { $item = DB::fetch("SELECT * FROM admin_notice_user WHERE id={$id}"); $display->add('user_name', $item['user_name']); $display->add('content', $item['content']); $expire = (int) round(($item['expire_date'] - TIME_NOW) / 86400); $display->add('expire', $expire); if ($item["expire_date"] > TIME_NOW && $item["active"]) { $item["active"] = 1; } else { $item["active"] = 0; } $display->add('active', $item['active']); } elseif ($cmd == "add") { $display->add('user_name', Url::get('user_name')); $display->add('content', Url::get('content')); $display->add('active', (int) Url::get('active', 1)); $display->add('expire', Url::get('expire', 7)); } $display->add('cmd', $cmd); $display->add('msg', $this->showFormErrorMessages(1)); $display->output('EditAdminNoticeUser'); $this->endForm(); }
function AdminBanner($row) { Module::Module($row); if (User::is_admin()) { switch (Url::get('cmd')) { case 'remove_banner': $id = Url::get('id', 0); if (empty($id)) { Url::redirect_url('admin_banner.html'); exit; } Banner::delete_banner($id); Url::redirect_url('admin_banner.html'); break; case 'edit_banner': require_once 'forms/EditBanner.php'; $this->add_form(new EditBannerForm()); break; case 'list_banner': require_once 'forms/ListBanner.php'; $this->add_form(new ListBannerForm()); break; default: require_once 'forms/ListBanner.php'; $this->add_form(new ListBannerForm()); break; } } else { Url::access_denied(); } }
function draw() { $p_item_same = (int) Url::get('p_item_same', 1); echo '<div id="item_same_cat"><center><img id="loading_item_same_cat" style="display:none;margin:10px 0" src="style/images/loading.gif" /></center></div> <script> jQuery(document).ready(function(){ document.getElementById("loading_item_same_cat").style.display = ""; jQuery.ajax({ type: "GET", url: "' . WEB_DIR . 'ajax.php?act=item&code=item_same_category&category_id=' . CGlobal::$curCategory . '", data: "p_item_same=' . $p_item_same . '&item_id=' . Item::$item['id'] . '", success: function(data) { if(data != "") { document.getElementById("loading_item_same_cat").style.display = "none"; document.getElementById("item_same_cat").innerHTML = data; } else { jQuery("#item_same_cat").hide(); } } }); }); </script>'; }
function ForgotPassword($row) { Module::Module($row); $user_id = (int) Url::get('id'); if ($user_id) { $user = DB::fetch("SELECT user_name,email FROM user WHERE id={$user_id}"); if ($user && md5($user['user_name'] . $user['email']) == Url::get('u')) { $new_password = $this->random_string(); $user_name = $user['user_name']; $subject = 'Khôi phục mật khẩu thành công!'; $messenger = file_get_contents('templates/ForgotPassword/reset_password.html'); $message = str_replace('[[|user_name|]]', $user_name, $messenger); $message = str_replace('[[|password|]]', $new_password, $message); if (System::sendEBEmail($user['email'], $subject, $message)) { DB::update('user', array('password' => User::encode_password($new_password)), "id={$user_id}"); Url::redirect_current(array('action' => 'reset_success')); } else { Url::redirect_current(array('action' => 'reset_error')); } } else { Url::redirect('home'); } } require_once 'forms/forgot_password.php'; $this->add_form(new ForgotPasswordForm()); }
function draw() { $this->beginForm(); if (Url::get('cmd') == 'edit' && ($row = DB::select('bad_words', 'id=' . intval(AZLib::getParam('id'))))) { $contents = $row['contents']; $reason = $row['reason']; $exact = $row['exact']; if ($row['is_phone'] == 1) { $contents = BadWord::filter_badword_show($contents); } $is_phone = $row['is_phone']; } else { $contents = ''; $exact = ''; $is_phone = ''; $reason = ''; } global $display; $display->add('msg', $this->showFormErrorMessages()); $display->add('contents', $contents); $display->add('reason', $reason); $display->add('exact', $exact); $display->add('is_phone', $is_phone); $display->add('cmd', Url::get('cmd')); $display->output('edit'); $this->endForm(); }
function draw() { //xoa 1 id if (Url::get("act") == "del" && Url::get('id')) { DB::query('DELETE FROM ban_ip WHERE id=' . Url::get('id')); Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'act', 'id'))); } global $display; //list $this->beginForm(); $items = array(); $sql = "SELECT * FROM ban_ip Order by id desc"; $result = DB::query($sql); while ($row = mysql_fetch_assoc($result)) { $row['create_time'] = date('d/m - h:i', $row['create_time']); $items[$row['id']] = $row; $arr_mem_cache[$row['ip']] = $row; } // cho mang vao memcache AZMemcache::do_put('list_ban_ip', $arr_mem_cache); $display->add('items', $items); $display->add('items_json', json_encode($items)); $display->output('ManageBanIp'); $this->endForm(); }
function PostItem($row) { Module::Module($row); if (User::is_login()) { if (!User::have_permit(ADMIN_ITEM) || User::is_block()) { Url::access_denied(); } else { if (Url::get('cmd') == 'edit') { if (Url::get('id')) { require_once 'forms/EditItemForm.php'; $this->add_form(new EditItemForm()); return; } } if (Url::get('cmd') != '') { Url::redirect_current(); } require_once 'forms/PostItemForm.php'; $this->add_form(new PostItemForm()); } } else { AZLib::check_uri(); Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string)); } }
function AdminNews($row) { Module::Module($row); if (User::is_admin()) { $cmd = Url::get('cmd'); switch ($cmd) { case "edit": case "add_item": require_once 'forms/detail.php'; $this->add_form(new AdminNewsDetail()); break; case "delete": $url = urldecode(Url::get('url')); $id = Url::get('id'); if (!is_numeric($id)) { Url::redirect('admin_news_item'); return; } DB::delete_id('news_item', $id); eb_memcache::do_remove('news_item:' . $id); Url::redirect_url($url); break; default: require_once 'forms/list.php'; $this->add_form(new AdminNewsForm()); break; } } else { Url::access_denied(); } }
function draw() { if (!User::is_admin()) { return; } $this->beginForm(false, 'get', false, Url::build_current()); global $display; $name = trim(Url::get('user_name')); $request_gid = trim(Url::get('gids')); $cond = ''; if ($name != '') { $cond .= ' AND user_name LIKE "%' . $name . '%"'; } if ($request_gid != '') { $cond .= " AND ((gids LIKE '%|" . $request_gid . "|%') OR (gids LIKE '" . $request_gid . "|%') OR (gids LIKE '%|" . $request_gid . "') OR (gids = '" . $request_gid . "')) "; } $acc_groups = CGlobal::$group; //$user_permits=array(); $all_users = array(); //$allist_users=array(); self::getContent($acc_groups, $all_users, $cond); $display->add('all_groups', json_encode($acc_groups)); $display->add('acc_groups', $acc_groups); $display->add('all_users', $all_users); $display->add('all_users_json', json_encode($all_users)); $display->add('name', $name); $display->add('request_gid', $request_gid); $display->output('AdminUser'); $this->endForm(); }
function ManageUserLock($row) { CGlobal::$website_title = 'Quản lý thành viên bị khóa'; Module::Module($row); if (User::have_permit(ADMIN_USER)) { switch (Url::get('cmd')) { case 'unban_nick': $id = (int) Url::get('id', 0); $user_id = (int) Url::get('user_id', 0); if ($id) { DB::update('user', array('block_time' => 0), 'id="' . $user_id . '"'); DB::update('user_lock', array('unlock_time' => TIME_NOW, 'unlock_user' => User::user_name()), 'id = ' . $id); User::getUser($id, 0, 1); } Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac'))); break; default: require_once 'forms/ManageUserLock.php'; $this->add_form(new ListUserLockForm()); break; } } else { Url::access_denied(); } }
function CartAdmin($row) { Module::Module($row); if (User::have_permit(ADMIN_ITEM)) { $cmd = Url::get('cmd'); switch ($cmd) { case 'delete': if (User::is_admin()) { $id = Url::get('id', 0); if ($id) { DB::delete("cart", "id={$id}"); } } Url::redirect_current(); break; case 'edit': require_once 'forms/CartEdit.php'; $this->add_form(new CartEditForm()); break; case '': default: require_once 'forms/CartAdmin.php'; $this->add_form(new CartAdminForm()); break; } } else { Url::access_denied(); } }
static function Run() { EClassApi::CheckDir(PAGE_CACHE_DIR); if (isset($_REQUEST['page']) && $_REQUEST['page'] != '') { if ($_REQUEST['page'] == "home") { Url::redirect_url(WEB_DIR, 301); } $page_name = strtolower($_REQUEST['page']); } else { //echo $_COOKIE['lang'];die(); $page_name = 'home'; } EClass::$page_cache_file = PAGE_CACHE_DIR . $page_name . '.php'; if (Url::get('refresh_page') == 1) { self::del_page_cache($page_name); } if (Url::get('refresh_page') != 1 && PAGE_CACHE_ON && file_exists(EClass::$page_cache_file)) { require_once EClass::$page_cache_file; } else { $re = DB::query('SELECT id, name, title, layout FROM page WHERE name="' . addslashes($page_name) . '"', __LINE__ . __FILE__); if ($re) { EClass::$page = mysql_fetch_assoc($re); } if (!EClass::$page) { Url::redirect_url(WEB_DIR, 301); } require_once ROOT_PATH . 'core/EClassGen.php'; EClassGen::PageGenerate(); } }
function on_submit() { $og_name = Url::get('og_name'); $u_name = Url::get('u_name'); $u_yahoo = Url::get('u_yahoo'); $u_skype = Url::get('u_skype'); $OnlineSupport = array(); if ($og_name) { foreach ($og_name as $gid => $g_name) { if ($g_name != '' && isset($u_name[$gid], $u_yahoo[$gid], $u_skype[$gid])) { $garray = array('name' => $g_name, 'users' => array()); foreach ($u_name[$gid] as $uid => $name) { if ($name != '' && isset($u_yahoo[$gid][$uid], $u_skype[$gid][$uid]) && ($u_yahoo[$gid][$uid] != '' || $u_skype[$gid][$uid] != '')) { $garray['users'][$uid] = array('name' => $name, 'yahoo' => $u_yahoo[$gid][$uid], 'skype' => $u_skype[$gid][$uid]); } } if ($garray['users']) { $OnlineSupport[$gid] = $garray; } } } } if (isset(CGlobal::$configs['OnlineSupport'])) { DB::update('configs', array("conf_val" => addslashes(serialize($OnlineSupport))), "conf_key='OnlineSupport'", __FILE__ . " Dòng:" . __LINE__); } else { DB::insert('configs', array("conf_key" => 'OnlineSupport', "conf_val" => addslashes(serialize($OnlineSupport))), __FILE__ . " Dòng:" . __LINE__); } AZLib::get_config(0, 1); AZLib::refreshParent(); }
function draw() { if (CGlobal::$curCategory) { global $display; $parentNameCat = ''; $curNameCat = ''; if (CGlobal::$allCategories[CGlobal::$curCategory]['parent_id'] && isset(CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']])) { $linkparentNameCat = WEB_ROOT . "c" . CGlobal::$allCategories[CGlobal::$curCategory]['parent_id'] . "/" . CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']]['ebname']; $parentNameCat = "<a href='" . $linkparentNameCat . "'>" . CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']]['name'] . "</a> <div class=\"node\"></div> "; $ebname = CGlobal::$allCategories[CGlobal::$allCategories[CGlobal::$curCategory]['parent_id']]['ebname'] . '-' . CGlobal::$allCategories[CGlobal::$curCategory]['ebname']; } else { $ebname = CGlobal::$allCategories[CGlobal::$curCategory]['ebname']; } if (isset(CGlobal::$allCategories[CGlobal::$curCategory]['name'])) { $linkCurNameCat = WEB_ROOT . "c" . CGlobal::$curCategory . "/" . $ebname; $curNameCat = "<a href='" . $linkCurNameCat . "' class='selected'>" . CGlobal::$allCategories[CGlobal::$curCategory]['name'] . "</a>"; } $page_no = (int) Url::get('page_no', 1); if ($page_no <= 0) { $page_no = 1; } $navigation = $parentNameCat . $curNameCat; if (AZNet::$page['name'] == 'list_detail') { $navigation .= ' <span style="color:#ccc;float:right;margin-top:3px">[ Trang ' . $page_no . ' ]</span>'; } elseif (AZNet::$page['name'] == 'item_detail' && Item::$item && User::have_permit(ADMIN_ITEM)) { $navigation .= '<span style="color:#c00;float:right;margin-top:3px">» ID SP [' . Item::$id . ']</span>'; } $display->add('url_home', WEB_DIR); $display->add('navigation', $navigation); $display->output('HeaderNavigation'); } }
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(); }
function change_status() { $id = intval(Url::get('id'), 0); $amount = intval(Url::get('amount'), 0); if ($amount == '' || $amount <= 0) { echo 'amount_null'; } else { $log = Logs::get_log($id); $str_change = array(); if (!empty($log)) { $str_change = unserialize($log['data']); } $value = array('status' => '00', 'amount' => $amount, 'description' => 'Giao dịch thành công.', 'pin' => $str_change['pin'], 'serial' => $str_change['serial'], 'type' => $str_change['type']); $value = serialize($value); $id = Logs::update_log($id, array('data' => $value)); if ($id) { $str_topup = array('uid' => $log['uid'], 'serial' => $str_change['serial'], 'pin' => $str_change['pin'], 'type' => $str_change['type'], 'created' => $log['origin_time'], 'price' => $amount); DB::insert('topup', $str_topup); $user = PersonalDB::get_account_byId($log['uid']); $new_coin = $user['coin'] + $amount; DB::update_id('account', array('coin' => $new_coin), $user['id']); } } exit; }
function RegisterSuccess($row) { Module::Module($row); switch (Url::get('cmd')) { case 'notify': //Thông báo kích hoạt tài khoản (nếu bật chế độ cần kích hoạt - USER_ACTIVE_ON = true ) if (!User::is_login() && USER_ACTIVE_ON) { require_once 'forms/notify.php'; $this->add_form(new NotifyForm()); } else { Url::redirect_current(); } break; case 'active': //Kích hoạt tài khoản if (!User::is_login() && USER_ACTIVE_ON) { require_once 'forms/active.php'; $this->add_form(new ActiveForm()); } else { Url::redirect('profile', array('user_id' => User::id(), 'user_name' => User::user_name())); } break; case 'activated': default: require_once 'forms/register_success.php'; $this->add_form(new RegisterSuccessForm()); break; } }
function ImportExcel($row) { if (User::have_permit(array(ADMIN_ITEM))) { Module::Module($row); $cmd = Url::get('cmd'); switch ($cmd) { case 'download': $file_src = DATA_PATH . "AzNet.xls"; if (file_exists(ROOT_PATH . $file_src)) { $ext = AZLib::getExtension($file_src); if ($ext && strlen($ext) <= 5) { $ext_app = substr($ext, 1); header("Content-type: application/{$ext_app}"); header("Content-Disposition: attachment; filename=" . date("Y.m.d-H\\hi", TIME_NOW) . "_ANS_Products{$ext}"); readfile(ROOT_PATH . $file_src); exit; } } header("HTTP/1.0 404 Not Found"); echo "<h1>404 - Not Found!<br />Return to <a href='" . WEB_ROOT . "'>" . WEB_NAME . "</a></h1>"; exit; break; default: require_once 'forms/ImportExcel.php'; $this->add_form(new ImportExcelForm()); break; } } else { Url::access_denied(); } }
function login() { $accessToken = Url::get('accessToken', ''); $login_info = json_decode(file_get_contents('http://ids.cpvm.vn/services/api/users/check_open_user.php?o=' . $accessToken . '&t=2')); if ($login_info->s) { $token = $login_info->v->t; //Lay thong tin user theo token $info = json_decode(file_get_contents('http://ids.cpvm.vn/services/api/users/userinfo.php?t=' . $token)); if ($info->s) { $u = $info->v->u; $user = User::getUserById($u->id); if (!$user) { // user chua co trong db => clone $data = array('id' => $u->id, 'user_name' => $u->un, 'full_name' => $u->fn, 'avatar_url' => $u->av); $id = DB::insert('account', $data); } else { DB::update('account', array('full_name' => $u->fn), 'id=' . $u->id); } $u->t = $token; //dang nhap User::LogIn2((array) $u); $_SESSION['token'] = $token; echo 1; } else { echo 0; } } else { echo 0; } exit; }
function AdminLogs($row) { Module::Module($row); if (User::is_mod() || User::have_permit('logs_all_perm')) { switch (Url::get('cmd')) { case 'list_log': $id = Url::get('id', 0); if (empty($id)) { Url::redirect_url('admin_log.html'); exit; } require_once 'forms/ListLog.php'; $this->add_form(new ListLogForm()); break; case 'list_coin': require_once 'forms/ListCoin.php'; $this->add_form(new ListCoinForm()); break; case 'extend': require_once 'forms/Extend.php'; $this->add_form(new ExtendForm()); break; default: require_once 'forms/ListLog.php'; $this->add_form(new ListLogForm()); break; } } else { Url::access_denied(); } }
function draw() { global $display; $cmd = Url::get('cmd'); if ($cmd == 'update') { AZMemcache::do_put("prhot_ver:", 0); Url::redirect_current(); } $this->beginForm(); $list_cat = array(999999999 => 'Mặc định', 0 => 'Trang chủ'); $list_cat += AZLib::getTopCats(); $item = DB::fetch_all('SELECT item_id,status,product_hot_cat_id,end_time,start_time FROM product_hot'); $items_tmp = array(); foreach ($item as $values) { if (isset($list_cat[$values['product_hot_cat_id']])) { $items_tmp[$values['product_hot_cat_id']]['cat_name'] = $list_cat[$values['product_hot_cat_id']]; if ($values['status'] == 1) { $items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['cat_id'] = $values['product_hot_cat_id']; $items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['start_time'] = date("d/m/Y", $values['start_time']); $items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['end_time'] = date("d/m/Y", $values['end_time']); } else { $items_tmp[$values['product_hot_cat_id']]['item'][$values['item_id']] = $values['product_hot_cat_id']; } } } $items = array(); foreach ($list_cat as $key => $values) { if (isset($items_tmp[$key])) { $items[$key] = $items_tmp[$key]; } } $display->add('items', $items); $display->output('ManageProductHot'); $this->endForm(); }
function flash_view_gallery() { $user_id = (int) Url::get('user_id'); if ($user_id) { $sql = 'select id, original_image_url, des FROM item_image WHERE user_id = ' . $user_id . ' AND root_id=0 ORDER BY id DESC LIMIT 0,200'; DB::query($sql); if (DB::num_rows()) { $entry = ''; while ($rows = DB::fetch_row()) { $rows['des'] = $rows['des'] ? $rows['des'] : "Image {$rows['id']}"; $rows['des'] = trim(XMLLib::_xml_encode_attribute($rows['des'])); if (eregi('/', $rows['original_image_url'])) { $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "{$rows['original_image_url']}")); } else { $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "uploaded/items/{$rows['original_image_url']}")); } $entry .= "\n\t\t\t\t\t\t\t<photo imageurl=\"{$url}\" linkurl=\"http://chonmon.vn\">\n\t\t\t\t\t\t\t\t<title>{$rows['des']}</title>\n\t\t\t\t\t\t\t</photo>\t\t \t \t\n\t\t\t\t \t \t"; } @header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?" . '>'; echo "<tiltviewergallery><photos>"; echo $entry; echo "</photos></tiltviewergallery>"; } else { die("no_info"); } } else { die("no_info"); } }
function on_submit() { $email = Url::get('email'); $this->checkFormInput("Emal", 'email', $email, 'email', true); if (!$this->errNum) { if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) { $referer = $_SERVER['HTTP_REFERER']; } else { $referer = $_SERVER['REQUEST_URI']; } $email = Url::get('email'); if ($email != '') { if (!DB::select('news_letter_email', 'email="' . $email . '"')) { DB::insert('news_letter_email', array('email' => $email, 'time_add' => TIME_NOW)); } AZNet::$extraFooter .= '<script> alert("Đăng ký nhận bản tin thành công, cảm ơn bạn đã sử dụng dịch vụ!"); window.location = "' . $referer . '"; </script>'; return; } Url::redirect_url($referer); } else { AZNet::$extraFooter .= '<script> alert("Email bạn nhập không đúng định dạng!"); document.NewsLetterForm.email.focus(); document.NewsLetterForm.email.select(); </script>'; return; } }
function on_submit() { if (User::is_admin()) { $submit = Url::get('submit'); if ($submit == "Cập nhật") { $title_news = Url::get('title_news'); $news_ids = Url::get('news_ids'); $config_update = array('title' => $title_news, 'news_ids' => implode(',', explode(',', $news_ids))); ########################### if (isset(CGlobal::$configs['NewsHomeHot'])) { DB::update('configs', array("conf_val" => addslashes(serialize($config_update))), "conf_key='NewsHomeHot'", __FILE__ . " Dòng:" . __LINE__); } else { DB::insert('configs', array("conf_key" => 'NewsHomeHot', "conf_val" => addslashes(serialize($config_update))), __FILE__ . " Dòng:" . __LINE__); } AZLib::get_config(0, 1); } if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) { $referer = $_SERVER['HTTP_REFERER']; } else { $referer = $_SERVER['REQUEST_URI']; } Url::redirect_url($referer); } Url::redirect_url($_SERVER['REQUEST_URI']); }
function draw() { global $display; $type = (int) $_SESSION['type']; if ($type < 0) { $type = 0; } $cat_id = intval(Url::get('catid', 0)); if ($cat_id != 0) { $where = ' AND category_id = ' . $cat_id; } $where .= ' AND type = ' . $type; $item_per_page = 5; $list_news = News::get_news($where, 0, $item_per_page); if (count($list_news > 0)) { foreach ($list_news as $key => $value) { // $list_news[$key]['title'] = Util::split_char($value['title'],40,-1) . ' ...'; if ($value['uid'] > 0) { $author = User::getUserById($value['uid']); // var_dump($author);die; if ($author['full_name'] == '') { $list_news[$key]['author'] = $author['user_name']; } else { $list_news[$key]['author'] = $author['full_name']; } } } } $display->add('list_news', $list_news); $display->add('cid', $cat_id); $display->add('uid', User::id()); $display->output("List"); }
static function Run() { AZLib::CheckDir(PAGE_CACHE_DIR); if (isset($_REQUEST['page'])) { if ($_REQUEST['page'] == "home") { Url::redirect_url(WEB_DIR, 301); } $page_name = strtolower($_REQUEST['page']); } else { $page_name = 'home'; } AZNet::$page_cache_file = PAGE_CACHE_DIR . $page_name . '.php'; if (Url::get('refresh_page') == 1) { self::del_page_cache($page_name); } if (Url::get('refresh_page') != 1 && PAGE_CACHE_ON && file_exists(AZNet::$page_cache_file)) { require_once AZNet::$page_cache_file; } else { $re = DB::query('SELECT id, name, title, layout FROM page WHERE name="' . addslashes($page_name) . '"', __LINE__ . __FILE__); if ($re) { AZNet::$page = mysql_fetch_assoc($re); } if (!AZNet::$page) { Url::redirect_url(WEB_DIR, 301); } AZGen::PageGenerate(); } }
function ManageSupport($row) { Module::Module($row); if (User::is_admin() || User::have_permit(support_all_perm)) { CGlobal::$website_title = 'Quản lý thư góp ý của khách hàng'; switch (Url::get('cmd')) { case 'delete': DB::query('DELETE FROM support WHERE id=' . EClassApi::getParam('id')); Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id'))); break; case "edit": /*case "add": require_once 'forms/edit.php'; $this->add_form(new EditBadWordForm()); break;*/ /*case "add": require_once 'forms/edit.php'; $this->add_form(new EditBadWordForm()); break;*/ default: require_once 'forms/list.php'; $this->add_form(new ManageSupportForm()); break; } } else { Url::access_denied(); } }
function ManageFilter($row) { Module::Module($row); if (!class_exists('eCateElectronic')) { require_once ROOT_PATH . 'core/eCate.php'; } if (User::have_permit(ADMIN_CATEGORY)) { $cmd = Url::get('cmd'); switch ($cmd) { case 'add': require_once 'forms/ManageFilterAdd.php'; $this->add_form(new ManageFilterAddForm()); break; case 'edit': require_once 'forms/ManageFilterEdit.php'; $this->add_form(new ManageFilterEditForm()); break; case 'sync': require_once 'forms/ManageFilterSync.php'; $this->add_form(new ManageFilterSyncForm()); break; default: require_once 'forms/ManageFilter.php'; $this->add_form(new ManageFilterForm()); break; } } else { die('die'); } }