File size: 5.31Kb
<?php
include_once "../config.php"; //
include_once "../inc/inc.php";
include_once "../inc/func.php";
include_once "../inc/user.php";
include_once "../inc/gzip.php";
include_once "../inc/online.php";
include_once "../themes/$theme/index.php";
if ($dostup != '1') {
echo "ПАШШШШШШШОЛНАХУЙ";
include_once "../themes/$theme/foot.php";
exit;
} else {
if (!isset($act)) {
if ($kto == 'user') {
echo 'Управление гостевой<br>';
echo'<form action="addbook.php?act=add" method="post">';
echo'Сообщение<br>';
echo'<textarea cols="30" rows="5" name="msg" type="text" value=""></textarea><br><br>';
echo'<input type="submit" value="Добавить">';
echo'</form><hr>';
} else {
echo 'Вы не можете добавлять сообщения<hr>';
}
$vsego = mysql_num_rows(mysql_query("SELECT * FROM " . $pref . "book"));
$pagevsego = $vsego / $kolbook;
$pagevsego = (int)$pagevsego;
$bbb = $vsego - ($pagevsego * $kolbook);
if ($bbb > 0) {
$pagevsego++;
}
$page = (int)$page;
if ($page >= $pagevsego) {
$page = $pagevsego;
}
if ((!isset($page)) || ($page <= 0) || ($page == '')) {
$page = 1;
$start = 0;
} else {
$start = ($page * $kolbook) - $kolbook;
}
$query = "SELECT * FROM " . $pref . "book ORDER BY id DESC LIMIT $start, $kolbook";
$result = mysql_query($query);
// echo $start;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<div class="b"><a href="/setting/anketa.php?id=' . $line['id_user'] . '">' . $line['login'] . '</a> <a href="book.php?act=edit&idmsg=' . $line['id'] . '">[edit]</a>|<a href="book.php?act=del&idmsg=' . $line['id'] . '">[del]</a>[' . $line['data'] . '] [' . $line['vrem'] . ']</div>';
$soob = smile($line[msg]);
echo $soob . '<br>';
// if (strlen($line['otvet'])>=2){echo'<font color="red">Ответ администрации:<br>'.$line['otvet'].'</font><br>';}
echo '[' . $line['ip'] . ' - ' . $line['brow'] . ']<br>';
if (strlen($line['otvet']) >= 2) {
echo'<font color="red"><u>Ответ администрации:</u></font><br><font color="#aa0000">' . $line['otvet'] . '</font><br>';
}
}
echo '<hr>Страницы:<br>';
if ($page == '1') {
echo'<-Назад';
} else {
$ggg = $page-1;
echo '<a href="book.php?page=' . $ggg . '"><-Назад</a>';
}
echo ' [' . $page . ' из ' . $pagevsego . '] ';
if (($page == $pagevsego) || ($pagevsego == 0)) {
echo 'Вперёд-><br>';
} else {
$ggg = $page + 1;
echo '<a href="book.php?page=' . $ggg . '">Вперёд-></a><br>';
}
echo '<form action="book.php" method="get">';
echo '<input name="page" type="text" value=""><input type="submit" value=">>">';
echo '</form>';
echo '<hr>Всего сообщений: ' . $vsego . '<br>';
echo '<a href="delbook.php?act=all">Очистить гостевую</a>';
}
if ($act == 'edit') {
$idmsg = (int)$idmsg;
if ($idmsg == 0) {
echo'ПАШШШШШШШШШШШОЛ НАХХУЙ';
include_once "../themes/$theme/foot.php";
exit;
}
$query = "SELECT * FROM " . $pref . "book WHERE id=" . $idmsg;
$result = mysql_query($query);
$line = mysql_fetch_array($result, MYSQL_ASSOC);
echo'Редактируется сообщение юзера: <font color="red">' . $line['login'] . '</font><hr>';
echo'<form name="" action="editbook.php?idmsg=' . $idmsg . '" method="post">';
echo'Сообщение:<br>';
echo'<textarea cols="30" rows="5" name="soob" type="text" value="">' . $line['msg'] . '</textarea><br>';
// echo'<input name="soob" type="text" value="'.$line['msg'].'"><br>';
echo'Ответ администрации:<br>';
echo'<textarea cols="30" rows="5" name="otv" type="text" value="">' . $line['otvet'] . '</textarea><br><br>';
// echo'<input name="otv" type="text" value="'.$line['otvet'].'"><br><br>';
echo'<input type="submit" value="Сохранить">';
echo'</form>';
}
if ($act == 'del') {
$idmsg = (int)$idmsg;
if ($idmsg == 0) {
echo'ПАШШШШШШШШШШШОЛ НАХХУЙ';
include_once "../themes/$theme/foot.php";
exit;
}
$query = "SELECT * FROM " . $pref . "book WHERE id=" . $idmsg;
$result = mysql_query($query);
$line = mysql_fetch_array($result, MYSQL_ASSOC);
echo'Удалить сообщение юзера <font color="red">' . $line['login'] . '</font>?<hr>';
echo $line['msg'] . '<br>';
echo'[<a href="book.php">НЕТ</a>] [<a href="delbook.php?idmsg=' . $idmsg . '">Да</a>]';
}
echo '<br><a href="index.php">Админка</a>';
}
include_once "../themes/$theme/foot.php";
?>