Ejemplo n.º 1
0
<?php

ob_start();
require_once '../connect.php';
require_once '../include/module/admin/conf.class.php';
require_once '../include/module/admin/user.class.php';
require_once '../include/module/admin/poczekalnia.class.php';
//Nazwa strony
$title = 'Poczekalnia';
$conf = new conf();
$conf->query(mysqli_query($db, "SELECT * FROM `conf` WHERE `id`='1'"));
$obj = new poczekalnia($db);
$user = new user($db);
$user->sessionName('login', 'password');
if ($user->verifyLogin()) {
    $ranga = $user->userInfo('ranga');
    if (!$ranga) {
        header("Location: login.php");
    } else {
        if (!empty($_GET['action']) && !empty($_GET['id']) && !empty($_GET['t'])) {
            //USUWANIE OBIEKTU TYPU OBRAZEK
            if ($_GET['action'] == 'delete' && is_numeric($_GET['id']) && $_GET['t'] === $_SESSION['token']) {
                $filename = mysqli_fetch_array(mysqli_query($db, "SELECT * FROM `" . $img_table . "` WHERE id='" . $_GET['id'] . "'"));
                $query_action = mysqli_query($db, "DELETE FROM `" . $img_table . "` WHERE id=" . $_GET['id']) or die(mysql_error());
                if ($query_action) {
                    unlink('../' . $filename['img']);
                    $msg = 'Obrazek został poprawnie usunięty.';
                    header('Location:poczekalnia.php?msg=' . $msg);
                } else {
                    $msg = 'Wystąpił błąd podczas usuwania obrazka.';
                    header('Location:poczekalnia.php?msg=' . $msg);
Ejemplo n.º 2
0
<?php

ob_start();
require_once 'connect.php';
require_once 'include/module/index.class.php';
require_once 'include/module/conf.class.php';
require_once 'include/module/user.class.php';
require_once 'include/module/Content.class.php';
require_once 'include/module/dett.php';
$conf = new conf();
$conf->query(mysqli_query($db, "SELECT * FROM `" . TB_CONF . "` WHERE `id`='1'"));
$user = new user($db);
$user->sessionName('login', 'password');
$obj = new glowna($db);
$theme = $conf->pobierz("theme");
$lang = 'lt';
$contentFileName = 'themes/' . $theme . '/content_' . $lang . '.ini';
$content = new Content($contentFileName, $lang);
if ($user->verifyLogin()) {
    $tentego_glowna = mysqli_num_rows(mysqli_query($db, "SELECT * FROM `{$img_table}` WHERE `is_waiting`='0' AND `author`='" . $user->userInfo('id') . "'"));
    $tentego_poczekalnia = mysqli_num_rows(mysqli_query($db, "SELECT * FROM `{$img_table}` WHERE `is_waiting`='1' AND `author`='" . $user->userInfo('id') . "'"));
    $tentego_last_uploaded = mysqli_fetch_array(mysqli_query($db, "SELECT * FROM `{$img_table}` WHERE `author`='" . $user->userInfo('id') . "' ORDER BY `id` DESC"));
    if (isset($_POST['zmien'])) {
        $info = NULL;
        if (empty($_POST['stare_haslo']) || empty($_POST['nowe_haslo'])) {
            $info = $content->getValue("global", "niewypelniono") . "</span>";
        } else {
            $old_pass = md5($_POST['stare_haslo']);
            if (!mysqli_num_rows(mysqli_query($db, "SELECT * FROM `user` WHERE `login`='" . $user->userInfo('login') . "' and `haslo`='" . $old_pass . "'"))) {
                $info = $content->getValue("profil", "zleHaslo");
            } else {