Файл: Krimos/invites.php
Строк: 70
<?php
// Криме / Krime
include('common.php');
$do = getarg('do');
$id = getarg('id');
if(!$s_inviteonly)
{
header("Location: index.php");
exit();
}
if(islogged())
{
echo theader($lang['myinvites']);
echo ' <span>' . $lang['myinvites'] . '</span><br />';
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 "rn";
echo ' <span><a href="' . $s_siteurl . '/invites.php?lang=' . $language . '&do=new">' . $lang['newinvite'] . '</a></span><br />';
}
echo '<br />' . "rn";
$query = mysql_query('SELECT * FROM `invites` WHERE `user` = '' . getid() . '';');
if(mysql_num_rows($query) > 0)
{
echo ' <div class="left">' . "rn";
echo ' <div class="invites">' . "rn";
while($invite = mysql_fetch_array($query))
{
$iid = $invite['id'];
$icode = $invite['code'];
echo ' <span>' . $lang['invitecode'] . ': <b>' . $icode . '</b> <a href="' . $s_siteurl . '/invites.php?lang=' . $language . '&do=delete&id=' . $iid . '">[D]</a></span><br />' . "rn";
}
echo ' </div>' . "rn";
echo ' </div>' . "rn";
}
else
{
echo ' <span>' . $lang['noinvitations'] . '</span><br />' . "rn";
}
echo ' <span><a href="' . $s_siteurl . '/index.php?lang=' . $language . '">' . $lang['back'] . '</a></span><br /><br />' . "rn";
echo tfooter();
}
exit();
?>