View file file/letters/index.php

File size: 1.46Kb
<?php

Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);

extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);
extract($HTTP_SESSION_VARS);

session_name('SESID');
session_start();
require("../../mysql.php");
require ('../../config.php'); //Подключаем настройки сайта. (config.php)
require ('../../themes/'.$themes.'.php'); //Вставляем скин сайта.
require ("../../ban.php");
echo "<div>";
echo "<div style='text-align: center'>ПИСЬМА</div>";

if (!empty($_SESSION['login']))
{ 
$newl = mysql_query("select * from `letters` where `user` LIKE '".$_SESSION['login']."' and `type` LIKE 'in' and `read` LIKE 'no';");
$countnew = mysql_num_rows($newl);
if ($countnew>0)
{$newlet="|<span style='color: red'>$countnew</span>";}
$messages = mysql_query("select * from `letters` where user='$_SESSION[login]' and type='in' ;");
$count = mysql_num_rows($messages);
    echo "<a href='letters.php?act=in'>Входящих</a> ($count$newlet)<br/>";
  $messages = mysql_query("select * from `letters` where author='$_SESSION[login]' and type='out' ;");
$count = mysql_num_rows($messages);

    echo "<a href='letters.php?act=out'>Исходящие</a> ($count)<br/>";
    echo "<a href='letters.php?act=write'>Написать</a><br/>";
}
echo "</div>";
require ('../../foot.php'); //Вставляем низ сайта. (templates/foot.php)
?>