<?php define('_MEXEC', 'OK'); require_once "../../system/load.php"; $action = $_REQUEST['action']; switch ($action) { case "viewNews": viewNews(); break; case "addNews": addNews(); break; case "updateNews": updateNews(); break; case "deleteMainCity": deleteMainCity(); break; case "updateMainCityImages": updateMainCityImages(); break; case "deleteNews": deleteNews(); break; case "viewNewsFront": viewNewsFront(); break; } function viewNews() { $news = new News();
<?php require "db.inc.php"; require "lib.inc.php"; $new = $_GET['new']; $view = viewNews($new); if (!is_array($view)) { echo 'Произошла ошипка при выводе новостей'; exit; } if (!$view) { echo 'Новостей нету'; exit; } ?> <h3 class="visitNews"> <?php echo $view['title']; ?> </h3> <h5 align="right" style="color:#009900;">Опубликовано: <?php echo date('d-m-Y H:i:s', $view['date']); ?> </h5> <p align="justify"><?php echo $view['header']; ?> </p> <img width="500px" src="../userImages/<?php echo $view['image']; ?>
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <?php include __DIR__ . '../function/function.php'; viewNews($y, $_GET['id']); ?> </body> </html>