Example #1
0
 public function action_list()
 {
     //Подготовка данных
     $articles_all = articles_all();
     $this->title .= '::Просмотр статей';
     $this->content = $this->Template('v/v_editor.php', array('articles_all' => $articles_all));
 }
Example #2
0
    $action = "";
}
if ($action == "add") {
    if (!empty($_POST)) {
        articles_new($link, $_POST['title'], $_POST['date'], $_POST['content']);
        header("Location: index.php");
    }
    include "../views/article_admin.php";
} else {
    if ($action == "edit") {
        if (!isset($_GET['id'])) {
            header("Location: index.php");
        }
        $id = (int) $_GET['id'];
        if (!empty($_POST) && $id > 0) {
            articles_edit($link, $id, $_POST['title'], $_POST['date'], $_POST['content']);
            header("Location: index.php");
        }
        $article = articles_get($link, $id);
        include "../views/article_admin.php";
    } else {
        if ($action == 'delete') {
            $id = $_GET['id'];
            $article = articles_delete($link, $id);
            header("Location: index.php");
        } else {
            $articles = articles_all($link);
            include "../views/articles_admin.php";
        }
    }
}
Example #3
0
function action_list()
{
    global $link;
    $articles = articles_all($link);
    require "../views/articles_admin.php";
}
Example #4
0
<?php

require_once 'startup.php';
require_once 'model.php';
// кодировку
header('Content-type: text/html; charset=utf-8');
//получаем все статьи
$articles = articles_all();
include 'theme/index.php';
Example #5
0
<?php

include 'model.php';
$connect = connect();
include 'header.php';
$articles = articles_all($connect);
include 'footer.php';
Example #6
0
<?php

/* HEADER */
include $_SERVER["DOCUMENT_ROOT"] . "/header.php";
/* MENU */
include $_SERVER["DOCUMENT_ROOT"] . "/menu.php";
?>

<?php 
require_once "models/articles.php";
$articles = articles_all($dbcnx);
$articles_img = articles_img($dbcnx);
$date = date("Y-m-d");
$monthes = array(1 => 'янв', 2 => 'фев', 3 => 'мар', 4 => 'апр', 5 => 'мая', 6 => 'июн', 7 => 'июл', 8 => 'авг', 9 => 'сен', 10 => 'окт', 11 => 'ноя', 12 => 'дек');
echo "<br><br><br>";
//	echo "<table WIDTH='50%' class='lenta_news'>";
echo "<table WIDTH='50%'>";
echo "<tr><center><img width='400px' style='padding-top:11px' src='img/razrabotka.png' title='Сайт в разработке'></center></tr>";
/*	
foreach ($articles as $str):
{
		$newdate=date('j '. $monthes[(date('n'))] .' Y', strtotime($str['date']));
		//$date_in=date("d.m.Y", strtotime($str['date_in']));
		//$date_out=date("d.m.Y", strtotime($str['date_out']));
		
		echo "<tr><td align=left><div class='lenta_title_news'>".$str['title']." | "; 
		
		if ($date < $str['date_in'])
		{
		echo "Акция не началась";
		}
Example #7
0
<?php

/**
 * User: Khupchenko Oleksander
 */
require_once "../content/controllers/models/connect/connect.php";
require_once "models/select_articles.php";
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = "";
}
if ($action == "delete_article") {
    $id = $_GET['id'];
    $article = article_delete($conn, $id);
    header("Location: views/articles_admin.php");
} else {
    $articles = articles_all($conn);
    include "views/articles_admin.php";
}