Файл: invites.php
Строк: 43
<?php
include('common.php');
$do = getarg('do');
$id = getarg('id');
if(islogged()){
echo theader($lang['myinvites']);
echo '<div class="list2">' . $lang['myinvites'] . '</div>';
if($do == 'new'){
$query=mysql_query("select count(*) from `invites` where `user`='".getid()."'");
if(intval(mysql_result($query, 0)) <= 5 || checkadmin()){
addinvite(getusername(getid()));
}
}
elseif($do == 'delete'){
$query=mysql_query("select * from `invites` where `id`='$id' and `user`='".getid()."'");
if(mysql_num_rows($query) > 0)
mysql_query("delete from `invites` where `id`='$id'");
}
$count=mysql_query("select count(*) from `invites` where `user`='".getid()."'");
if(intval(mysql_result($count, 0)) <= 5 || checkadmin()){
echo '<div class="list2"><a href="/invites.php?do=new">' . $lang['newinvite'] . '</a></div>';
}
$query=mysql_query("select * from `invites` where `user`='".getid()."'");
if(mysql_num_rows($query) > 0){
while($invite = mysql_fetch_array($query)){
$iid = $invite['id'];
$icode = $invite['code'];
echo '<div class="list2">' . $lang['invitecode'] . ': <b>' . $icode . '</b> <a href="/invites.php?do=delete&id=' . $iid . '">[D]</a></div>';
}
}else{
echo '<div class="list2">' . $lang['noinvitations'] . '</div>';
}
echo '<div class="list2"><a href="/index.php">' . $lang['back'] . '</a></div>';
echo tfooter();
}
exit();
?>