File "admin-promotions-delete.inc.php"

Full Path: /srv/www/www.cadoro.it/src/controllers/admin-promotions-delete.inc.php
File size: 437 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
  $promotion = models\Promotion::get_by_id($promotion_id);
  if (!$promotion) {
    not_found();
  }

  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $promotion->delete();
    header("Location: " . BASE_URL . "/admin/promotions");
    exit;
  }

  $smarty->assign("promotion", $promotion);

  $smarty->assign("menu", "catalog");
  $smarty->assign("submenu", "promotions");

  $smarty->display("admin-promotions-delete.tmpl");
?>