www
/
wwwroot
/
magazinmiorita.be
/
admin
➕ New
📤 Upload
✎ Editing:
news.php
← Back
<?php include('../includes/inc.config.php'); include('check_session.php'); $add_news_results = array(); $add_news = $database->execute(" SELECT * FROM `news` "); while($row = $database->fetch($add_news)){ $add_news_results[] = $row; } if(isset($_GET['action']) && $_GET['action'] == 'latest'){ $database->execute("update news set `pub` = '0'"); $update = $database->execute("update news set `pub` = '1' where id = '".$_GET['id']."' "); if($update){ header('Location: news.php?m=pok'); exit; }else{ header('Location: news.php?m=pnok'); exit; } } if(isset($_GET['m']) && $_GET['m'] == 'pok'){ $smarty->assign("type", 'succ'); $smarty->assign("message", 'Articolul a fost actualizat cu succes!'); } if(isset($_GET['m']) && $_GET['m'] == 'pnok'){ $smarty->assign("type", 'err'); $smarty->assign("message", 'Articolul nu poate fi actualizat! Te rugam sa incerci din nou.'); } if(isset($_GET['action']) && $_GET['action'] == 'delete'){ $delete_news = $database->execute("delete from news where id = '".$_GET['id']."'"); if($delete_news){ header('Location: news.php?m=dok'); exit; } } if(isset($_GET['m']) && $_GET['m'] == 'dok'){ $smarty->assign("type", 'succ'); $smarty->assign("message", 'news deleted successfully!'); } if(isset($_GET['m']) && $_GET['m'] == 'ok'){ $smarty->assign("type", 'succ'); $smarty->assign("message", 'news added successfully!'); } $smarty->assign("newsdata", $add_news_results); $smarty->display(END_PATH.'news.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