View file super2/read.php

File size: 1.85Kb
<?php
// Чат GBodr
// Версия: 1.0
// Автор: Gemorroj

require 'connect.php';
require 'header.php';
require 'result.php';

$im = $_GET['im'];
if(!is_numeric($im))
{
print $top.'
<card id="error" title="Error" ontimer="chatmail.php?id='.$id.'&amp;ps='.$ps.'&amp;ref='.$ref.'">
<timer value="5"/>
<p>
Message was not found
</p>
</card>
</wml>';
mysql_close();
exit;
}

$r = mysql_query('Select who,topic,date,message,idtowhom,readd from zapiski WHERE klu4 = '.$im);
if(mysql_affected_rows() == 0)
{
print $top.'
<card id="error" title="Error" ontimer="chatmail.php?id='.$id.'&amp;ps='.$ps.'&amp;ref='.$ref.'">
<timer value="5"/>
<p>
Message was not found
</p>
</card>
</wml>';
mysql_close();
exit;
}

$a = mysql_fetch_assoc($r);
if($a['idtowhom'] != $id)
{
print $top.'
<card id="error" title="Error" ontimer="chatmail.php?id='.$id.'&amp;ps='.$ps.'&amp;ref='.$ref.'">
<timer value="5"/>
<p>
This message isn\'t for you!
</p>
</card>
</wml>';
mysql_close();
exit;
}


$who = $a['who'];
$topic = $a['topic'];
$date = $a['date'];
$message = $a['message'];
$read = $a['readd'];


if($read == 0)
{
mysql_query('Update zapiski set readd = 1 WHERE klu4 = '.$im);
}
mysql_close();

print $top.'
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="read" title="Письмо">
<p>
<small>
Вам записка от <strong>'.$who.'</strong><br/>
Тема: '.$topic.'<br/>
Дата: '.$date.'<br/>
Сообщение: '.$message.'<br/>
---<br/>
<a href="send.php?id='.$id.'&amp;ps='.$ps.'&amp;who='.$im.'&amp;ref='.$ref.'">Ответить</a><br/>
<a href="delmsg.php?id='.$id.'&amp;ps='.$ps.'&amp;im='.$im.'&amp;ininc=1">Удалить</a><br/>
---<br/>
<a href="inbox.php?id='.$id.'&amp;ps='.$ps.'&amp;ref='.$ref.'">Входящие</a><br/>
---<br/>
<a href="enter.php?id='.$id.'&amp;ps='.$ps.'">Прихожая</a><br/>
</small>
</p></card></wml>';
?>