<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

if (!isset($_GET[id])) {

header("Location: /index.php?".SID);
exit;
	}

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `id` = '$_GET[id]'"),0)==0) {
header("Location: /index.php?".SID);
exit;
	}

$dnev=mysql_fetch_assoc(mysql_query("SELECT * FROM `dnev` WHERE `id` = '$_GET[id]'"));
$dnev_avt=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$dnev[id_user]'"));


$k_kom=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0);
mysql_query("UPDATE `dnev` SET `komm` = '$k_kom' WHERE `id`= '$dnev[id]'");

$all_see=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_looks` WHERE `id_dnev` = '$dnev[id]'"),0);
mysql_query("UPDATE `dnev` SET `looks` = '$all_see' WHERE `id`= '$dnev[id]'");

if ($dnev[read]==1 && $user[level]!=10) {
if ($dnev[read]==1 && $user[id]!=$dnev_avt[id]) {
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$user[id]' AND `frend` = '$dnev_avt[id]'"),0)==0) {
header("Location: /index.php?".SID);
exit;
	}
	}
	}

if ($dnev[read]==2 && $user[level]!=10) {
if ($dnev[read]==2 && $dnev_avt[id]!=$user[id]) {
header("Location: /index.php?".SID);
exit;
	}
	}

if (isset($_GET[foto_add])) {

if ($user[id]==$dnev_avt[id] || $user[level]==10) {}
else {
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}

$set[title]=$dnev[name]."\n|\n Фото";

include_once '../sys/inc/thead.php';
title();
err();


if (isset($_GET[ok])) {

if (isset($_FILES['file1']))
{
if (eregi('\.jpe?g$',$_FILES['file1']['name']) && $imgc=@imagecreatefromjpeg($_FILES['file1']['tmp_name']))
{
if (imagesx($imgc)>128 || imagesy($imgc)>128)
{
$img_x=imagesx($imgc);
$img_y=imagesy($imgc);
if ($img_x==$img_y)
{
$dstW=128; // ширина
$dstH=128; // высота 
}
elseif ($img_x>$img_y)
{
$prop=$img_x/$img_y;
$dstW=128;
$dstH=ceil($dstW/$prop);
}
else
{
$prop=$img_y/$img_x;
$dstH=128;
$dstW=ceil($dstH/$prop);
}

$screen=imagecreatetruecolor($dstW, $dstH);
imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
imagedestroy($imgc);

imagejpeg($screen,H."sys/dnev/$dnev[id]_$user[id]_1.jpg",100);
@chmod(H."sys/dnev/$dnev[id]_$user[id]_1.jpg",0777);
imagedestroy($screen);
}
else
{
copy($_FILES['file1']['tmp_name'], H."sys/dnev/$dnev[id]_$user[id]_1.jpg");
}
}
}

if (isset($_FILES['file2']))
{
if (eregi('\.jpe?g$',$_FILES['file2']['name']) && $imgc=@imagecreatefromjpeg($_FILES['file2']['tmp_name']))
{
if (imagesx($imgc)>128 || imagesy($imgc)>128)
{
$img_x=imagesx($imgc);
$img_y=imagesy($imgc);
if ($img_x==$img_y)
{
$dstW=128; // ширина
$dstH=128; // высота 
}
elseif ($img_x>$img_y)
{
$prop=$img_x/$img_y;
$dstW=128;
$dstH=ceil($dstW/$prop);
}
else
{
$prop=$img_y/$img_x;
$dstH=128;
$dstW=ceil($dstH/$prop);
}

$screen=imagecreatetruecolor($dstW, $dstH);
imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
imagedestroy($imgc);

imagejpeg($screen,H."sys/dnev/$dnev[id]_$user[id]_2.jpg",100);
@chmod(H."sys/dnev/$dnev[id]_$user[id]_2.jpg",0777);
imagedestroy($screen);
}
else
{
copy($_FILES['file2']['tmp_name'], H."sys/dnev/$dnev[id]_$user[id]_2.jpg");
}
}
}

if (isset($_FILES['file3']))
{
if (eregi('\.jpe?g$',$_FILES['file3']['name']) && $imgc=@imagecreatefromjpeg($_FILES['file3']['tmp_name']))
{
if (imagesx($imgc)>128 || imagesy($imgc)>128)
{
$img_x=imagesx($imgc);
$img_y=imagesy($imgc);
if ($img_x==$img_y)
{
$dstW=128; // ширина
$dstH=128; // высота 
}
elseif ($img_x>$img_y)
{
$prop=$img_x/$img_y;
$dstW=128;
$dstH=ceil($dstW/$prop);
}
else
{
$prop=$img_y/$img_x;
$dstH=128;
$dstW=ceil($dstH/$prop);
}

$screen=imagecreatetruecolor($dstW, $dstH);
imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
imagedestroy($imgc);

imagejpeg($screen,H."sys/dnev/$dnev[id]_$user[id]_3.jpg",100);
@chmod(H."sys/dnev/$dnev[id]_$user[id]_3.jpg",0777);
imagedestroy($screen);
}
else
{
copy($_FILES['file3']['tmp_name'], H."sys/dnev/$dnev[id]_$user[id]_3.jpg");
}
}
}

}

if (isset($_GET[del])) {
unlink(H.'/sys/dnev/'.$_GET[del].'.jpg');
	}

include_once '../sys/inc/tfoot.php';
	}

if (isset($_GET[edit])) {

if ($user[id]==$dnev_avt[id] || $user[level]==10) {}
else {
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}

if (isset($_GET[edit]) && isset($_GET[ok])) {

$name=esc(stripcslashes(htmlspecialchars($_POST['name'])));
if (isset($_POST['translit1']) && $_POST['translit1']==1)$name=translit($name);
if (strlen2($name)<3)$err='Слишком короткий статус';
if (strlen2($name)>512)$err='Превышение символов';
$name=mysql_real_escape_string($name);

if (!isset($err)) {

mysql_query("UPDATE `dnev` SET `name` = '$name' WHERE `id`= '$dnev[id]'");
mysql_query("UPDATE `dnev` SET `msg` = '$msg' WHERE `id`= '$dnev[id]'");
mysql_query("UPDATE `dnev` SET `read` = '$_POST[read]' WHERE `id`= '$dnev[id]'");
mysql_query("UPDATE `dnev` SET `write` = '$_POST[write]' WHERE `id`= '$dnev[id]'");

header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
	}

$set[title]=$dnev[name]."\n|\n редактирование";

include_once '../sys/inc/thead.php';
title();
err();


echo "<form method='post' action='?id=$dnev[id]&amp;edit&amp;ok'>";
echo "Ваш текст (3-512 символа):<br />\n";
echo "<input name='name' type='text' maxlength='512' value='$dnev[name]' /><br />\n";

echo "<input value='Изменить' type='submit' /><br />\n";
echo "</form>\n";

echo "<div class='foot'>";
echo "<a href='?id=$dnev[id]'>Назад</a>";
echo "</div>";

include_once '../sys/inc/tfoot.php';
	}

if (isset($_GET[otv])) {


$dnev=mysql_fetch_assoc(mysql_query("SELECT * FROM `dnev` WHERE `id` = '$_GET[id]'"));
$dnev_avt=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$dnev[id_user]'"));

$user_temp=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$_GET[otv]'"));


if (isset($user) && isset($_POST[msg])) {

$msg=$_POST['msg'];
if (isset($_POST['translit']) && $_POST['translit']==1)$msg=translit($msg);
if (strlen2($msg)<4)$err='Короткое сообщение';
if (strlen2($msg)>10000)$err='Длина сообщения превышает предел в 1000 символов';
$msg=mysql_real_escape_string($msg);

if (!isset($err)) {
mysql_query("INSERT INTO `dnev_kom` (`id_dnev`, `id_user`, `msg`, `otv`, `time`) values('$dnev[id]', '$user[id]', '$msg', '$user_temp[id]', '$time')");

if ($user[id]!=$dnev_avt[id]) {
$msg1="В вашем статусе [red][url=/dnev/dnev.php?id=$dnev[id]]$dnev[name][/url][/red] оставили сообщение ";
mysql_query("INSERT INTO `jurnal` (`id_kont`, `msg`, `time`) values('$dnev_avt[id]', '$msg1', '$time')");
	}

if ($user[id]!=$user_temp[id] && $user_temp[id]!=$dnev_avt[id]) {
$msg1="Вам ответили в статусе [url=/dnev/dnev.php?id=$dnev[id]&page=end]$dnev[name][/url]";
mysql_query("INSERT INTO `jurnal` (`id_kont`, `msg`, `time`) values('$user_temp[id]', '$msg1', '$time')");
	}

unset($_POST[msg]);
unset($msg);

header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
	}

$set[title]="Ответ $user_temp[nick]";
//$set[title]=$dnev[name]."\n|\n ответ $user_temp[nick]";

include_once '../sys/inc/thead.php';
title();
err();


if (isset($user) && ($dnev[write]==0 || ($dnev[write]==1 && mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$user[id]' AND `frend` = '$dnev_avt[id]'"),0)!=0 || $dnev_avt[id]==$user[id] || $user[level]==10) || ($dnev[write]==2 && $dnev_avt[id]==$user[id]) || $user[level]==10)) {
echo "<form method='post' name='message' action='?id=$dnev[id]&amp;otv=$user_temp[id]'>\n";

echo "Сообщение (4-1000 символов):<br />\n<textarea name=\"msg\">$_POST[msg]</textarea><br />\n";

echo "<input name='post' value='Ответить' type='submit' /><br />\n";
echo "<div class='foot'>";
echo "<a href=\"/smiles/index.php\">Смайлы</a>";echo "</form>\n";
echo "</div>";
echo "<div class='foot'>";
echo "<a href='?id=$dnev[id]'>Back</a>";
echo "</div>";

include_once '../sys/inc/tfoot.php';
	}
else {
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}

}


if (isset($user) && isset($_POST[msg])) {

$msg=$_POST['msg'];
if (isset($_POST['translit']) && $_POST['translit']==1)$msg=translit($msg);
if (strlen2($msg)<4)$err='Короткое сообщение';
if (strlen2($msg)>10000)$err='Длина сообщения превышает предел в 1000 символов';
$msg=mysql_real_escape_string($msg);

if (!isset($err)) {
mysql_query("INSERT INTO `dnev_kom` (`id_dnev`, `id_user`, `msg`, `time`) values('$dnev[id]', '$user[id]', '$msg', '$time')");

if ($user[id]!=$dnev_avt[id]) {
////
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '$user[id]' AND `lenta_forum` = '1' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$f[frend]' LIMIT 1"));

$msg_obsuzh="Принял участие в обсуждении статуса [url=/dnev/dnev.php?id=$dnev[id]]$dnev[name][/url] у обитателя [b]$dnev_avt[nick][/b]";

mysql_query("INSERT INTO `obsuzh` (`id_user`, `id_kont`, `msg`, `time`) values('$user[id]', '$a[id]', '$msg_obsuzh', '$time')"); 
}
///
$msg1="В вашем статусе [red][url=/dnev/dnev.php?id=$dnev[id]]$dnev[name][/url][/red] появился новый комментарий";
mysql_query("INSERT INTO `jurnal` (`id_kont`, `msg`, `time`) values('$dnev_avt[id]', '$msg1', '$time')");

	}
mysql_query("UPDATE `user` SET `komm_blog` = '".($user['komm_blog']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
unset($_POST[msg]);
unset($msg);

header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
	}

if (isset($_GET[del])) {
if ($user[id]==$dnev_avt[id] || $user[level]==10) {
mysql_query("DELETE FROM `dnev_kom` WHERE `id` = '$_GET[del]' AND `id_dnev` = '$dnev[id]'");
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
else {
header("Location: /".SID);
exit;
	}
	}

if (isset($_GET[del_all_com])) {
if ($user[id]==$dnev_avt[id] || $user[level]==10) {
mysql_query("DELETE FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'");
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
else {
header("Location: /".SID);
exit;
	}
	}

if (isset($_GET[del_full])) {
if ($user[id]==$dnev_avt[id] || $user[level]==10) {
mysql_query("DELETE FROM `dnev` WHERE `id` = '$dnev[id]'");
mysql_query("DELETE FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'");
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
else {
header("Location: /".SID);
exit;
	}
	}

if (isset($_GET[hide])) {
if ($user[id]==$dnev_avt[id] || $user[level]==10) {
mysql_query("UPDATE `dnev_kom` SET `hide` = '$_GET[set]' WHERE `id`= '$_GET[hide]'");
header("Location: dnev.php?id=$dnev[id]".SID);
exit;
	}
else {
header("Location: /".SID);
exit;
	}
	}

if (isset($user) && $user[id]!=$dnev_avt[id]) {

$user_see=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_looks` WHERE `id_dnev` = '$dnev[id]' AND `id_user` = '$user[id]'"),0);

if ($user_see==0) {

mysql_query("INSERT INTO `dnev_looks` (`id_dnev`, `id_user`, `time`) values('$dnev[id]', '$user[id]', '$time')");

	}

if ($user_see!=0) {

mysql_query("UPDATE `dnev_lookss` SET `time` = '$time' WHERE `id_user`= '$user[id]' AND `id_dnev` = '$dnev[id]'");

	}

	}
	
include_once '../sys/inc/thead.php';
title();
err();
if (isset($user) && $user['id']!=$ank['id'] && $user['balls']>=0 && $user['rating']>=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `status_rating` WHERE `id_user` = '$user[id]' AND `id_status` = '$dnev[id]'"), 0)==0)
{
if (isset($_GET['rating']) && $_GET['rating']=='downiiiii'){
mysql_query("UPDATE `dnev` SET `rating` = '".($dnev['rating']-0)."' WHERE `id` = '$dnev[id]' LIMIT 1",$db);
mysql_query("INSERT INTO `status_rating` (`id_user`, `id_status`) values('$user[id]', '$dnev[id]')",$db);
msg ('Ваш отрицательный отзыв принят');$dnev=mysql_fetch_assoc(mysql_query("SELECT * FROM `dnev` WHERE `id` = $dnev[id] LIMIT 1"));}
elseif(isset($_GET['rating']) && $_GET['rating']=='up'){
mysql_query("UPDATE `dnev` SET `rating` = '".($dnev['rating']+1)."' WHERE `id` = '$dnev[id]' LIMIT 1",$db);
mysql_query("INSERT INTO `status_rating` (`id_user`, `id_status`) values('$user[id]', '$dnev[id]')",$db);
$msg1="[url=/info.php?id=$user[id]/][b]$user[nick][/b][/url] считает классным Ваш статус >\n [url=/dnev/dnev.php?id=$dnev[id]][c]$dnev[name][/c][/url]";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$dnev_avt[id]', '$msg1', '$time')");

$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '$user[id]' AND `lenta_foto` = '1' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$f[frend]' LIMIT 1"));

$msg_lenta = "Cчитает классным статус [url=/info.php?id=$dnev_avt[id]]$dnev_avt[nick][/url] \n\n[c][url=/dnev/dnev.php?id=$dnev[id]]$dnev[name][/url][/c]\n";

mysql_query("INSERT INTO `lenta` (`id_user`, `id_kont`, `msg`, `time`) values('$user[id]', '$a[id]', '$msg_lenta', '$time')");
}

msg ('Успешно! Спасибо :)');$dnev=mysql_fetch_assoc(mysql_query("SELECT * FROM `dnev` WHERE `id` = $dnev[id] LIMIT 1"));}
}
echo "<table class='post'>\n";

echo '<tr><td class="gicon">';
avatar3($dnev_avt['id']);
echo '</td><td class="anput">';
echo "".online($dnev_avt['id'])." <a href='/info.php?id=$dnev_avt[id]'><span style=\"color:$dnev_avt[ncolor]\"><b>$dnev_avt[nick]</b></span></a>\n";

$k_kom=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0);
echo "<br/>Комментариев:\n <b>$k_kom</b>";
echo "\n\n";
echo '</td></tr>';

echo "</table>";

echo " <div class='hello'>\n";
echo output_text($dnev[name])." <font color='#ffffff'>".vremja($dnev[time])."</font>\n";
echo "</div>";
##############################################
echo " <div class='statuskomm'>\n";
if (isset($user) && $user['id']!=$ank['id'] && $user['balls']>=0 && $user['rating']>=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `status_rating` WHERE `id_user` = '$user[id]' AND `id_status` = '$dnev[id]'"), 0)==0)
if (isset($user) && $user['id']!=$dnev_avt['id'])echo "<img src='/style/icons/clss.png' alt='' class='icon'/> <a href=\"?id=$dnev[id]&amp;rating=up\" title=\"Поставить класс\"><font color='#8b8a87'><u>Класс!</u></font></a> ";
echo "<font color='#2e302e'>Считают классным: ";
echo "<b>$dnev[rating] чел.</b></font>";
echo "</div>\n";
################################################
if ($user[id]==$dnev_avt[id] || $user[level]==10) {
echo "  <div class='statuskomm'>\n";
echo "<font color='#8b8a87'><u><a href='dnev.php?id=$dnev[id]&amp;edit'><font color='#8b8a87'>Изменить</font></a>|\n";

echo "<a href='dnev.php?id=$dnev[id]&amp;del_all_com'><font color='#8b8a87'>Очистить</font></a>|\n";

echo "<a href='dnev.php?id=$dnev[id]&amp;del_full'><font color='#8b8a87'>Удалить</font></a></u></font>\n";
echo "</div>";

	}


if (isset($user) && ($dnev[write]==0 || ($dnev[write]==1 && mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$user[id]' AND `frend` = '$dnev_avt[id]'"),0)!=0 || $dnev_avt[id]==$user[id] || $user[level]==10) || ($dnev[write]==2 && $dnev_avt[id]==$user[id]) || $user[level]==10)) {
echo "<form method='post' name='message' action='?id=$dnev[id]'>\n";
echo "  <div class='textmes'>\n";

//<a href=\"/smiles/index.php\">Смайлы</a> | <a href='/dnev/dnev.php?id=$dnev[id]&page=end'>В начало</a><br />\n
echo "<textarea name=\"msg\">$_POST[msg]</textarea><br />\n";

echo "<input name='post' value='Добавить комментарий' type='submit' /><br />\n";
echo "</div>";
echo "</form>\n";
	}

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<table class='post'>\n";

$lim=" LIMIT $start, $set[p_str]";
$q=mysql_query("SELECT * FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]' ORDER BY `time` DESC$lim");
if (mysql_num_rows($q)==0) {

echo "  <div class='komm'>\n";
echo "Нет комментариев! Будь первым!<br/>\n";
echo "</div>";
}
$post_k=$start;
while ($post = mysql_fetch_assoc($q))
{



$ank=get_user($post['id_user']);


echo "   <tr>\n";
if($num==1){
echo "  <td class='aut'>\n";
$num=0;
}else{
echo "  <td class='p_tv'>\n";
$num=1;}

$post_k++;
$num_post=$post_k;

if (isset($user) && $them['close']==0)
//echo " $num_post) ";
echo "".online($ank['id'])." <a href='/info.php?id=$ank[id]' title='Анкета $ank[nick]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a>\n";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time'"), 0)!=0)
echo "<font color='red'>[BAN]</font>\n";

//echo "<br/>\n";
if ($post[hide]==1) echo "<font color='red'>[Комментарий скрыт]</font> ";

if ($post[hide]==0 || ($post[hide]==1 && ($user[id]==$dnev_avt[id] || $user[id]==$post[id_user] || $user[level]==10))) {

if ($post[otv]!=0) {

$tmp_user=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[otv]'"));
echo "<font color='#afb0a3'>Ответ <u><span style=\"color:$tmp_user[ncolor]\">$tmp_user[nick]</span></u>:</font>\n";
	}
	echo "<br/>\n";
	echo "<span style=\"color:$ank[mcolor]\">";
echo output_text($post['msg'])."\n";
echo "</span>\n";
	}
echo "<div style='text-align: right;'><font color='#afb0a3'>".vremja($post['time'])."</font>\n";
if (isset($user) && ($dnev[write]==0 || ($dnev[write]==1 && mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$user[id]' AND `frend` = '$dnev_avt[id]'"),0)!=0 || $dnev_avt[id]==$user[id] || $user[level]>=3) || ($dnev[write]==2 && $dnev_avt[id]==$user[id]) || $user[level]>=3)) {
echo "<a href='dnev.php?id=$dnev[id]&amp;otv=$ank[id]'><img src='/style/img/check.gif' alt='' class='icon'/></a>\n";
	}

if ($user[id]==$dnev_avt[id] || $user[level]==10) {
if ($post[hide]==0) echo "<a href='dnev.php?id=$dnev[id]&amp;hide=$post[id]&amp;set=1'><img src='/style/img/017.png' alt='' class='icon'/></a>\n";
if ($post[hide]==1) echo "<a href='dnev.php?id=$dnev[id]&amp;hide=$post[id]&amp;set=0'><img src='/style/img/vz.png' alt='' class='icon'/></a>\n";
	}

if ($user[id]==$dnev_avt[id] || $user[level]==10) {
echo "<a href='dnev.php?id=$dnev[id]&amp;del=$post[id]'><img src='/style/img/delete.gif' alt='' class='icon'/></a></div>\n";
	}

}
echo "</table>\n";

if ($k_page>1)str("?id=$dnev[id]&amp;",$k_page,$page); // Вывод страниц

	echo "<div class='foot'>";
echo "<a href='/dnev/dnev_list.php?id=$dnev_avt[id]'>Все статусы</a> <span style=\"color:$dnev_avt[ncolor]\">$dnev_avt[nick]</span><br/>\n";
echo "</div>";

include_once '../sys/inc/tfoot.php';
?>
