本文整理汇总了PHP中tools::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::redirect方法的具体用法?PHP tools::redirect怎么用?PHP tools::redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::redirect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_delete
function admin_delete($id)
{
if ($this->advert->delete((int) $id)) {
tools::setFlash($this->l('Request processed'), 'success');
} else {
tools::setFlash($this->l('An error has occurred'), 'error');
}
tools::redirect('/admin/advert');
}
示例2: admin_delete_image
function admin_delete_image($id)
{
$image = $this->product->getImageById($id);
$toDelete = array(_DIR_ . '/assets/img/product/' . $image['link'], _DIR_ . '/assets/img/product/thumb/' . $image['product_id'] . '/home_label.jpg', _DIR_ . '/assets/img/product/thumb/' . $image['product_id'] . '/home_list.jpg', _DIR_ . '/assets/img/product/thumb/' . $image['product_id'] . '/product_full.jpg', _DIR_ . '/assets/img/product/thumb/' . $image['product_id'] . '/product_gallery.jpg', _DIR_ . '/assets/img/product/thumb/' . $image['product_id'] . '/product_thumb.jpg');
foreach ($toDelete as $name) {
if (file_exists($name)) {
unlink($name);
}
}
if ($this->product->deleteImage($id)) {
tools::setFlash($this->l('Request processed'), 'success');
} else {
tools::setFlash($this->l('An error has occurred'), 'error');
}
tools::redirect('/admin/product/images/' . $image['product_id']);
}
示例3: admin_delete_extend
function admin_delete_extend($id)
{
if ($this->user->delete($id)) {
tools::setFlash($this->l('Request processed'), 'success');
} else {
tools::setFlash($this->l('An error has occurred'), 'error');
}
tools::redirect('/admin/user/extends');
}
示例4: admin_delete
function admin_delete($id)
{
$this->exec("DELETE FROM " . DB_PREFIX . "testimonials WHERE id=" . $id . "");
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/testimonial');
}
示例5: admin_do_selected
function admin_do_selected()
{
if (!empty($_POST)) {
switch ($type) {
case 'delete_message':
foreach ($_POST as $message_id) {
$this->exec("DELETE FROM " . DB_PREFIX . "messages WHERE id=" . $message_id . "");
}
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/dashboard/messages');
break;
default:
break;
}
}
}
示例6: admin_edit
function admin_edit($id)
{
if (!empty($_POST)) {
$post_data = tools::filter($_POST);
$this->exec("UPDATE " . DB_PREFIX . "payments SET account = '" . $post_data['account'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t fixed_fees = '" . $post_data['fixed_fees'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t variable_fees = '" . $post_data['variable_fees'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t active='" . $post_data['active'] . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE id = " . $id . "");
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/payment');
}
$payment = $this->exec_one("SELECT * FROM " . DB_PREFIX . "payments WHERE id=" . $id . "");
$this->smarty->assign('payment', $payment);
$this->smarty->display('admin/settings/edit_payment.tpl');
}
示例7: admin_delete
function admin_delete($id)
{
$this->exec("DELETE FROM " . DB_PREFIX . "auctions WHERE id=" . tools::filter($id));
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/auction');
}
示例8: admin_edit
function admin_edit($id)
{
if (!empty($_POST)) {
$data = tools::filter($_POST);
if ($data['name'] == 'auction_peak_start' || $data['name'] == 'auction_peak_end') {
$data['value'] = $data['hours'] . ':' . $data['minutes'];
} elseif ($data['name'] == 'bid_value') {
if (strpos($data['value'], ',')) {
$data['value'] = str_replace(',', '.', $data['value']);
}
}
$toUpdate = array('value' => $data['value']);
if ($this->setting->update($id, $toUpdate)) {
if (isset($data['theme'])) {
$dir = _DIR_ . '/data/smarty/compile';
$handle = opendir($dir);
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
unlink($dir . '/' . $file);
}
}
closedir($dir);
} elseif ($data['name'] == 'site_live') {
$filename = _DIR_ . '/data/site_live';
if (file_exists($filename)) {
unlink($filename);
}
} elseif ($data['name'] == 'auction_peak_start') {
$filename = _DIR_ . '/data/auction_peak_start';
if (file_exists($filename)) {
unlink($filename);
}
} elseif ($data['name'] == 'auction_peak_end') {
$filename = _DIR_ . '/data/auction_peak_end';
if (file_exists($filename)) {
unlink($filename);
}
}
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/setting');
}
}
$setting = $this->setting->getById($id);
if ($setting['name'] == 'theme') {
$dir = _DIR_ . '/app/view/';
$files = scandir($dir);
$themes = array();
$i = 0;
foreach ($files as $filename) {
if (is_dir($dir . $filename)) {
if (!preg_match('[^0-9A-Za-z_-]', $filename) && $filename != 'admin') {
$themes[$i]['name'] = $filename;
}
}
$i++;
}
} else {
$themes = null;
}
if ($setting['name'] == 'auction_peak_start' || $setting['name'] == 'auction_peak_end') {
$explode = explode(':', $setting['value']);
$setting['hours'] = $explode[0];
$setting['minutes'] = $explode[1];
}
$hours = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
$minutes = array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59");
$this->smarty->assign(array('setting' => $setting, 'themes' => $themes, 'hours' => $hours, 'minutes' => $minutes));
$this->smarty->display('admin/settings/edit_setting.tpl');
}
示例9: admin_delete
function admin_delete($id)
{
$this->exec("DELETE FROM " . DB_PREFIX . "suppliers WHERE id=" . $id);
tools::setFlash($this->l('Request processed'), 'success');
tools::redirect('/admin/supplier');
}
示例10: delete
function delete($id)
{
if (isset($_SESSION['user_id'])) {
$autobid_id = tools::filter($id);
$user_id = $_SESSION['user_id'];
$this->exec("DELETE FROM " . _DB_PREFIX_ . "autobids WHERE id = " . $autobid_id . " AND user_id = " . $user_id . "");
tools::setFlash(SUCCESS_AUTOBID_CANCEL, 'success');
tools::redirect('/autobids');
} else {
tools::setFlash(ERROR_LOGIN, 'error');
tools::redirect('/user/login');
}
}