<?php
// header info
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
// decode type
print '<?xml version="1.0" encoding="utf-8"?>'.
'<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"'.
' "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
// database file
include "../ini.php";
// if login
$login = autorize();
// Site Title
print '<card title="Fun-ChaT">'.
'<p>';
// when login
if($login) {
print 'Please delete all messages you dont need!<br/>';
@mysql_query("DELETE FROM `".$px.$ltable."` WHERE `time` < ".(time() - 7*24*3600)." and ci='$ci';");
$q_letters_in = @mysql_query("select * from `".$px.$ltable."` where to_user='".$login['login']."' and ci='$ci' and new=1;");
$q_letters_to = @mysql_query("select * from `".$px.$ltable."` where from_user='".$login['login']."' and ci='$ci';");
$num_in = @mysql_num_rows($q_letters_in);
$num_to = @mysql_num_rows($q_letters_to);
print '<a href="inbox.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'">Inbox('.$num_in.'/'.$num_to.')</a><br/>'.
'<a href="draft.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'">Sent('.$num_to.')</a><br/>'.
'<a href="sendform.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'">Compose</a><br/>******';
print "<br/><a href=\"../enter.php?ci=$ci&amp;id=$id&amp;pass=$pass\">Hall</a><br/>";
                } else { print "Sorry Nt Login , Try Again !"; }
print '</p>'.
'</card>'.
'</wml>';
// end of script
@mysql_close();
ob_end_flush();
?>
