www
/
wwwroot
/
magazinmiorita.be
/
admin
➕ New
📤 Upload
✎ Editing:
add_promo.php
← Back
<?php include('../includes/inc.config.php'); include('check_session.php'); $products_results = array(); $products = $database->execute(" SELECT * FROM `products` "); while($row = $database->fetch($products)){ $products_results[] = $row; } $smarty->assign("products", $products_results); if(isset($_POST['add'])){ $product = $_POST['pid']; $price = $_POST['old_price']; $discount = $_POST['discount']; $new_price = $_POST['new_price']; $expire = $_POST['expire']; $type = $_POST['type']; $require = $_POST['require']; $additional = $_POST['additional']; $add_promo = $database->execute("INSERT INTO `promotions` (`pid`, `price`, `discount`, `new_price`, `type`, `expire`, `require_buy`, `additional`, `indate`) VALUES ('$product', '$price', '$discount', '$new_price', '$type', '$expire', '$require', '$additional', '".time()."')"); if($add_promo){ header('Location: promotions.php?m=ok'); exit; }else{ $smarty->assign("type", 'err'); $smarty->assign("message", 'Promotia nu poate fi adaugata! Te rugam sa incerci din nou.'); } } $smarty->display(END_PATH.'add_promo.tpl'); ?>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel