View file super2/outbox.php

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

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

$r = mysql_query('select count(readd) as num from zapiski where (idwho = '.$id.')and(insend = 1)');
$a = mysql_fetch_assoc($r);
$num = $a['num'];
if($num == 0)
{
print $top.'
<card id="error" title="Error" ontimer="chatmail.php?id='.$id.'&amp;ps='.$ps.'&amp;r='.$ref.'">
<timer value="5"/>
<p>
У вас нет отправленных писем!
</p>
</card>
</wml>';
mysql_close();
exit;
}

$s = intval($_GET['s']);
if($s<1)
{$s = 1;}

$mx = round(($num/10)+0.45);
if($s>$mx)
{$s = $mx;}

$ot = (($s-1)*10)+1;
$do = $s*10;
if($do>$num)
{$do = $num;}
$o = $ot-1;
$n = $ot;
if($do == 0)
{$n = $o;}

print $top.'
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="outbox" title="Отправленные">
<p>
<small>
Нажмите на <strong>[X]</strong> рядом с ником для удаления письма.<br/>
Показывает '.$n.'-'.$do.' из '.$num.'<br/>';

$r = mysql_query('Select who,topic,date,klu4,readd,towhom from zapiski WHERE (idwho = '.$id.')and(insend = 1) order by time desc LIMIT '.$o.','.$do);

for($i=$ot; $i<=$do; $i++)
{
$a = mysql_fetch_assoc($r);
$fromw = $a['who'];
$towhom = $a['towhom'];
$topic = $a['topic'];
$date = $a['date'];
$klu4 = $a['klu4'];
$read = $a['readd'];

print '<strong><a href="delmsg.php?id='.$id.'&amp;ps='.$ps.'&amp;im='.$klu4.'&amp;s='.$s.'&amp;insend=1">[Х]</a></strong>';

if($read == 1)
{
print ' | <a href="send.php?id='.$id.'&amp;ps='.$ps.'&amp;im='.$klu4.'&amp;s='.$s.'">'.$towhom.' ('.$topic.')</a> <i>'.$date.'</i><br/>';
}
else
{
print ' | <strong><a href="send.php?id='.$id.'&amp;ps='.$ps.'&amp;im='.$klu4.'&amp;s='.$s.'">'.$towhom.' ('.$topic.')</a></strong> <i>'.$date.'</i><br/>';
}
}

mysql_close();
$next = $s+1;
$prev = $s-1;
if($num>$do)
{
$ot = (($next-1)*10)+1;
$do = $next*10;
if($do>$num)
{$do = $num;}
print '<a href="outbox.php?id='.$id.'&amp;ps='.$ps.'&amp;s='.$next.'&amp;ref='.$ref.'">&gt;&gt;'.$ot.'-'.$do.'&gt;&gt;</a><br/>';
}
if($s>1)
{
$ot = (($prev-1)*10)+1;
$do = $prev*10;
print '<a href="outbox.php?id='.$id.'&amp;ps='.$ps.'&amp;s='.$prev.'&amp;ref='.$ref.'">&lt;&lt;'.$ot.'-'.$do.'&lt;&lt;</a><br/>';
}
print '---<br/>
<a href="chatmail.php?id='.$id.'&amp;ps='.$ps.'&amp;ref='.$ref.'">Ваши письма</a><br/>
<a href="enter.php?id='.$id.'&amp;ps='.$ps.'">Прихожая</a>
</small>
</p>
</card>
</wml>';
?>