Exemple #1
0
<?php

$title = '';
$text = '';
$titleen = '';
$texten = '';
if (isset($_GET['edit']) and isset($_SESSION['status']) and $_SESSION['status'] >= '2') {
    $id = $_GET['edit'];
    $title = vievList($id);
    $titleen = vievListen($id);
    $text = getText($id);
    $texten = getTexten($id);
    $form = "<form name='' method='POST' action='index.php'>" . $lang['entertitle'] . "<div><input type='text' name='title' value='{$title}'></div>" . $lang['entertext'] . "<input type='hidden' name='language'  value='en'>\n\t<textarea cols=60 rows=8 name='textarea'>{$text}</textarea>\n\t<div><input type='hidden' name='id' value='{$id}'></div>\n\t<div><div align='right'>" . $lang['en'] . "</div>" . $lang['entertitle'] . "<div><input type='text' name='titleen' value='{$titleen}'></div>" . $lang['entertext'] . "<input type='hidden' name='language'  value='en'>\n\t<textarea cols=60 rows=8 name='textareaen'>{$texten}</textarea>\n\t<div><input type='submit' name='update' value='" . $lang['send'] . "'></div>\n\t</form>";
} else {
    $form = "<form name='' method='post' action=''>" . $lang['entertitle'] . "<div><input type='text' name='title' value='{$title}'></div>" . $lang['entertext'] . "<input type='hidden' name='language'  value='ua'>\n<textarea cols=60 rows=8 name='textarea'>{$text}</textarea><div><div align='right'>" . $lang['en'] . "</div>" . $lang['entertitle'] . "</div><div><input type='text' name='titleen' value=''></div>" . $lang['entertext'] . "<input type='hidden' name='language'  value='en'>\n<textarea cols=60 rows=8 name='textareaen'></textarea>\n<div><input type='submit' name='add' value='" . $lang['send'] . "'></div>\n</form>";
}
if (isset($_GET['edit']) and getAllRating($_GET['edit'])) {
    echo "<div align='right'><b>" . $lang['rating:'] . " " . substr(getAllRating($_GET['edit']), 0, 4) . " / " . getCountRating($_GET['edit']) . "</b></div>";
    if ($_SESSION['status'] == 3 and !isset($_GET['add'])) {
        echo "<div align='right'><a href=index.php?delrating=" . $_GET['edit'] . ">" . $lang['delete'] . "</a></div>";
    }
} else {
    echo "<div align='right'><b>" . $lang['rating is empty'] . "</b></div>";
}
echo "<div align='right'>" . $lang['ua'] . "</div>";
echo $form;
Exemple #2
0
            echo "<div align='right'><b>" . $lang['rating:'] . " " . substr(getAllRating($_GET['id']), 0, 4) . " / " . getCountRating($_GET['id']) . "</b></div>";
        } else {
            echo "<div align='right'><b>" . $lang['rating is empty'] . "</b></div>";
        }
        echo "<div>" . getText($_GET['id']) . "</div>";
    }
    if ($lang['lang'] == 'en') {
        $title_t = vievListen($_GET['id']);
        //reting en
        echo "<h4>" . $title_t . "</h4>";
        if (getAllRating($_GET['id'])) {
            echo "<div align='right'><b>" . $lang['rating:'] . " " . substr(getAllRating($_GET['id']), 0, 4) . " / " . getCountRating($_GET['id']) . "</b></div>";
        } else {
            echo "<div align='right'><b>" . $lang['rating is empty'] . "</b></div>";
        }
        echo "<div>" . getTexten($_GET['id']) . "</div>";
    }
    if (isset($_SESSION['status']) and $_SESSION['status'] >= '2') {
        echo "<a href='index.php?edit=" . $_GET['id'] . "'>" . $lang['edit page'] . "</a><br>";
        echo "<a href='index.php?del=" . $_GET['id'] . "'>" . $lang['delpage'] . "</a>";
        //comment
    }
    include "comment.php";
}
//edit page
if (isset($_GET['edit']) and isset($_SESSION['status']) and $_SESSION['status'] >= '2') {
    include "add.php";
}
//update profile
if (!empty($_POST['profile'])) {
    profile($_GET['profile'], clearData($_POST['fname']), clearData($_POST['lname']), clearData($_POST['email']));