예제 #1
0
 function on_submit()
 {
     $user_name = AZLib::getParam('user_name');
     $content = AZLib::getParam('content');
     $active = (int) Url::get('active');
     $expire = (int) Url::get('expire', 7);
     $id = (int) Url::get('id');
     $cmd = Url::get('cmd');
     $sql = "SELECT id FROM user WHERE user_name='{$user_name}'";
     $row = DB::fetch($sql);
     $user_id = (int) $row["id"];
     if (!$user_id) {
         $this->setFormError('user_name', 'Không tồn tại thành viên này!');
     } elseif (!$user_name || !$content) {
         $this->setFormError('content', 'Dữ liệu không hợp lệ!');
     } else {
         if ($cmd == "add") {
             $item_array = array('content' => $content, 'user_name' => $user_name, 'user_id' => $user_id, 'admin_add' => User::user_name(), 'active' => $active, 'time_add' => TIME_NOW, 'expire_date' => TIME_NOW + 86400 * $expire);
             DB::insert('admin_notice_user', $item_array);
         } elseif ($cmd == "edit" && $id) {
             $item_array = array('content' => $content, 'user_name' => $user_name, 'user_id' => $user_id, 'admin_edit' => User::user_name(), 'active' => $active, 'time_edit' => TIME_NOW, 'expire_date' => TIME_NOW + 86400 * $expire);
             DB::update_id('admin_notice_user', $item_array, $id);
         }
         User::getAdminNoticeUser($user_id, 0, 1);
         Url::redirect_current(array('act'));
     }
 }
예제 #2
0
 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
 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!');
         }
     }
 }
예제 #4
0
파일: class.php 프로젝트: duynhan07/elink
 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();
     }
 }
예제 #5
0
파일: detail.php 프로젝트: hqd276/bigs
 function on_submit()
 {
     $id = intval(Url::get('id'));
     $data['name'] = Url::get('name');
     $data['name_en'] = Url::get('name_en');
     if (empty($data['shortcut'])) {
         $data['shortcut'] = strtolower(EClassApi::safe_title($data['name']));
     } else {
         $data['shortcut'] = strtolower(EClassApi::safe_title(Url::get('shorcut')));
     }
     $data['description'] = Url::get('description');
     $data['description_en'] = Url::get('description_en');
     $data['keywords'] = Url::get('keywords');
     $data['is_active'] = Url::get('is_active');
     if (empty($data['name'])) {
         $this->setErrorMessage('news/category/error', 'Tên danh mục không được để trống');
         Url::redirect_current();
         return;
     }
     if (intval($id) == 0) {
         $id = DB::insert('news_category', $data);
         $this->setSuccessMessage('news/category/form', serialize($data));
         $this->setSuccessMessage('news/category/success', 'Lưu thông tin danh mục [' . $data['name'] . '] thành công');
     } else {
         DB::update('news_category', $data, 'id=' . $id);
         $this->setSuccessMessage('news/category/success', 'Cập nhật thông tin danh mục [' . $data['name'] . '] thành công');
     }
     Url::redirect_url('admin_news_category.html?cmd=edit&id=' . $id);
 }
예제 #6
0
파일: class.php 프로젝트: duynhan07/elink
 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;
     }
 }
예제 #7
0
파일: class.php 프로젝트: duynhan07/elink
 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());
 }
예제 #8
0
파일: edit.php 프로젝트: duynhan07/elink
 function on_submit()
 {
     $id = intval(AZLib::getParam('id'));
     $cmd = AZLib::getParam('cmd');
     $exact = AZLib::getParam('exact');
     $is_phone = AZLib::getParam('is_phone');
     //		$contents = trim(AZLib::getParam('contents'));
     //		$contents = AZLib::delDoubleSpace(AZLib::trimSpace($contents));
     //		$contents = trim($contents,",");
     $contents = Url::get("contents");
     $reason = Url::get("reason");
     if ($is_phone == 1) {
         $contents = BadWord::badword_phone_type($contents);
     }
     $where = "";
     if ($cmd == 'edit' && $id && $contents) {
         $where = " AND id <> {$id}";
     }
     $re = DB::query("SELECT id FROM bad_words WHERE checksum = '" . md5($contents) . "' " . $where);
     $item = mysql_fetch_assoc($re);
     if ($item["id"]) {
         $this->setFormError('adv_banner', "<b>Từ khóa '{$contents}' đã tồn tại.</b>");
         return false;
     }
     if ($cmd == 'edit' && $id && $contents) {
         if (DB::query('UPDATE bad_words SET contents="' . $contents . '", exact="' . $exact . '", reason="' . $reason . '", is_phone="' . $is_phone . '", checksum="' . md5($contents) . '" WHERE id="' . $id . '"')) {
             AZLib::get_badword(1, 0);
         }
     } elseif ($cmd == 'add' && $contents) {
         if (DB::query('INSERT INTO bad_words(contents,exact,is_phone,checksum,reason) VALUES ("' . $contents . '","' . $exact . '","' . $is_phone . '","' . md5($contents) . '","' . $reason . '")')) {
             AZLib::get_badword(1, 0);
         }
     }
     Url::redirect_current();
 }
예제 #9
0
 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();
 }
예제 #10
0
파일: class.php 프로젝트: hqd276/bigs
	function ModuleAdmin($row){
		Module::Module($row);
		
		if(User::is_root()){
			if(Url::check(array('cmd'=>'delete_cache'))){
				EClass::update_all_page();
				require_once ROOT_PATH.'includes/enbac/dir.php';
				empty_all_dir(PAGE_CACHE_DIR,true);
				Url::redirect_current();
			}
			else
			if(Url::check(array('cmd'=>'scan'))){
				require_once 'forms/scan.php';
				$this->add_form(new ScanModuleForm());
			}
			else
			{
				require_once 'forms/list.php';
				$this->add_form(new ListModuleAdminForm());
			}
		}
		else{
			Url::access_denied();
		}
	}
예제 #11
0
 function ZoneEditForm()
 {
     Form::Form('ZoneEditForm');
     if (Url::get('cmd') == 'edit') {
         CGlobal::$website_title = 'Sửa Nhóm Danh mục';
         $id = (int) Url::get('id', 0);
         if ($id) {
             $this->cat_zone = DB::select('category_zone', 'id=' . $id);
         }
         if (!$this->cat_zone) {
             Url::redirect_current();
         }
         //$re = DB::query("SELECT c.id, c.name FROM (SELECT zoneid, catid FROM category_zone_cat WHERE zoneid=$id) AS z LEFT JOIN category AS c ON c.id=z.catid");
         $re = DB::query("SELECT catid FROM category_zone_cat WHERE zoneid={$id} ORDER BY position");
         if ($re) {
             while ($cat = mysql_fetch_assoc($re)) {
                 //$this->cats[$cat['id']] = $cat;
                 if ($this->cats != '') {
                     $this->cats .= ',';
                 }
                 $this->cats .= $cat['catid'];
             }
         }
     } else {
         CGlobal::$website_title = 'Thêm Nhóm Danh mục';
         $this->cat_zone = array('name' => '', 'brief_name' => '', 'position' => 1, 'status' => 0, 'class' => 'fashion');
     }
 }
예제 #12
0
파일: class.php 프로젝트: duynhan07/elink
 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));
     }
 }
예제 #13
0
파일: class.php 프로젝트: hqd276/bigs
 function PageAdmin($row)
 {
     Module::Module($row);
     if (User::is_root()) {
         $cmd = Url::get('cmd');
         switch ($cmd) {
             case 'delete_all_cache':
                 EClass::update_all_page();
                 require_once ROOT_PATH . 'includes/enbac/dir.php';
                 empty_all_dir(PAGE_CACHE_DIR, true);
                 Url::redirect_current();
                 break;
             case 'refresh':
                 $id = (int) Url::get('id', 0);
                 if ($id) {
                     EClass::update_page($id);
                     if (Url::check('href')) {
                         Url::redirect_url($_REQUEST['href']);
                     } else {
                         Url::redirect_current();
                     }
                 }
                 Url::redirect_current();
                 break;
             case 'delete':
                 $id = (int) Url::get('id', 0);
                 if ($id) {
                     DB::delete('block', 'page_id=' . $id);
                     DB::delete_id('page', $id);
                     require_once ROOT_PATH . 'includes/enbac/dir.php';
                     empty_all_dir(DIR_CACHE . 'pages', true);
                     empty_all_dir(DIR_CACHE . 'modules', true);
                 }
                 Url::redirect_current();
                 break;
             case 'edit':
             case 'add':
             case 'copy':
                 require_once 'forms/edit.php';
                 $this->add_form(new EditPageAdminForm());
                 break;
             case 'export_xml':
                 require_once 'forms/export_xml.php';
                 $this->add_form(new ExportXmlPageAdminForm());
                 break;
             case 'import_xml':
                 require_once 'forms/import_xml.php';
                 $this->add_form(new ImportXmlPageAdminForm());
                 break;
             default:
                 require_once 'forms/list.php';
                 $this->add_form(new ListPageAdminForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
예제 #14
0
 function on_submit()
 {
     $user_update = array();
     $full_name = Url::get('full_name');
     $user_name = Url::get('register_user_name');
     $mobile_phone = AZLib::trimSpace(Url::get('mobile_phone'));
     $home_phone = AZLib::trimSpace(Url::get('home_phone'));
     $gender = (int) Url::get('gender');
     $yahoo_id = AZLib::trimSpace(Url::get('yahoo_id'));
     $skype_id = AZLib::trimSpace(Url::get('skype_id'));
     $address = AZLib::trimSpace(Url::get('address'));
     $website = AZLib::trimSpace(Url::get('website'));
     $this->checkFormInput('Tên đầy đủ', 'full_name', $full_name, 'str', false, '', 0, 50);
     $this->checkFormInput('Điện thoại di động', 'mobile_phone', $mobile_phone, 'str', false, '', 0, 50);
     $this->checkFormInput('Điện thoại bàn', 'home_phone', $home_phone, 'str', false, '', 0, 50);
     $change_pass = 0;
     $change_mail = 0;
     if (User::is_root() && (User::id() == 1 || $this->user['id'] != 1)) {
         $email = Url::get('email');
         $password = AZLib::trimSpace(Url::get('register_password'));
         $confirm_password = AZLib::trimSpace(Url::get('confirm_password'));
         if ($password && User::encode_password($password) != $this->user['password']) {
             //Có nhập pass mới khác pass cũ
             $this->checkFormInput('Mật khẩu truy cập', 'register_password', $password, 'str', true, '', 6, 50);
             $change_pass = 1;
             if ($password != $confirm_password) {
                 $this->setFormError('confirm_password', "Nhập lại Mật khẩu truy cập không khớp!");
             }
         }
         if ($email && $email != $this->user['email']) {
             //Có nhập email mới khác email cũ
             $this->checkFormInput('Email', 'email', $email, 'email', true, '', 6, 50);
             $change_mail = 1;
         }
     }
     if ($mobile_phone && !AZLib::is_mobile($mobile_phone)) {
         $mobile_phone = "";
     }
     if (!$this->errNum) {
         if ($change_mail && DB::exists('SELECT id FROM `user` WHERE `email`="' . $email . '" AND id!=' . $this->user['id'])) {
             $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!");
         } else {
             $user_info = array('full_name' => $full_name, 'mobile_phone' => $mobile_phone, 'home_phone' => $home_phone, 'gender' => $gender == 1 ? 0 : 1, 'yahoo_id' => $yahoo_id, 'skype_id' => $skype_id, 'address' => $address, 'website' => $website);
             if ($change_pass) {
                 $user_info['password'] = User::encode_password($password);
             }
             if ($change_mail) {
                 $user_info['email'] = $email;
             }
             DB::update('user', $user_info, "id=" . $this->user['id']);
             User::getUser($this->user['id'], 0, 1);
             Url::redirect_current();
         }
     }
 }
예제 #15
0
 function on_submit()
 {
     $status = (int) Url::get('status');
     $sms_total = (int) Url::get('sms_total');
     $user_name = Url::get('user_name', '');
     $note = Url::get('note', '');
     if ($user_name != '') {
         if (DB::select("sms_user_active", "user_name='{$user_name}'")) {
             $this->setFormError("user_name", "Thành viên này đã tồn tại trong danh sách quản lý THÀNH VIÊN CHỨNG THỰC");
         } else {
             if ($status == 1) {
                 //Kích hoạt
                 $user = User::getByUserName($user_name);
                 $this->a_row['a_time'] = TIME_NOW;
                 if ($user) {
                     if ($user['level'] == 0) {
                         DB::query("UPDATE account SET level = 1 WHERE id={$user['id']}");
                         if (MEMCACHE_ON) {
                             $user['level'] = 1;
                             eb_memcache::do_put("user:{$user['id']}", $user);
                         }
                     }
                 } else {
                     $this->setFormError('', "Tài khoản không tồn tại!");
                 }
             } else {
                 //Bỏ Kích hoạt
                 $this->a_row['a_time'] = 0;
                 $user = User::getByUserName($user_name);
                 if ($user) {
                     if ($user['level'] == 1) {
                         DB::query("UPDATE account SET level = 0 WHERE id={$user['id']}");
                         if (MEMCACHE_ON) {
                             $user['level'] = 0;
                             eb_memcache::do_put("user:{$user['id']}", $user);
                         }
                     }
                 } else {
                     $this->setFormError('', "Tài khoản không tồn tại!");
                 }
             }
             if (!$this->errNum) {
                 $this->a_row['user_id'] = $user['id'];
                 $this->a_row['user_name'] = $user['user_name'];
                 $this->a_row['sms_total'] = (int) ($sms_total <= 0 ? 0 : $sms_total);
                 $this->a_row['status'] = $status;
                 $this->a_row['note'] = $note;
                 DB::insert("sms_user_active", $this->a_row);
                 Url::redirect_current();
             }
         }
     } else {
         $this->setFormError('user_name', "Bạn chưa nhập vào tài khoản!");
     }
 }
예제 #16
0
파일: class.php 프로젝트: duynhan07/elink
 function Event($row)
 {
     Module::Module($row);
     if (User::is_admin()) {
         $cmd = Url::get('cmd');
         switch ($cmd) {
             case 'del':
                 if (User::is_root()) {
                     $e_id = Url::get('id');
                     if ($e_id) {
                         $event_product = DB::select('event_product', "id={$e_id}");
                         if ($event_product && $event_product['status'] != 3 && $event_product['status'] != 4) {
                             DB::update('event_product', array('status' => 4, 'time_del' => TIME_NOW, 'user_del' => User::user_name()), "id={$e_id}");
                         }
                     }
                 }
                 Url::redirect_current();
                 break;
             case 'active':
                 $e_id = Url::get('id');
                 if ($e_id) {
                     $event_product = DB::select('event_product', "id={$e_id}");
                     if ($event_product && $event_product['status'] == 1) {
                         DB::update('event_product', array('status' => 2, 'time_m' => TIME_NOW, 'user_m' => User::user_name()), "id={$e_id}");
                     }
                 }
                 Url::redirect_current();
                 break;
             case 'disable':
                 $e_id = Url::get('id');
                 if ($e_id) {
                     $event_product = DB::select('event_product', "id={$e_id}");
                     if ($event_product && $event_product['status'] == 2) {
                         DB::update('event_product', array('status' => 1, 'time_m' => TIME_NOW, 'user_m' => User::user_name()), "id={$e_id}");
                     }
                 }
                 Url::redirect_current();
                 break;
             case 'edit':
                 require_once 'forms/EventEdit.php';
                 $this->add_form(new EventEditForm());
                 break;
             case 'add':
                 require_once 'forms/EventAdd.php';
                 $this->add_form(new EventAddForm());
                 break;
             default:
                 require_once 'forms/EventProduct.php';
                 $this->add_form(new EventProductForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
예제 #17
0
 function on_submit()
 {
     if (Url::get('cmd') == 'add_group') {
         $group_name = Url::get('group_name');
         if ($group_name != "") {
             $permit = array('type' => 0, 'ref_id' => 0, 'pids' => 0, 'cids' => '', 'name' => $group_name);
             DB::insert('account_permit', $permit, true);
         }
         Url::redirect_current();
     }
 }
예제 #18
0
 function UserLogForm()
 {
     Form::Form('UserLogForm');
     CGlobal::$website_title = "Danh sách lỗi của thành viên";
     $user_id = intval(Url::get('user_id'));
     if ($user_id) {
         $this->user = User::getUser($user_id);
     } else {
         Url::redirect_current();
     }
 }
예제 #19
0
 function PageContentForm()
 {
     Form::Form('ConfigPageAdminForm');
     CGlobal::$website_title = "Cấu hình, cắm module cho Page";
     $id = (int) Url::get('id');
     if ($id) {
         $this->page = DB::select('page', 'id=' . $id);
     }
     if (!$this->page) {
         Url::redirect_current();
     }
 }
예제 #20
0
파일: class.php 프로젝트: duynhan07/elink
 function PublicSurveyForm()
 {
     Form::Form('PublicSurveyForm');
     if (Url::get('cmd') == 'add_poll_to_block' && (int) Url::get('block_id') == Module::$block_id) {
         $id_survey = (int) Url::get('poll_id');
         if ($id_survey) {
             $survey = DB::select("public_survey", "id={$id_survey}");
             if ($survey) {
                 $survey_config = @CGlobal::$configs['survey_config']['conf_val'];
                 if ($survey_config != '') {
                     $survey_config = unserialize(stripslashes($survey_config));
                 } else {
                     $survey_config = array();
                 }
                 $survey_config[Module::$block_id] = $id_survey;
                 if (isset(CGlobal::$configs['survey_config'])) {
                     DB::update('configs', array("conf_val" => addslashes(serialize($survey_config))), "conf_key='survey_config'");
                 } else {
                     DB::insert('configs', array("conf_key" => 'survey_config', "conf_val" => addslashes(serialize($survey_config))));
                 }
                 AZLib::get_config(0, 1);
             }
             Url::redirect_current();
         }
     }
     if (Url::get('cmd') == 'remove_survey' && (int) Url::get('block_id') == Module::$block_id) {
         $survey_config = @CGlobal::$configs['survey_config']['conf_val'];
         if ($survey_config != '') {
             $survey_config = unserialize(stripslashes($survey_config));
         } else {
             $survey_config = array();
         }
         if (isset($survey_config[Module::$block_id])) {
             unset($survey_config[Module::$block_id]);
         }
         if (isset(CGlobal::$configs['survey_config'])) {
             DB::update('configs', array("conf_val" => addslashes(serialize($survey_config))), "conf_key='survey_config'");
         } else {
             DB::insert('configs', array("conf_key" => 'survey_config', "conf_val" => addslashes(serialize($survey_config))));
         }
         AZLib::get_config(0, 1);
         Url::redirect_current();
         /*if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']){
         			$referer = $_SERVER['HTTP_REFERER'];
         		}
         		else{
         			$referer = $_SERVER['REQUEST_URI'];
         		}
         		
         		Url::redirect_url($referer);*/
     }
 }
예제 #21
0
 function on_submit()
 {
     $gfsubmit = Url::get("gfsubmit");
     if ($gfsubmit) {
         $fgroup_id = (int) implode(array_keys($gfsubmit));
         if ($fgroup_id) {
             $fgroup = DB::select("filter_group", "id={$fgroup_id}");
             if ($fgroup) {
                 $gf_name = Url::get('gf_name');
                 $gf_pos = Url::get('gf_pos');
                 if (isset($gf_name[$fgroup_id], $gf_pos[$fgroup_id]) && $gf_name[$fgroup_id] && $gf_pos[$fgroup_id]) {
                     $gf_name = $gf_name[$fgroup_id];
                     $gf_pos = $gf_pos[$fgroup_id];
                     if ($fgroup['name'] != $gf_name || $fgroup['pos'] != $gf_pos) {
                         $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0);
                         if ($gf_pos > $max_pos) {
                             $gf_pos = $max_pos;
                         } elseif ($gf_pos <= 0) {
                             $gf_pos = $fgroup['pos'];
                         }
                         DB::update('filter_group', array("name" => $gf_name, "pos" => $gf_pos), "id={$fgroup_id}");
                         if (DB::select('filter_group', "pos={$gf_pos} AND id!={$fgroup_id}")) {
                             DB::query("UPDATE filter_group SET pos=pos+1 WHERE pos>={$gf_pos} AND pos<={$fgroup['pos']} AND id!={$fgroup_id}");
                         }
                         AZLib::getFilters(1);
                     }
                 }
             }
         }
         Url::redirect_current(array('cmd'));
     }
     $submit = Url::get("submit");
     if ($submit == "Thêm nhóm thuộc tính") {
         $gfilter_name = Url::get('gfilter_name');
         $gfilter_pos = Url::get('gfilter_pos');
         if ($gfilter_name != '' && $gfilter_pos) {
             $gfilter_group = array('name' => $gfilter_name, 'catids' => $this->cat['id'], 'pos' => $gfilter_pos);
             $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0);
             if ($gfilter_pos > $max_pos || $gfilter_pos <= 0) {
                 $gfilter_pos = $max_pos + 1;
             }
             $gfilter_group['pos'] = $gfilter_pos;
             $id = DB::insert('filter_group', $gfilter_group);
             if ($id && DB::select('filter_group', 'pos="' . $gfilter_pos . '" AND id!=' . $id)) {
                 DB::query('UPDATE filter_group SET pos=pos+1 WHERE pos>=' . $gfilter_pos . ' AND id!=' . $id);
             }
         }
         AZLib::getFilters(1);
         Url::redirect_current(array('cmd'));
     }
     Url::redirect_current(array('cmd'));
 }
예제 #22
0
파일: list.php 프로젝트: duynhan07/elink
 function on_submit()
 {
     if (Url::get('cmd') == 'delete') {
         $selected_ids = Url::get('selected_ids');
         if ($selected_ids) {
             $ids = implode(',', $selected_ids);
             if ($ids) {
                 DB::delete('province', "id IN(" . $ids . ")");
             }
         }
     }
     Url::redirect_current();
 }
예제 #23
0
파일: class.php 프로젝트: duynhan07/elink
 function on_submit()
 {
     $txt_option = Url::get('txt_option', '');
     $id = Url::get('id', 0);
     if ($txt_option != '') {
         if ($id == 0) {
             DB::insert('public_survey_opinion', array('id_survey' => $this->public_survey['id'], 'option' => $txt_option));
         } else {
             DB::update('public_survey_opinion', array('option' => $txt_option), 'id=' . $id);
         }
     }
     Url::redirect_current(array('id_survey'));
 }
예제 #24
0
파일: MapView.php 프로젝트: duynhan07/elink
 function on_submit()
 {
     if (User::is_admin()) {
         $map_content = Url::get("map_content");
         if (isset(CGlobal::$configs['map_content'])) {
             DB::update('configs', array("conf_val" => $map_content), "conf_key='map_content'");
         } else {
             DB::insert('configs', array("conf_key" => "map_content", "conf_val" => $map_content));
         }
         AZLib::get_config(0, 1);
         Url::redirect_current();
     }
 }
예제 #25
0
 function on_submit()
 {
     AZLib::getCats();
     $item_id = (int) Url::get("item_id", 0);
     $time_s = Url::get("time_start", '');
     $time_e = Url::get("time_end", '');
     $category = (int) Url::get("category", 0);
     $num_contract = Url::get("num_contract", '');
     $item = Item::get_item($this->booking_vip['item_id']);
     if (!$this->errNum) {
         $time_start = 0;
         if ($time_s != '') {
             $arr = explode('-', $time_s);
             if (count($arr) == 3) {
                 $time_start = mktime(0, 0, 0, $arr[1], $arr[0], $arr[2]);
             }
         }
         if (!$time_start) {
             $time_start = mktime(0, 0, 0, date('m', TIME_NOW), date('d', TIME_NOW), date('Y', TIME_NOW));
         }
         $time_end = 0;
         if ($time_e != '') {
             $arr = explode('-', $time_e);
             if (count($arr) == 3) {
                 $time_end = mktime(23, 59, 59, $arr[1], $arr[0], $arr[2]);
             }
         }
         if (!$time_end) {
             $this->setFormError('time_end', 'Bạn chưa nhập vào thời gian kết thúc!');
             return;
         }
         if ($time_end < $time_start) {
             $this->setFormError('time_end', 'Thời gian kết thúc phải lớn hơn thời gian bắt đầu!');
             return;
         }
         $item = Item::get_item($item_id);
         // xac dinh xem co hien thi o danh muc cha khong
         $top_cat = 0;
         $cat_id = 0;
         if ($category == 1) {
             $top_cat = $item['level_1_catid'];
         } else {
             if ($category == 2) {
                 $cat_id = $item['category_id'];
             }
         }
         $id = DB::update("bookings_vip", array('item_id' => $item_id, 'cat_id' => $cat_id, 'top_cat' => $top_cat, 'note' => AZLib::getParam('note'), 'time_start' => $time_start, 'time_end' => $time_end, 'time_edit' => TIME_NOW, 'user_edit' => User::user_name(), 'num_contract' => $num_contract), "id=" . $this->booking_vip['id']);
         Url::redirect_current();
     }
 }
예제 #26
0
 function on_submit()
 {
     $status = (int) Url::get('status');
     $sms_total = (int) Url::get('sms_total');
     $note = Url::get('note', '');
     if ($status == 1 && $this->a_row['status'] != 1) {
         //Kích hoạt
         if ($this->a_row['user_id']) {
             $user = User::getUser($this->a_row['user_id']);
             if ($user) {
                 if ($user['level'] == 0) {
                     DB::query("UPDATE account SET level = 1 WHERE id={$user['id']}");
                     if (MEMCACHE_ON) {
                         $user['level'] = 1;
                         eb_memcache::do_put("user:{$user['id']}", $user);
                     }
                 }
             } else {
                 $this->setFormError("user_name", "Tài khoản không tồn tại!");
             }
         }
     } elseif (($status == 0 || $status == 2) && $this->a_row['status'] == 1) {
         //Bỏ Kích hoạt
         if ($this->a_row['user_id']) {
             $user = User::getUser($this->a_row['user_id']);
             if ($user) {
                 if ($user['level'] == 1) {
                     DB::query("UPDATE account SET level = 0 WHERE id={$user['id']}");
                     if (MEMCACHE_ON) {
                         $user['level'] = 0;
                         eb_memcache::do_put("user:{$user['id']}", $user);
                     }
                 }
             } else {
                 $this->setFormError("user_name", "Tài khoản không tồn tại!");
             }
         }
     }
     if (!$this->errNum) {
         $array = array('status' => $status, 'note' => $note, 'm_time' => TIME_NOW, 'm_user_name' => User::user_name(), 'sms_total' => (int) ($sms_total <= 0 ? 0 : $sms_total));
         if ($status == 1) {
             $array['a_time'] = TIME_NOW;
         } else {
             $array['a_time'] = 0;
         }
         DB::update("sms_user_active", $array, "id=" . $this->a_row['id']);
         Url::redirect_current();
     }
 }
예제 #27
0
 function OnlineUserForm()
 {
     if (User::is_az_team() && DEBUG) {
         Form::Form('OnlineUserForm');
         $this->link_css('style/active_users.css');
         CGlobal::$website_title = 'Thành viên online';
         if (isset($_GET['kick_out']) && User::is_admin()) {
             $session_id = Url::get('kick_out');
             if ($session_id) {
                 DB::delete(_SESS_TABLE, 'session_id="' . $session_id . '"');
             }
             Url::redirect_current();
         }
     }
 }
예제 #28
0
 function UserDetailForm()
 {
     Form::Form('UserDetailForm');
     CGlobal::$website_title = "Thông tin thành viên";
     $this->link_css('style/manage_item.css');
     $this->link_css('style/aznet/ui.datepicker.css');
     $this->link_js('javascript/jquery/ui.datepicker.js');
     $user_id = (int) Url::get('id');
     if ($user_id) {
         //Xoá 1 thành viên
         $this->user = DB::select('user', "id={$user_id}");
     }
     if (!$this->user) {
         Url::redirect_current();
     }
 }
예제 #29
0
파일: class.php 프로젝트: duynhan07/elink
 function on_submit()
 {
     $url_detail = URL::get('url');
     $status = URL::get('status', 'int', 0);
     $type = URL::get('type', 'int', 1);
     $contentConfig = $status . "\n" . $url_detail . "\n" . $type;
     $banner_file = DATA_PATH . 'adv/AdvHomeBottom';
     if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) {
         $file_ext = strtolower(substr($_FILES['banner']['name'], strlen($_FILES['banner']['name']) - 4, 4));
         if ($type == 1) {
             //Ảnh
             if (in_array($file_ext, array('.jpg', '.gif'))) {
                 if (getimagesize($_FILES['banner']['tmp_name'])) {
                     if (!move_uploaded_file($_FILES['banner']['tmp_name'], $banner_file . '.gif')) {
                         $this->setFormError('banner', 'Không up load được Banner!');
                         return;
                     }
                 } else {
                     $this->setFormError('banner', 'Sai định dạng ảnh!');
                     return;
                 }
             } else {
                 $this->setFormError('banner', 'Chỉ chấp nhận các định dạng file .jpg , .gif !');
                 return;
             }
         } else {
             if (in_array($file_ext, array('.swf'))) {
                 if (!move_uploaded_file($_FILES['banner']['tmp_name'], $banner_file . '.swf')) {
                     $this->setFormError('banner', 'Không up load được Banner!');
                     return;
                 }
             } else {
                 $this->setFormError('banner', 'Flash đại diện chỉ chấp nhận các định dạng file .swf');
                 return;
             }
         }
     }
     if (isset(CGlobal::$configs['AdvHomeBottom'])) {
         DB::update('configs', array("conf_val" => $contentConfig), "conf_key='AdvHomeBottom'");
     } else {
         DB::insert('configs', array("conf_key" => 'AdvHomeBottom', "conf_val" => $contentConfig));
     }
     AZLib::get_config(0, 1);
     Url::redirect_current();
     //CGlobal::$configs['AdvHomeBottom']['conf_val'] = $contentConfig;
 }
예제 #30
0
파일: list.php 프로젝트: hqd276/bigs
 function on_submit()
 {
     if (Url::get('cmd') == 'delete_items') {
         $selected_ids = Url::get('selected_ids');
         if ($selected_ids) {
             $ids = implode(',', $selected_ids);
             if ($ids) {
                 EClass::update_page($ids);
                 DB::delete('block', 'page_id IN(' . $ids . ')');
                 DB::delete('page', 'id IN(' . $ids . ')');
                 require_once ROOT_PATH . 'includes/enbac/dir.php';
                 empty_all_dir(PAGE_CACHE_DIR, true);
             }
         }
         Url::redirect_current();
     }
 }