本文整理汇总了PHP中Url::redirect_current方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::redirect_current方法的具体用法?PHP Url::redirect_current怎么用?PHP Url::redirect_current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::redirect_current方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_submit
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: on_submit
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>"</b>" . stripslashes($this->contact['content']) . "<b>"</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: on_submit
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: CartAdmin
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: on_submit
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: RegisterSuccess
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: ForgotPassword
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: on_submit
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: draw
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: ModuleAdmin
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: ZoneEditForm
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: PostItem
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: PageAdmin
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: on_submit
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: on_submit
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!");
}
}