Exemple #1
0
<?php

require 'cms/cms.php';
require 'cms/config.php';
if (isset($_POST['menu']) && $_SESSION['auth'] === 100) {
    $seter = array($_POST['menu']);
    $sth = $db->prepare('UPDATE menu SET menu=? WHERE id=1');
    $sth->execute($seter);
    $title = 'Меню измененно!';
    echo 'gd';
} else {
    $title = 'Панель администратора!';
}
if (isset($_POST['content']) && isset($_POST['new']) && isset($_POST['name']) && isset($_POST['post']) && $_SESSION['auth'] === 100) {
    $seter = array($_POST['name'], $_POST['content']);
    $sth = $db->prepare('INSERT INTO post VALUES (null, ?, ?, CURRENT_TIMESTAMP)');
    $sth->execute($seter);
    $title = $title . ' Контент изменён';
    echo 'dsafasdf';
} elseif (isset($_POST['content']) && $_SESSION['auth'] === 100) {
    $seter = array($_POST['content'], $_POST['post']);
    $sth = $db->prepare('UPDATE post SET html=? WHERE post=?');
    $sth->execute($seter);
    $title = 'Меню измененно!';
    echo 'dsafaasdfsdf';
}
if ($_SESSION['auth'] === 100) {
    ejser(file_get_contents('views/admpanel.ejs'), $title);
} else {
    echo 'АВТОРИЗУЙСЯ! <a href="login.php">ВХОД</a>';
}
Exemple #2
0
<?php

require 'cms/cms.php';
require 'cms/config.php';
$help = array('1');
$sth = $db->prepare('SELECT * FROM post WHERE post=?');
$sth->execute($help);
$zap = $sth->fetch();
$title = $zap['name'] . '|' . 'СевЗавПром';
$content = $zap['html'];
ejser(file_get_contents('views/content.ejs'), $title, $content);
Exemple #3
0
<?php

require 'cms/cms.php';
require 'cms/config.php';
$sth = $db->prepare('SELECT * from user WHERE id=1');
$sth->execute();
$avtorise = $sth->fetch();
if (isset($_GET['exit'])) {
    if ($_GET['exit'] == 100) {
        $_SESSION['auth'] = 10;
        ejser(file_get_contents('views/login.ejs'), 'Вход');
    }
} elseif (isset($_GET['login']) && isset($_GET['pass'])) {
    if ($_GET['login'] == $avtorise['login'] && $_GET['pass'] == $avtorise['pass']) {
        $_SESSION['auth'] = 100;
        ejser(file_get_contents('views/admpanel.ejs'), 'Панель Администрации');
    } else {
        ejser(file_get_contents('views/errorLogin.ejs'), 'Не правильный логин/пароль');
    }
} elseif ($_SESSION['auth'] == 100) {
    ejser(file_get_contents('views/admpanel.ejs'), 'Панель Администрации');
} else {
    ejser(file_get_contents('views/login.ejs'), 'Вход');
}
Exemple #4
0
<?php

require 'cms/cms.php';
require 'cms/config.php';
if (isset($_GET['page'])) {
} else {
    $zap = '';
    $int = $db->prepare('SELECT COUNT(id) FROM post');
    $int->execute();
    $int = $int->fetch();
    $int = $int['0'] + 1;
    if ($int > 11) {
        $int = 11;
    }
    $i = 1;
    while ($i < $int) {
        $a = array($i, '1');
        $str = contentGet($a);
        $zap = $zap . $str;
        $i++;
    }
}
ejser('<%layout(\'/layout\') %>', 'Главна|Образ', $zap);