View file invite.php

File size: 5.01Kb
<?

header("Cache-Control: no-cache");
$ver = empty($ver) || ($ver!='wml' && !file_exists('css/'.$ver.'.css')) ? 'xhtml' : $ver;
if ($ver=="wml") header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");

require("inc.php");
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require("version.php");

if (isset($rm)) $takep2="&amp;rm=$rm&amp;ref=$ref";
else $takep2="&amp;ref=$ref";

$us=$row["user"];
$fr = $row["friends"];

switch($mod) {

default:
$us=$row["user"];


if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"friendslist\" title=\"Ваши друзья\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
if($row["skin"]=="0"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\"/>";}
if($row["skin"]=="1"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css1.css\"/>";}
if($row["skin"]=="2"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css2.css\"/>";}
if($row["skin"]=="3"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css3.css\"/>";}
echo "<title>Ваши друзья</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}

echo $fsize1;
$num = mysql_result(mysql_query ("select count(id) from users where `invite` = '".$id."';"), 0);
echo "<b>Я привел(а):</b><br/>";
echo $divide;

if ($num == 0){
echo "список пуст.<br/>";
}else{
echo $divide; 
if(!isset($s))$s=0;
$mx=round(($num/10)+0.45);
if($s>$mx)$s=$mx;
if($s==0)$s=1;
$ot=(($s-1)*10)+1;
$do=$s*10;
if($do>$num)$do=$num;
$o=$ot-1;
$n=$ot;
if($do==0)$n=$o;
echo "Показывает $n-$do из $num<br/>\n";
echo $divide;
$r = mysql_query ("SELECT id, user FROM users WHERE invite ='".$id."' ORDER BY id DESC LIMIT $o,$do");

for ($i=$ot;$i<=$do;$i++){
$arr = mysql_fetch_array($r);
echo ($i).") <a href=\"info.php?$ses&amp;nk=".$arr['id']."&amp;ref=$ref\">".$arr['user']."</a><br/>"; 
}

                                    
$next=$s+1;
$prev=$s-1;
if ($num>$do) {
$ot=(($next-1)*10)+1;
$do=$next*10;
if($do>$num)$do=$num;
echo $divide;
echo "<a href=\"invite.php?$ses&amp;s=$next&amp;ref=$ref\">&gt;&gt;$ot-$do&gt;&gt;</a><br/>\n";
}
if($s>1) {
$ot=(($prev-1)*10)+1;
$do=$prev*10;
echo "<a href=\"invite.php?$ses&amp;s=$prev&amp;ref=$ref\">&lt;&lt;$ot-$do&lt;&lt;</a><br/>\n";
}
}
echo $divide;
echo "<a href=\"invite.php?$ses&amp;mod=add&amp;nk=$nk&amp;ref=$ref\">Пригласить друга</a><br/>\n";
echo $divide;
echo "<a href =\"cabinet.php?$ses&amp;ref=$ref\">&#8592; Личный кабинет</a><br/>\n";
echo "<a href =\"enter.php?$ses&amp;ref=$ref\">&#8592; Прихожая</a><br/>\n";
echo $fsize2;
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
mysql_close($link);
exit;
break;

case 'add':

if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"add\" title=\"Пригласить друга\">\n";
echo "<p align=\"center\" mode=\"wrap\">\n";
}else{
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
if($row["skin"]=="0"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\"/>";}
if($row["skin"]=="1"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css1.css\"/>";}
if($row["skin"]=="2"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css2.css\"/>";}
if($row["skin"]=="3"){
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css3.css\"/>";}
echo "<title>Пригласить друга</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "Чтобы пригласить своих друзей Вы можете воспользоваться своей персональной ссылкой:<br/>\n";
echo "http://".$_SERVER['HTTP_HOST']."/?inv=$id<br/>\n";
echo "<br/>\n";
echo "Скопировать ссылку:<br/>\n";
echo $fsize2;
echo "<input size=\"25\" value=\"http://".$_SERVER['HTTP_HOST']."/?inv=$id\" /><br/>\n";
echo $fsize1;

echo $divide;
echo "<a href=\"invite.php?$ses$takep2\">Я привел</a><br/>\n";
if (isset($rm)) echo "<a href=\"chat.php?$ses&amp;rm=$rm$takep\">В чат</a>";
echo $fsize2;
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
mysql_close($link);   
exit;

break;
}
?>