<?
include_once("req.php");
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
array_walk($_REQUEST,"format_string");
array_walk($_POST,"format_string");
array_walk($_GET,"format_string");
session_start();
include_once("session_class.php");
include_once("persinfo_class.php");
$session = new Sessions;

if ($_GET['login']) {
  $login=mysql_escape_string($_GET['login']);
}else{
  foreach ($_GET as $key =>$value) {
    if (!$value) {$id_person=mysql_escape_string($key);break; }
  }
  #if ($id_person=='101') {$id_person=12;}
}
if (!$id_person && !$login) {
  $error="Неверный запрос.";
}else{
  if ($id_person>100000){
  $res=db_use('array',"select b.id_bot as id_person from bots b where b.id_bot='".$id_person."'");
  }else{
  $res=db_use('array',"select p.id_person from person p
  left join users u on u.id_person=p.id_person
  where ".($id_person?"u.id_person='".$id_person."'":"u.login='".$login."' OR p.persname='".$login."'"));
  }
  if ($res['id_person']) {
    $id_person=$res['id_person'];
  }else{
    $error=($id_person?'Указанный персонаж не найден...':'Персонаж "'.htmlspecialchars($login).'" не найден...');
  }
}

if ($error) {
echo' <html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="ru">
<TITLE>Произошла ошибка</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>
Произошла ошибка: <pre>'.$error.'</pre>
<b><p><a href = "javascript:window.history.go(-1);">Назад</b></a>
<HR>
<p align="right">(c) <a href="/index.htm">АНТИБК Online</a></p>

</body></html>
';die;
}


$myinfo =new Persinfo($id_person);

if(in_array(userip(),array('63.91.58.124','8.72.95.166'))) {
  $palid=12;
}elseif ($session->is_session(session_id())) {
  $palid=$session->id_person;
}

if ($palid) {

  $palinfo=new Persinfo($palid);
  if ($palinfo->id_person==12) {echo $myinfo->id_person;}
  #if ($palinfo->id_clan==24) {$palinfo->align=1.5;}
  $res=db_use('array',"select pal_access from align where align='".$palinfo->align."'");
  $pal_abil=$res['pal_access'];
  if ($palinfo->align<$myinfo->align && (int)$myinfo->align==1 && (int)$palinfo->align==1) {
    unset($pal_abil);$palinfo->align=0;
  }
  if ($palinfo->align==3.99) {$palinfo->align=1.4;}
  if ($palinfo->id_person==58) {$palinfo->align=1.999;}

} else {
  $session->destroy_session(session_id() );
  session_destroy();#echo "!";
}


#echo 'myinfo='.$myinfo->id_person.' life='.$myinfo->life;
$myinfo->anketa_adds();
$harnames=getharnames();$cityname=getcitiesnames();
echo '
<HTML>
<HEAD>
<title>Информация о '.$myinfo->name.'</title>
<link rel=stylesheet type="text/css" href="../i/main.css">
<meta content="text/html; charset=windows-1251" http-equiv=Content-type>
<link href="../i/move/design3.css" rel="stylesheet" type="text/css">
<META Http-Equiv=Cache-Control Content="no-cache, max-age=0, must-revalidate, no-store">
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>

<style type="text/css">
img.pnged {
  behavior: url(/pngbehavior.htc);
}
</style>

<script type="text/javascript" language="javascript" src=\'../i/commoninf.js\'></script>
<script type="text/javascript" language="JavaScript1.3" src=\'../i/js/inf.0.96.js\'></script>
<script>
gift = new Array(\'Подарок от \',\'\',\'Анонимный подарок\');
</script>
</HEAD>
<body style="margin:10px; margin-top:5px;" bgcolor=e2e0e0>
<script>drawDivs();</script>

<table width="100%" border="0" cellpadding="1" cellspacing="2">
  <tr valign="top">
    <td align="center"><SCRIPT>errtrap(\''.$myinfo->name.'\');</SCRIPT><SCRIPT>drwfl("'.$myinfo->name.'",'.$myinfo->id_person.',"'.$myinfo->level.'","'.$myinfo->align.'","'.$myinfo->clanname.'")</SCRIPT></td>
    <td>&nbsp;</td>
  </tr>
  <tr valign="top">
    <td><table border="0" cellspacing="0" cellpadding="1">
        <tr>
          <td align="left" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0" class="posit">

'.($myinfo->blocked?'<tr>
                <td align="center" style="color:#FF0000; font-weight:bold "> Персонаж заблокирован! </td>
              </tr>':'').'
'.($myinfo->id_person==2?'<tr>
                <td align="center" style="color:#0000FF; font-weight:bold "> БОТ ОРДЕНА СВЕТА </td>
              </tr>':'').'
              <tr>
                <td nowrap style="font-size:10px">

        <span id="HP"></span>&nbsp;<img src="../i/misc/bk_life_loose.gif" alt="Уровень жизни" name="HP1" width="1" height="8" id="HP1"><img src="../i/misc/bk_life_loose.gif" alt="Уровень жизни" name="HP2" width="1" height="8" id="HP2"><span style="width:1px; height:10px"></span><img src="../i/herz.gif" width="10" height="9" alt="Уровень жизни"></td>
              </tr>';
echo"              <SCRIPT>top.setHP(".$myinfo->life.",".$myinfo->maxlife().",".($myinfo->id_battle?'0':$myinfo->regeneration).");</SCRIPT>
        <tr>
                <td><table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                    <tr valign=\"top\">
                      <td><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                          <tr>

                            <td >";
showpic1($myinfo,9,3);
echo "</td>

                          </tr>
                          <tr>
                            <td >";
showpic1($myinfo,3,3);
echo "</td>
                          </tr>


                          <tr>
                            <td>";
if ($myinfo->puton[4]) {showpic1($myinfo,4,3);} else {showpic1($myinfo,40,3);}
echo "</td>
                          </tr>

                          <tr>
                            <td >";
showpic1($myinfo,5,3);
echo"</td>
                          </tr>
                        </table></td>
                      <td><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                          <tr>
                            <td align=\"left\" valign=\"top\" width=\"120\" height=\"220\"><div bgcolor=\"black\" style=\"position:relative; z-index: 1; width:120px; height:220px\"><a href=\"/encicl/obraz_".($myinfo->sex?'w':'m')."1.html?l=".$myinfo->shadow."\" target=\"_blank\"><img src=\"../i/chars/".$myinfo->sex."/".$myinfo->shadow."\" alt=\"".$myinfo->name." (Посмотреть образ)\" width=\"120\" height=\"220\" border=\"0\"></a></div></td>
                          </tr>
                          <tr>
                            <td><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                                <tr>
                                  <td>";
showpic1($myinfo,14,3);
echo "</td>
                                  <td>";
showpic1($myinfo,15,3);
echo "</td>
                                  <td>";
showpic1($myinfo,16,3);
echo "</td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                      <td><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                          <tr>
                            <td >";
showpic1($myinfo,1,3);
echo "</td>
                          </tr>
                          <tr>
                            <td >";
showpic1($myinfo,2,3);
echo "</td>
                          </tr>
                          <tr>
                            <td >";
showpic1($myinfo,13,3);
echo"</td>
                          </tr>
                          <tr>
                            <td >";
showpic1($myinfo,11,3);
echo"</td>
                          </tr>
                          <tr>
                            <td><table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                                <tr>";
for ($i=6;$i<=8;$i++) {
echo "<td>";
showpic1($myinfo,$i,3);
echo "</td>";
}unset($i);
echo"</tr>
                              </table></td>
                          </tr>
                          <tr>
                            <td ><SPAN bgcolor=\"black\" style=\"position:relative; z-index: 1; width:60px; height:60px\">";
showpic1($myinfo,10,3);
echo"</SPAN></td>
                          </tr>
                          <tr>
                            <td >";
showpic1($myinfo,12,3);
echo"</td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td align=\"center\" valign=\"top\" style=\"font-weight:bold\">".$myinfo->citycurname."</td>
        </tr>

        <tr>";
$res=db_use('array',"select * from login_stat where id_user=(select id_user from users where id_person='".$myinfo->id_person."') order by login_time desc limit 1");
        echo "
          <td align=\"left\" valign=\"top\"><small>".($myinfo->online?"Персонаж сейчас находится в клубе.
            <div align=\"center\"> <strong>&quot;".$myinfo->roomname."&quot;</strong></div>":"Персонаж не в клубе, но последний раз заходил в него:
".$res['login_time']."");


      echo
      "
            </small></td>
        </tr>

         ".((!$myinfo->id_battle OR $myinfo->invis)?'':'
        <tr>
          <td><small>Персонаж сейчас в <a href="/logs.php?log='.$myinfo->id_battle.'" target="_blank">поединке</a></small></td>
        </tr>')."
        <tr>
          <td align=\"left\" valign=\"top\">";

      echo"</td>
        </tr>
      </table></td>
  ";
  #yyyy-mm-dd
  echo"  <td width=\"100%\" valign=\"top\" align=\"left\" style=\"background-image:url(../i/zodiac/".$myinfo->znak.".gif); background-position:right top; background-repeat:no-repeat; padding-left: 10px;\">
    <table cellspacing=0 cellpadding=0 width=100%><TD valign=top>";
foreach ($myinfo->hars[1] as $key => $value) {
$sum=$myinfo->sumall($key);
$stat=$value;
echo "<SPAN title=''>".$harnames[$key].": ".($stat!=$sum?"<FONT color=#004000>":"")."<B>".($sum)."</B>".($stat!=$sum?"</FONT> <SMALL>(".$stat." + ".($sum-$stat).")</SMALL>":"")."</SPAN><BR>\n";
}
/*echo "<hr align=\"left\" width=\"300\" size=\"1\">
<small>";
echo "МФ крит удара: ".c_kr($myinfo).'<br />';
echo "МФ мощности крит удара: ".$myinfo->sumall('mkr').'<br />';
echo "МФ мощности урона: ".$myinfo->sumall('mur').'<br />';
echo "МФ против крит удара: ".c_prkr($myinfo).'<br />';
echo "МФ уворота: ".c_uv($myinfo).'<br />';
echo "МФ против уворота: ".c_pruv($myinfo).'<br />';
echo "</small>";
*/
echo "<hr align=\"left\" width=\"300\" size=\"1\">
<small>
Уровень: ".$myinfo->level."<BR>
Побед: <A href=\"/topgen.php?n=".$myinfo->name."&".rand(0,2312312)."\" target=\"_blank\">".$myinfo->bwins."</A><BR>
Поражений: ".$myinfo->bloss."<BR>
Ничьих: ".$myinfo->bnich."<BR>";
if ($myinfo->clanname) {
$res=db_use('array',"select * from clans_pers where id_person='".$myinfo->id_person."'");
echo "Клан: <A HREF=\"/encicl/klan/".$myinfo->clanname.".html\" target=_blank>".$myinfo->clanname."</A> - ".($res['rightsmask'][0]?'<font color=336666><b>глава клана</b></font>':$myinfo->clanzvan.'</b></i></u></b></i></u></b></i></u></b></i></u></b></i></u>')."<BR>";
$res=db_use('array',"select * from clans where id_clan='".$myinfo->id_clan."'");
echo "Официальный сайт: <a href=".$res[clan_url].">".$res[clan_url]."</a><br />";
}elseif (ispal($myinfo->align)) {
$res=db_use('array',"select fullname from align where align>=".$myinfo->align." and align<=".$myinfo->align."01");
echo "<B>Паладинский орден:</B> - ".$res['fullname']." ".($myinfo->clanzvan?"<br />
- ".$myinfo->clanzvan.'</b></i></u></b></i></u></b></i></u></b></i></u></b></i></u></b></i></u>':'')."<br />
";
}

$res=db_use('array',"select u.login from users u where u.id_person=(select id_referrer from person where id_person='".$myinfo->id_person."')");
echo "            Место рождения: <strong>".$myinfo->cityborn."</strong><br>
    День&nbsp;рождения персонажа: ".($myinfo->dateborn=='2006'?'Сентябрь 2006':date('d.m.y H:i',$myinfo->dateborn))."<hr align=\"left\" width=\"300\" size=\"1\">".

    (($palinfo->align>1.1 && $palinfo->align<2)?"<BR><small>Дата рождения: ".$myinfo->userbirthday."<BR>Опыт: ".$myinfo->expir."<BR>Деньги: ".$myinfo->money."<BR>E-Mail: ".$myinfo->email.($res['login']?"<br />Реферрер: ".$res['login']:'')."</small><br />
":"");
$res=db_use('array',"select m.".($myinfo->sex<1?'id_wife':'id_husband')." as id,m.timest,u.login as wife,u2.login as husband from person_marry m
left join users u on m.id_wife=u.id_person
left join users u2 on m.id_husband=u2.id_person
where m.".($myinfo->sex<1?'id_husband':'id_wife')."='".$myinfo->id_person."'");
if ($res['id']) {

$r=time()-$res['timest'];
$days=(int)($r/(60*60*24));
$hours=(int)(($r-$days*60*60*24)/(60*60));
$mins=(int)(($r-$days*60*60*24-$hours*60*60)/(60));
$srok="<i>".($days?$days." дн. ":'').$hours." ч. ".($days?'':$mins.' мин.')."</i>";
  echo '<hr align="left" width="300" size="1">
<IMG SRC="../i/i_marry.gif" WIDTH=35 HEIGHT=24 onmouseover=\'fastshow("'.($myinfo->sex>0?'Замужем за':'Женат на').' <B>'.($myinfo->sex?$res['husband']:$res['wife']).'</B> '.$srok.'")\' onmouseout=\'hideshow();\'>
<BR>';
}
if ($palinfo->level>=2 &&($myinfo->align==50 or in_array($myinfo->id_person,$alhimics))) {
  if (!in_array($myinfo->id_person,$alhimicsfull)) {
    $res=db_use('array',"select (select sum(wmz)+sum(wmr)/26.40 from alhim2 where
            id_alh='".$myinfo->id_person."') as sum1,(select sum(kr)/500*0.9 from alhim
            where id_alh='".$myinfo->id_person."' and moneysys>0) as sum2;");
  }
  if ($res['sum1']>$res['sum2']-$balans[$myinfo->id_person] && !in_array($myinfo->id_person,$alhimicsfull)) {
?>
<FIELDSET><LEGEND><IMG SRC="../i/alchemy1.gif" WIDTH=35 HEIGHT=24 ALT="ОлхимегЪ"></LEGEND>
Ответственный за сбор пожертвований на хостинг сайта<? echo ($alhimicsregion[$myinfo->id_person]?' по региону - '.$alhimicsregion[$myinfo->id_person]:'');?>.<br />
</FIELDSET>
<?
  }
}
$hudo=array(37,3796,3384);
if (in_array($myinfo->id_person,$hudo))  {
?>
<FIELDSET><LEGEND><IMG SRC="../i/artduel.gif" ALT="мегоХУДОжнеГ"></LEGEND>
мегоХУДОжнеГ.<br />
</FIELDSET>
<?
}
$bago=array(430,804);
if (in_array($myinfo->id_person,$bago))  {
?>
<FIELDSET><LEGEND><IMG SRC="../i/misc/bag.gif" ALT="Багоискатель"></LEGEND>
Заслуженный багоискатель.<br />
</FIELDSET>
<?
}
if (in_array($myinfo->id_person,$uprclans))  {
?>
<FIELDSET><LEGEND><IMG SRC="../i/misc/lead1.gif" ALT="Управляющий кланов"></LEGEND>
Имеет право переназначать глав кланов и регистрировать новые кланы.<br />
</FIELDSET>
<?
}
if (in_array($myinfo->id_person,$svyas))  {
?>
<FIELDSET><LEGEND><IMG SRC="../i/align1.gif" ALT="Свещенег"></LEGEND>
Священник. Исповедует веру в Ахтунг. Имеет право проводить свадьбы.<br />
</FIELDSET>
<?
}
if (in_array($myinfo->id_person,$shmot))  {
?>
<FIELDSET><LEGEND><IMG SRC="../i/destiny.gif" ALT="Редактор вещей"></LEGEND>
Имеет доступ в панель добавления вещей.<br />
</FIELDSET>
<?
}

    echo"
<hr align=\"left\" width=\"300\" size=\"1\">
".($myinfo->masszat?"<IMG SRC=\"../i/massfun.gif\" WIDTH=35 HEIGHT=24 onmouseover='fastshow(\"Персонаж является массовиком-затейником АНТИБК Онлайн\")' onmouseout='hideshow();'>":'').($myinfo->vip?"<IMG SRC=\"../i/vip2.gif\" WIDTH=35 HEIGHT=26 onmouseover='fastshow(\"<B>VIP Клуб АНТИБК Онлайн ".($palinfo->id_person==12?"(".$myinfo->vip.")":'')."</B>\")' onmouseout='hideshow();' border=0>":'').($myinfo->id_person==784?"<IMG SRC=\"../i/images/subimages/2comission.gif\" WIDTH=48 HEIGHT=36 onmouseover='fastshow(\"<B>Совладелец комиссионного магазина</B>\")' onmouseout='hideshow();' border=0>":'').($myinfo->veteran?"<IMG SRC=\"../i/misc/defender.gif\" WIDTH=35 HEIGHT=26 onmouseover='fastshow(\"<B>Ветеран АНТИБК</B>\")' onmouseout='hideshow();' border=0>":'')."
";
echo "<hr align=\"left\" width=\"300\" size=\"1\">";
  $res=db_use('query',"select p.persname,u.login,p.id_person,p.level,p.id_city,s.session_id,p.clanzvan,p.blocked,p.align,c.clanname,po.id_person as inv
  from friends f left join person p on p.id_person=f.id_friend
  left join users u on p.id_person=u.id_person
  left join clans c on c.id_clan=p.id_clan
  left join sessions s on s.username=u.login
  left join person_on po on po.id_person=p.id_person and po.type=5
  where f.id_person='".$myinfo->id_person."'
  and p.blocked<1
  order by s.session_id desc");
echo "<table border=0>";
unset ($i);while ($i<mysql_num_rows($res)) { # получить массив противников
  $i++;$s=mysql_fetch_array($res);
  $name=($s['persname']?$s['persname']:$s['login']);
  $glava=$s['rightsmask'][0];
  $stext.="<IMG SRC=../i/align".$s['align'].".gif WIDTH=12 HEIGHT=15>".($s['clanname']?'<A HREF="/encicl/klan/'.$s['clanname'].'.html" target=_blank><IMG SRC="../i/klan/'.$s['clanname'].'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>':'').(($s['session_id'] && !$s['inv'])?'<u>':'').$name.(($s['session_id'] && !$s[inv])?'</u>':'')."[".$s['level']."]<a href=/inf.php?".$s['id_person']." target=_blank><IMG SRC=../i/inf.gif WIDTH=12 HEIGHT=11 ALT=\"Информация о персонаже\"></a>".($i<mysql_num_rows($res)?', ':'');
  }
echo "<tr><td>Друзья: (".(0+$i).")</td><td style=\"font-size:8pt\">".$stext."</tr>";
unset($stext);
  $res=db_use('query',"select p.persname,u.login,p.id_person,p.level,p.id_city,s.session_id,p.clanzvan,p.blocked,p.align,c.clanname,po.id_person as inv
   from friends f left join person p on p.id_person=f.id_person
  left join users u on p.id_person=u.id_person
  left join clans c on c.id_clan=p.id_clan
  left join sessions s on s.username=u.login
  left join person_on po on po.id_person=p.id_person and po.type=5
  where f.id_friend='".$myinfo->id_person."'
  and p.blocked<1 order by s.session_id desc");
unset ($i);while ($i<mysql_num_rows($res)) { # получить массив противников
  $i++;$s=mysql_fetch_array($res);
  $name=($s['persname']?$s['persname']:$s['login']);
  $glava=$s['rightsmask'][0];
  $stext.="<IMG SRC=../i/align".$s['align'].".gif WIDTH=12 HEIGHT=15>".($s['clanname']?'<A HREF="/encicl/klan/'.$s['clanname'].'.html" target=_blank><IMG SRC="../i/klan/'.$s['clanname'].'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>':'').(($s['session_id'] && !$s[inv])?'<u>':'').$name.(($s['session_id'] && !$s[inv])?'</u>':'')."[".$s['level']."]<a href=/inf.php?".$s['id_person']." target=_blank><IMG SRC=../i/inf.gif WIDTH=12 HEIGHT=11 ALT=\"Информация о персонаже\"></a>".($i<mysql_num_rows($res)?', ':'');
  }
echo "</tr><tr><td>В друзьях у: (".(0+$i).")</td><td style=\"font-size:8pt\">".$stext."</tr>";
unset($stext);
  $res=db_use('query',"select distinct p.persname,u.login,p.id_person,p.level,p.id_city,s.session_id,p.clanzvan,p.blocked,p.align,c.clanname,po.id_person as inv
  from friends f
  left join person p on p.id_person=f.id_friend
  left join users u on p.id_person=u.id_person
  left join clans c on c.id_clan=p.id_clan
  left join sessions s on s.username=u.login
  left join person_on po on po.id_person=p.id_person and po.type=5
  where f.id_person='".$myinfo->id_person."' and p.blocked<1 and f.id_friend in (select id_person as id_friend from friends where id_friend='".$myinfo->id_person."') order by s.session_id desc");
unset ($i);while ($i<mysql_num_rows($res)) { # получить массив противников
  $i++;$s=mysql_fetch_array($res);
  $name=($s['persname']?$s['persname']:$s['login']);
  $glava=$s['rightsmask'][0];
  $stext.="<IMG SRC=../i/align".$s['align'].".gif WIDTH=12 HEIGHT=15>".($s['clanname']?'<A HREF="/encicl/klan/'.$s['clanname'].'.html" target=_blank><IMG SRC="../i/klan/'.$s['clanname'].'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>':'').(($s['session_id'] && !$s[inv])?'<u>':'').$name.(($s['session_id'] && !$s[inv])?'</u>':'')."[".$s['level']."]<a href=/inf.php?".$s['id_person']." target=_blank><IMG SRC=../i/inf.gif WIDTH=12 HEIGHT=11 ALT=\"Информация о персонаже\"></a>".($i<mysql_num_rows($res)?', ':'');
  }
echo "</tr><tr><td>Взаимные друзья: (".(0+$i).")</td><td style=\"font-size:8pt\">".$stext."</tr></table>";
echo "<hr align=\"left\" width=\"300\" size=\"1\">";
if ($myinfo->travma_time >time()) {
  $r=$myinfo->travma_time-time();
  $days=(int)($r/(60*60*24));
  $hours=(int)(($r-$days*60*60*24)/(60*60));
  $mins=(int)(($r-$days*60*60*24-$hours*60*60)/(60));
  echo "<hr align=\"left\" width=\"300\" size=\"1\"><br /><SPAN title='Ослаблены характеристики'><img src=\"../i/travma2.gif\" width=\"24\" height=\"15\"> У персонажа ".($myinfo->travma_type==1?'легкая травма':'средняя травма')." - <B>".$myinfo->travmtext()."</B> еще ";
  echo ($days?$days." дн. ":'').$hours." ч. ".($days?'':$mins.' мин.');
  echo "</SPAN><br>";
}
if ($palinfo->id_person) {
      $res=db_use('query',"select * from pers_files where id_person='".$myinfo->id_person."' ".(($palinfo->align==1.99 or $palinfo->align==1.91 or $palinfo->align==1.999)?'':'and hidd<1')." order by uptime desc");
      #echo "select * from pers_files where id_person='".$myinfo->id_person."' ".(($myinfo->align==1.99 or $myinfo->align==1.91 or $myinfo->align==1.999)?'':'and hidd<1')." order by uptime desc";
if (mysql_num_rows($res)) {
echo "<a  onclick=\"document.getElementById('files').style.display='';\">Мои файлы</a>";
echo "<hr align=\"left\" width=\"300\" size=\"1\"><span id=files style=\"display:none;\">";
  echo "<table border=0>";
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
      echo '<tr>
        <td valign=top align=left><font class=sysdate>'.date('d.m',$s['uptime']).'</font>
        <td valign=top align=left><small><a href=main.php?download=1&file='.$s['id_file'].'>'.$s['filename'].'</a><br /><font style="background-color:#F3F0D9;">'.htmlspecialchars($s['coment']).'</font></small>
        <td valign=top align=center>('.size($s['size']).')
        '.(($palinfo->align==1.99 or $palinfo->align==1.91 or $palinfo->align==1.999)?'<td valign=top align=center>'.($s['hidd']?'Скрыт':'открыт').'':'').'
        </tr>';
  }
  echo "</table>";
  echo "</span>";
}
}

if ($palinfo->align>1.1 && $palinfo->align<2) {
echo "<a href=inf.php?".$myinfo->id_person."&pals=1>действия</a> | <a href=inf.php?".$myinfo->id_person."&inv=1>инвентарь</a> | <a href=inf.php?".$myinfo->id_person."&mob=1>номера мобильников</a> | <a href=inf.php?".$myinfo->id_person."&transfer=1>переводы</a> <br><br />
".($pal_abil[15]?"<a href=inf.php?".$myinfo->id_person."&ips=1>Статистика входов с тех же IP</a> <br /><b>
<font color=red>ВНИМАНИЕ!</font> ПОЛЬЗОВАТЬСЯ В СЛУЧАЕ КРАЙНЕЙ НЕОБХОДИМОСТИ, НАЖИМАТЬ 1 РАЗ !!! <br /> (результат <font color=red>от 1 до 5 минут</font>) </b><br />
<br />":'');
if($_REQUEST['mob'] && $myinfo->id_person!=12) {
  echo "Мобильники:<br />";
  $res=db_use('query',"select s_phone,count(s_phone) as co from ref_coin where id_person='".$myinfo->id_person."' and s_phone>0 group by s_phone order by co desc");
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo '<B>+'.$s['s_phone'],' ['.$s['co'].']<br /></b>';
  }
}
if ($_REQUEST['transfer']) {
if ($_REQUEST['skip_trn']<0) {$_REQUEST['skip_trn']=0;}
  $res=db_use('query',"select ks.*,ths.id_thing2,th.name,th.gos_price,th.ekr,p.persname,u.login,u.id_user,p1.persname as persname2,u1.id_user as id_user2,u1.login as login2 from komok_sells ks
  left join thing_history ths on ths.id_thing=ks.id_thing
  left join thing_har th on th.id_thing2=ths.id_thing2
  left join person p on p.id_person=ks.id_person
  left join users u on u.id_person=ks.id_person
  left join person p1 on p1.id_person=ks.id_owner
  left join users u1 on u1.id_person=ks.id_owner
  where ks.id_owner='".$myinfo->id_person."' or ks.id_person='".$myinfo->id_person."' order by ks.time desc limit ".strval($_REQUEST['skip_trn']+0).",100");
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo date('d.m.y H:i:s',mktime(substr($s['time'],11,2),substr($s['time'],14,2),substr($s['time'],17,2),substr($s['time'],5,2),substr($s['time'],8,2),substr($s['time'],0,4)));
    $realprice=($s['ekr']>$s['gos_price']?$s['ekr']:$s['gos_price']);$ip=false;
    if ($s['cost']>$realprice) {$bol=true;} else {$bol=false;}
    if ($s['cost']<$realprice) {$men=true;} else {$men=false;}
    if ($bol or $men) {
      $r=db_use('array',"select 1 as res from login_stat ls where id_user='".$s['id_user']."' and ip_login in (select ip_login from login_stat where id_user='".$s['id_user2']."')");
      if ($r['res']) {$ip=true;} else {$ip=false;}
    }
    if ($myinfo->id_person==$s['id_owner']) {
      echo ': '.($ip?' <font color=#616229>БЫЛИ ВХОДЫ С ОДНОГО IP!!!</font> ':'').($s['oper']==3?'(Передачи)':'').($bol?'<font color=red> За большую цену: ':'').($men?'<font color=green>За меньшую цену: ':'').(($s[oper]==3 && $s[id_thing]<1)?'переведены кр':($s['oper']==3?'Передано':'Продано').' <b>'.$s['name'].' ('.$s['id_thing'].':'.$s['id_thing2'].')</b>').(($s['oper']==2 && $s[id_room]==19)?' через комок в гос магазин':(($s['oper']==2 && $s[id_room]!=19)?'сдано в гос':' персонажу '.($s['persname']?$s['persname']:$s['login']).' <a href=inf.php?'.$s['id_person'].'><img src=../i/inf.gif></a>').(($s[oper]==3 && $s[id_thing]<1)?$s['cost'].' кр':' по цене '.$s['cost'].' кр (реальная цена '.$realprice.' кр)').($bol?' </font>':'')).($men?' </font>':'');
    }else{
      echo ': '.($ip?' <font color=#616229>БЫЛИ ВХОДЫ С ОДНОГО IP!!!</font> ':'').($s['oper']==3?'(Передачи)':'').($bol?'<font color=red> За большую цену: ':'').($men?'<font color=green>За меньшую цену: ':'').(($s[oper]==3 && $s[id_thing]<1)?'получены кр':($s['oper']==3?'Получено':'Куплено').' <b>'.$s['name'].' ('.$s['id_thing'].':'.$s['id_thing2'].')</b>').($s['oper']==2?' через комок осааазин':' у персонажа '.($s['persname2']?$s['persname2']:$s['login2']).' <a href=inf.php?'.$s['id_owner'].'><img src=../i/inf.gif></a>').(($s[oper]==3 && $s[id_thing]<1)?$s['cost'].' кр':' по цене '.$s['cost'].' кр (реальная цена '.$realprice.' кр)').($bol?' </font>':'').($men?' </font>':'');
    }
    echo ' ';echo" <BR>";
  }
  echo ($_REQUEST['skip_trn']>=100?"<a href=inf.php?".$myinfo->id_person."&transfer=1&skip_trn=".($_REQUEST['skip_trn']-100)."><<назад</a>":'')." <a href=inf.php?".$myinfo->id_person."&transfer=1&skip_trn=".($_REQUEST['skip_trn']+100).">вперед>></a>";
}
if ($_REQUEST['pals']) {
if ($_REQUEST['skip_pals']<0) {$_REQUEST['skip_pals']=0;}
  $res=db_use('query',"select pd.*,p.blocked,p.persname,u.login,p.align as ali,c.clanname,p.level as lev from pals_delo pd left join person p on p.id_person=pd.id_person left join users u on u.id_person=p.id_person left join clans c on p.id_clan=c.id_clan where pd.id_paladin='".$myinfo->id_person."' order by pd.timestamp desc limit ".strval($_REQUEST['skip_pals']+0).",100");
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo '<SCRIPT>drwfl("",-1,"'.$s['level'].'","'.$s['align'].'","")</SCRIPT> '.date('d.m.y H:i:s',mktime(substr($s['timestamp'],11,2),substr($s['timestamp'],14,2),substr($s['timestamp'],17,2),substr($s['timestamp'],5,2),substr($s['timestamp'],8,2),substr($s['timestamp'],0,4)));
    echo ': '.($s['blocked']>0?'<font color=gray>':'').'<SCRIPT>drwfl("'.($s['persname']?$s['persname']:$s['login']).'",'.$s['id_person'].',"'.$s['lev'].'","'.$s['ali'].'","'.$s['clanname'].'")</SCRIPT>'.($s['blocked']>0?'</font>':'').': '.(($s['type']>2 && $s['type']<5)?'<u>Секретно:</u> ':'').($s['type']==5?'<u>Событие:</u> ':(($s['type']==1 OR $s['type']==3)?'<u>Причина блока/хаоса:</u> ':'')).str_replace("\\","&#x5C;",htmlspecialchars($s['message'])).', ';
    echo ' ';
    echo" <BR>";

  }
  echo ($_REQUEST['skip_pals']>=100?"<a href=inf.php?".$myinfo->id_person."&pals=1&skip_pals=".($_REQUEST['skip_pals']-100)."><<назад</a>":'')." <a href=inf.php?".$myinfo->id_person."&pals=1&skip_pals=".($_REQUEST['skip_pals']+100).">вперед>></a>";
}

if ($_REQUEST['ips'] && $pal_abil[15] ) {
if ($_REQUEST['skip_ips']<0) {$_REQUEST['skip_ips']=0;}
$res=db_use('array',"select id_user from users where id_person='".$myinfo->id_person."'");
$id_user=$res['id_user'];
  $res=db_use('query',"select ls.ip_login,ls.badpass,ls.login_time,p.id_person,p.blocked,p.persname,u.login,p.align,c.clanname,p.level
  from login_stat ls
  left join users u on u.id_user=ls.id_user
  left join person p on p.id_person=u.id_person
  left join clans c on p.id_clan=c.id_clan
  where ls.badpass<1 and ls.ip_login in (select distinct ip_login from login_stat where id_user='".$id_user."' and badpass<1) order by ls.login_time desc limit ".strval($_REQUEST['skip_pals']+0).",100");
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo "<B>".$s['login_time'].'</b> '.$s['ip_login'].': '.($s['blocked']>0?'<font color=gray>':'').'<SCRIPT>drwfl("'.($s['persname']?$s['persname']:$s['login']).'",'.$s['id_person'].',"'.$s['level'].'","'.$s['align'].'","'.$s['clanname'].'")</SCRIPT>'.($s['blocked']>0?'</font>':'');
    echo" <BR>";

  }
  echo ($_REQUEST['skip_ips']>=100?"<a href=inf.php?".$myinfo->id_person."&ips=1&skip_ips=".($_REQUEST['skip_ips']-100)."><<назад</a>":'')." <a href=inf.php?".$myinfo->id_person."&ips=1&skip_ips=".($_REQUEST['skip_ips']+100).">вперед>></a>";
}


if ($_REQUEST['inv'] && $palinfo->align>=1.9 && $palinfo->align<2) {
  $res=db_use('query',"select t.id_thing,t.id_thing2,th.name,th.gos_price,t.maxsrok,th.pic,t.srok,th.ekr,th.artefact from thing t left join thing_har th on th.id_thing2=t.id_thing2 where id_thing in (select id_thing from inv where id_person='".$myinfo->id_person."') order by th.name asc;");
  echo '<table border=0>';
  $harnames=getharnames();$cityname=getcitiesnames();
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo "<tr><td>";
    $value=new thinginfo($s['id_thing2']);
    $value->thinginfoall($s['id_thing']);

    echo $s['id_thing'].'('.$s['id_thing2'].') </td></tr><tr>';
  printinfo($value,$myinfo,1,"","",$value->gos_price.' кр.'.($value->ekr?'('.$value->ekr.' кр)':''));

  echo"</TR><tr><td colspan=2><hr></td></tr>";


  }
  echo '</table>';
}

}

echo"
<BR>



  <BR>
</small>
";


  $res=db_use('query',"select th.pic,th.name,t.coment,u.login
  from inv i
  left join thing t on t.id_thing=i.id_thing
  left join thing_har th on th.id_thing2=t.id_thing2
  left join users u on u.id_person=t.isgift
  where i.id_person='".$myinfo->id_person."' and t.isgift>0 and th.type1=4 and th.type2=16 ORDER BY i.`id_person` ASC , i.`id_thing` ASC ");
if (mysql_num_rows($res) ) {
   echo " Подарки:<BR><script>";
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    #echo "DG1('".$s['pic']."',1,'".$s['name']."','".$s['coment']."','".$s['login']."');";
    echo "DG1('".addslashes(htmlspecialchars($s['pic']))."',1,'".addslashes(htmlspecialchars($s['name']))."','".addslashes(htmlspecialchars($s['coment']))."','".addslashes(htmlspecialchars($s['login']))."');";
    #echo "DG3('".$s['pic']."',1,'".$s['name']."','".$s['coment']."','".$s['login']."');";

#echo "DG1('feb23_stat2',1,'Знак -За возвращение-','За победу над Врагом','Бойцовский Клуб');";
  }
echo"</script>";
}

if ($myinfo->blocked or (int)$myinfo->align==2) {
$s=db_use('array',"select pd.message,pd.timestamp,p.unchaos_timestamp,pd.id_paladin,u.login,p2.persname,pd.align,pd.level,c.clanname
from pals_delo pd
left join person p on p.id_person=pd.id_person
left join person p2 on p2.id_person=pd.id_paladin
left join users u on u.id_person=pd.id_paladin
left join clans c on c.id_clan=p2.id_clan
where pd.id_person='".$myinfo->id_person."' and pd.type=1 order by pd.timestamp desc limit 1");
if ($s['message']) {
echo"Сообщение от паладинов
:<BR>
<FONT class=private>".date('d.m.y H:i',mktime(substr($s['timestamp'],11,2),substr($s['timestamp'],14,2),substr($s['timestamp'],17,2),substr($s['timestamp'],6,2),substr($s['timestamp'],8,2),substr($s['timestamp'],0,4)))." ".$s['message']." </FONT> (".'<SCRIPT>drwfl("'.($s['login']?$s['login']:$s['persname']).'",'.$s['id_paladin'].',"'.$s['level'].'","'.$s['align'].'","'.$s['clanname'].'")</SCRIPT>'.")<BR>";
if ((int)$myinfo->align==2 && $s['unchaos_timestamp']) {
$r=$s['unchaos_timestamp']-time();
$days=(int)($r/(60*60*24));
$hours=(int)(($r-$days*60*60*24)/(60*60));
$mins=(int)(($r-$days*60*60*24-$hours*60*60)/(60));
echo ($myinfo->align==2?'Хаос':'Истинный хаос')." еще <i>".($days?$days." дн. ":'').$hours." ч. ".($days?'':$mins.' мин.')."</i><BR>";
}
}
}

echo "<BR>
   </i><BR>
</td>

</table>
</td>
  </tr>
  <tr align=\"left\" valign=\"top\">
    <td colspan=\"2\">
  <hr align=\"left\" size=\"1\">";
  $res=db_use('array',"select id_person,timestamp,timestamp2 from person_on where id_person=".$myinfo->id_person." and type=2");
  if ($res['id_person']) {
    $r=$res['timestamp2']-time();
    if ($r>0) {$obez=true;
$days=(int)($r/(60*60*24));
$hours=(int)(($r-$days*60*60*24)/(60*60));
$mins=(int)(($r-$days*60*60*24-$hours*60*60)/(60));
    }else{
      $obez=false;
      db_use('query',"delete from person_on where id_person='".$myinfo->id_person."' and type=2");
      db_use('query',"insert into pals_delo(id_person,id_paladin,level,align,message,type) values('".$myinfo->id_person."','','','','Снято обезличивание (срок)','5')");
    }
  }else{$obez=false;}
  if (ispal($palinfo->align) && $obez) {$obez2=true;}
if ($obez) {
  echo "<h3>Обезличен. Еще ".($days?$days." дн. ":'').$hours." ч. ".($days?'':$mins.' мин.')." </h3>";
}
if (!$palinfo->id_person && ($myinfo->align==50 or in_array($myinfo->id_person,$alhimics)) ) {$obez=true;echo "<h3>-</h3>";}

if(!$obez OR $obez2){
if (!$obez) { echo "<H3>Анкетные данные</H3>"; }else {echo "<font color=gray>";}
echo"
Имя: ".$myinfo->realname."<BR>
Пол: ".($myinfo->sex?"Женский":"Мужской")."<BR>
Город: ".str_replace("\\","&#x5C;",htmlspecialchars($myinfo->cityreal))."<BR>";
if ($myinfo->icq) {
if ($myinfo->hide_icq OR !ispal($palinfo->align)){
}
if (ispal($palinfo->align) && $myinfo->hide_icq) { echo '<font color=gray>'; }
echo "ICQ: ".$myinfo->icq." <IMG src='http://web.icq.com/whitepages/online?img=9&icq=".$myinfo->icq."' width=55 height=14><BR>";
if (ispal($palinfo->align) && $myinfo->hide_icq) { echo '</font>'; }
}elseif (ispal($palinfo->align)){
echo '<strike>ICQ:</strike><br />';
}

echo "Домашняя страница: <A HREF=\"".str_replace("\\","&#x5C;",htmlspecialchars($myinfo->homepage))."\" target=_blank>".str_replace("\\","&#x5C;",htmlspecialchars($myinfo->homepage))."</A><BR>Девиз: <code>".str_replace("\\","&#x5C;",htmlspecialchars($myinfo->about))."</code><BR>Увлечения / хобби:<BR><code>".str_replace("\\","&#x5C;",nl2br(htmlspecialchars($myinfo->hobby)))."</code><BR>
<BR>
<BR>";
if ($obez2) {echo"</font>";}
}

if (ispal($palinfo->align)) {
if ($_REQUEST['skip_delo']<0) {$_REQUEST['skip_delo']=0;}

  $res=db_use('query',"select pd.*,p.persname,u.login from pals_delo pd left join person p on p.id_person=pd.id_paladin left join users u on u.id_person=p.id_person where ".(($palinfo->align!='1.99' && $palinfo->id_person!=12)?"(pd.type<3 or pd.type>4) and":'')." pd.id_person='".$myinfo->id_person."' order by pd.timestamp desc limit ".strval($_REQUEST['skip_delo']+0).",100");
  unset($i);while ($i<mysql_num_rows($res)) {
    $i++;$s=mysql_fetch_array($res);
    echo date('d.m.y H:i:s',mktime(substr($s['timestamp'],11,2),substr($s['timestamp'],14,2),substr($s['timestamp'],17,2),substr($s['timestamp'],5,2),substr($s['timestamp'],8,2),substr($s['timestamp'],0,4)))." ".(($s['type']>2 && $s['type']<5)?'<u>Секретно:</u> ':'').($s['type']==5?'<u>Событие:</u> ':(($s['type']==1 OR $s['type']==3)?'<u>Причина блока/хаоса:</u> ':'')).' <SCRIPT>drwfl("'.($s['persname']?$s['persname']:$s['login']).'",'.$s['id_paladin'].',"'.$s['level'].'","'.$s['align'].'","")</SCRIPT>: '.str_replace("\\","&#x5C;",htmlspecialchars($s['message']))." <BR>";
  }
  echo ($_REQUEST['skip_delo']>=100?"<a href=inf.php?".$myinfo->id_person."&skip_delo=".($_REQUEST['skip_delo']-100)."><<назад</a>":'')." <a href=inf.php?".$myinfo->id_person."&skip_delo=".($_REQUEST['skip_delo']+100).">вперед>></a>";
}

?><br />
<br />
<!--Rating@Mail.ru COUNTEr--><script language="JavaScript" type="text/javascript"><!--
d=document;var a='';a+=';r='+escape(d.referrer)
js=10//--></script><script language="JavaScript1.1" type="text/javascript"><!--
a+=';j='+navigator.javaEnabled()
js=11//--></script><script language="JavaScript1.2" type="text/javascript"><!--
s=screen;a+=';s='+s.width+'*'+s.height
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth)
js=12//--></script><script language="JavaScript1.3" type="text/javascript"><!--
js=13//--></script><script language="JavaScript" type="text/javascript"><!--
d.write('<a href="http://top.mail.ru/jump?from=1136139"'+
' target=_top><img src="http://d6.c5.b1.a1.top.list.ru/counter'+
'?id=1136139;t=50;js='+js+a+';rand='+Math.random()+
'" alt="Рейтинг@Mail.ru"'+' border=0 height=31 width=88/><\/a>')
if(11<js)d.write('<'+'!-- ')//--></script><noscript><a
target=_top href="http://top.mail.ru/jump?from=1136139"><img
src="http://d6.c5.b1.a1.top.list.ru/counter?js=na;id=1136139;t=50"
border=0 height=31 width=88
alt="Рейтинг@Mail.ru"/></a></noscript><script language="JavaScript" type="text/javascript"><!--
if(11<js)d.write('--'+'>')//--></script><!--/COUNTER-->

</center>
<?
echo"</td>
  </tr>
</table>
</body>
</HTML>";
die;
?>