<!--/***************** DO NOT REMOVE! *********************/---->
<!--/*   Author: Nevezhyn Evgeny  Date : 10/01/2003       */---->
<!--/*   nevius@bk.ru      All Rights Reserved ...        */---->
<!--/*   http://nevius.web.ur.ru/                         */---->
<!--/***************** DO NOT MODIFY! *********************/---->

<?php
if (isset($vote) and ($vote != "")) {@setcookie("treiting",$ID,time()+30000000);}
echo "<html><head>";
include("var.php");
echo "<title>$g : $sitename</title>";
echo "<META HTTP-EQUIV=\"Expires\" Content=\"Mon, 28 Mar 1999 00:00:01 GMT\"><META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"No-Cache\">";
include("top.php");
@$db=mysql_connect($bdhost,$bdlogin,$bdpass);
@mysql_select_db($bdname,$db);
$n = getenv('REQUEST_URI');
if ($QUERY_STRING != "vote")
{//0
if (!isset($g))
{
echo "<center><br><br><b>Выберите раздел:</b><br><br>";
$baze = file("category.dat");
for ($i=0;$i<count($baze);$i++){
echo "<a href=list.php?g=$baze[$i]>$baze[$i]</a><br>";}
}
else
{ //1
$result = @mysql_query("SELECT ID,category,status FROM $textable WHERE category = '$g' and status='ok' order by date DESC");
$totaltexts=@mysql_num_rows($result);
if(!isset($page)) $page = 1;
if( $totaltexts <= $maxThread ) $totalPages = 1;
elseif( $totaltexts % $maxThread == 0 ) $totalPages = $totaltexts / $maxThread;
else $totalPages = ceil( $totaltexts / $maxThread );
if( $totaltexts == 0 ) $threadStart = 0;
else $threadStart = $maxThread * $page - $maxThread + 1;
if( $page == $totalPages ) $threadEnd = $totaltexts;
else $threadEnd = $maxThread * $page;
$initialMsg = $maxThread * $page - $maxThread;
$pages = (int) (($totaltexts + $maxThread - 1) / $maxThread);
$line = "Страница: |";
for ($k = 1; $k <= $pages; $k++) {
  if ($k != $page) {$line .= "<a href=\"$n&page=$k\"> $k </a>|";}
  if ($k == $page) {$line .= " $k |";}
}
if (!isset($link))
{ //3
echo "<h3 align=center>$g</h3>";
if ($totaltexts == 0) {
echo "<center>В данном разделе пока нет анкет!<br><br><a href=# onClick=history.go(-1)>Вернуться назад</a><br><br>";
}
else
{ //2
echo ("
<center><table class=vfbord2 width=90% height=356><tr><td width=100% height=356 valign=top align=center>
<table class=vfbord bgcolor=#330000 width=97%><tr><td width=100%><p align=center>Всего анкет в данном разделе: <b>$totaltexts</b></td></tr></table>
");
$daynow=date("Y-m-d");
$result = @mysql_query("SELECT ID,name,email,city,metro,telephone,othercon,birth,CURRENT_DATE,(YEAR(CURRENT_DATE)-YEAR(birth)) - (RIGHT(CURRENT_DATE,5)<RIGHT(birth,5)) AS age,height,weight,bust,body,edu,hair,eyes,category,tr,appricehour,appricenight,homepricehour,homepricenight,comment,foto1,foto2,foto3,foto4,foto5,aid,date,count,today,status FROM $textable WHERE category = '$g' and status='ok' order by date DESC LIMIT $initialMsg, $maxThread");
while ($myrow=@mysql_fetch_array($result)) 
{ //4
$ID=$myrow["ID"];
$name=$myrow["name"];
$city=$myrow["city"];
$metro=$myrow["metro"];
$telephone=$myrow["telephone"];
$height=$myrow["height"];
$weight=$myrow["weight"];
$bust=$myrow["bust"];
$age=$myrow["age"];
$tr=$myrow["tr"];
$category=$myrow["category"];
$comment=$myrow["comment"];
$appricehour=$myrow["appricehour"];
$appricenight=$myrow["appricenight"];
$homepricehour=$myrow["homepricehour"];
$homepricenight=$myrow["homepricenight"];
$foto1=$myrow["foto1"];
$foto2=$myrow["foto2"];
$foto3=$myrow["foto3"];
$foto4=$myrow["foto4"];
$foto5=$myrow["foto5"];
$count=$myrow["count"];
$today=$myrow["today"];
$status=$myrow["status"];
if ($foto1 != "") {$fotourl=$foto1;}
else {if ($foto2 != "") {$fotourl=$foto2;}
else {if ($foto3 != "") {$fotourl=$foto3;}
else {if ($foto4 != "") {$fotourl=$foto4;}
else {if ($foto5 != "") {$fotourl=$foto5;}
}}}}
if ($metro != "") {$mline="Метро:<br>$metro";}
if ($metro == "") {$mline="";}
if ($appricehour != 0) {$pr1line="<li>Апартаменты:<br>$appricehour$/час<br>$appricenight$/ночь";}
if ($appricehour == 0) {$pr1line="";}
if ($homepricehour != 0) {$pr2line="<li>Выезд:<br>$homepricehour$/час<br>$homepricenight$/ночь";}
if ($homepricehour == 0) {$pr2line="";}
if ($commenttrue == 'TRUE') {$commentline="<a href=comment.php?ID=$ID>Отзывы</a>";}
else {$commentline="";}
if ($today=='0000-00-00' or $today != $daynow)
{
$sql="update $textable SET count='0',today='$daynow' WHERE ID='$ID'";
$res=mysql_query($sql,$db);
}
$rest = @mysql_query("SELECT ID,count,status FROM $textable WHERE status='ok' and ID='$ID'");
while ($myrow=@mysql_fetch_array($rest)) 
{$count=$myrow["count"];}
echo ("
<table width=97% class=vfbord3>
<tr><td width=28% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>$name</td>
<td width=23% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>$category</td>
<td width=23% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>$mline</td>
<td width=26% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>г.$city</td></tr>
<tr><td width=28% valign=middle rowspan=3 class=vfbord><p align=center><img src=$photodir$fotourl border=0 width=150></td>
<td width=23% height=24 valign=middle class=vfbord><p align=center>Информация</td>
<td width=23% height=24 valign=middle class=vfbord><p align=center>Услуги</td>
<td width=26% height=24 valign=middle class=vfbord><p align=center>Условия</td></tr>
<tr><td width=23% valign=top class=vfbord>          
<ul><br><li>Возраст:&nbsp;$age&nbsp;&nbsp;<br><li>Рост:&nbsp;$height<br><li>Вес:&nbsp;$weight<br><li>Бюст:&nbsp;$bust</td>
<td width=23% valign=top class=vfbord align=center>$tr</td>
<td width=26% valign=top class=vfbord><ul><br>
$pr1line
$pr2line
</ul></td></tr>
<tr><td width=72% valign=top colspan=3 class=vfbord><p align=center>$comment<br><br></td></tr>
<tr><td width=28% height=15 valign=top class=vfbord><p align=center>Просмотров сегодня:&nbsp;$count</td>
<td width=23% height=15 valign=top class=vfbord><p align=center><a href=list.php?g=$g&link=$ID>Подробнее &gt;&gt;</a></td>
<td width=23% height=15 valign=top class=vfbord><p align=center>$commentline</td>
<td width=26% height=15 valign=top class=vfbord><p align=center><a href=# OnClick=window.open('vote.php?ID=$ID','PopUp','menubar=no,toolbar=no,scrollbars=no,location=yes,status=no,width=400,height=200')>Голосовать</a></td></tr>
</table><br><br>
");    
} //4
echo "<center><table width=97%><tr><td class=vfbord><p align=center>$line</td></tr></table></td></tr></table><br><br>";
} //2
} //3
if (isset($link)) {
unset($result);
$result = @mysql_query("SELECT ID,today FROM $textable WHERE ID = '$link'");
while ($myrow=mysql_fetch_array($result)) 
{
$today=$myrow["today"];
}
$daynow=date("Y-m-d");
if ($today=='0000-00-00' or $today != $daynow)
{
$sql="update $textable SET count='1',today='$daynow' WHERE ID='$link'";
$result=mysql_query($sql,$db);
}
elseif ($today == $daynow)
{
$sql="update $textable SET count=count+1 WHERE ID='$link'";
$result=mysql_query($sql,$db);
}
unset($result);
$result = @mysql_query("SELECT ID,name,email,city,metro,telephone,othercon,url,birth,CURRENT_DATE,(YEAR(CURRENT_DATE)-YEAR(birth)) - (RIGHT(CURRENT_DATE,5)<RIGHT(birth,5)) AS age,height,weight,bust,body,edu,hair,eyes,category,tr,appricehour,appricenight,homepricehour,homepricenight,comment,foto1,foto2,foto3,foto4,foto5,aid,date,count,reiting,status FROM $textable WHERE ID = $link and status='ok'");
if (@mysql_num_rows($result) == 0) {
echo "<center>Анкета не определена!<br><br><a href=# onClick=history.go(-1)>Вернуться назад</a><br><br>";
}
else
{
while ($myrow=mysql_fetch_array($result)) 
{
$ID=$myrow["ID"];
$name=$myrow["name"];
$email=$myrow["email"];
$city=$myrow["city"];
$metro=$myrow["metro"];
$telephone=$myrow["telephone"];
$othercon=$myrow["othercon"];
$url=$myrow["url"];
$height=$myrow["height"];
$weight=$myrow["weight"];
$bust=$myrow["bust"];
$age=$myrow["age"];
$edu=$myrow["edu"];
$body=$myrow["body"];
$hair=$myrow["hair"];
$eyes=$myrow["eyes"];
$tr=$myrow["tr"];
$category=$myrow["category"];
$comment=$myrow["comment"];
$appricehour=$myrow["appricehour"];
$appricenight=$myrow["appricenight"];
$homepricehour=$myrow["homepricehour"];
$homepricenight=$myrow["homepricenight"];
$foto1=$myrow["foto1"];
$foto2=$myrow["foto2"];
$foto3=$myrow["foto3"];
$foto4=$myrow["foto4"];
$foto5=$myrow["foto5"];
$date=$myrow["date"];
$count=$myrow["count"];
$reiting=$myrow["reiting"];
$status=$myrow["status"];
if ($foto1 != "") {$f1url="<a href=$photodir$foto1 target=_blank><img src=$photodir$foto1 border=0 width=100></a><br><br>";}
if ($foto1 == "") {$f1url="";}
if ($foto2 != "") {$f2url="<a href=$photodir$foto2 target=_blank><img src=$photodir$foto2 border=0 width=100></a><br><br>";}
if ($foto2 == "") {$f2url="";}
if ($foto3 != "") {$f3url="<a href=$photodir$foto3 target=_blank><img src=$photodir$foto3 border=0 width=100></a><br><br>";}
if ($foto3 == "") {$f3url="";}
if ($foto4 != "") {$f4url="<a href=$photodir$foto4 target=_blank><img src=$photodir$foto4 border=0 width=100></a><br><br>";}
if ($foto4 == "") {$f4url="";}
if ($foto5 != "") {$f5url="<a href=$photodir$foto5 target=_blank><img src=$photodir$foto5 border=0 width=100></a>";}
if ($foto5 == "") {$f5url="";}
if ($metro != "") {$mline="<br><li>Метро(район):&nbsp;$metro";}
if ($metro == "") {$mline="";}
if ($othercon != "") {$othline="<br><li>Другие координаты:&nbsp;$othercon";}
if ($othercon == "") {$othline="";}
if ($telephone != "") {$teline="<br><li>Телефон:&nbsp;$telephone";}
if ($telephone == "") {$teline="";}
if ($email != "") {$eline="<br><li>Email:&nbsp;<a href=mailto:$email>$email</a>";}
if ($email == "") {$eline="";}
if ($url != "") {$urline="<br><li>Страничка:&nbsp;<a href=$url target=_blank>$url</a>";}
if ($url == "") {$urline="";}
if ($appricehour != 0) {$pr1line="<li>Апартаменты:&nbsp;$appricehour$/час&nbsp;&nbsp;$appricenight$/ночь";}
if ($appricehour == 0) {$pr1line="";}
if ($homepricehour != 0) {$pr2line="<li>Выезд:&nbsp;$homepricehour$/час&nbsp;&nbsp;$homepricenight$/ночь";}
if ($homepricehour == 0) {$pr2line="";}
if ($commenttrue == 'TRUE') {$commentline="<a href=comment.php?ID=$ID>Отзывы</a>&nbsp;&nbsp;|&nbsp;&nbsp;";}
else {$commentline="";}
$tr=@str_replace("<br>","&nbsp;",$tr);
}
echo ("
<SCRIPT LANGUAGE = 'JavaScript'> <!--
function WindowOpen() {
msg=window.open('sendmail.php?g=$g&link=$ID','PopUp','menubar=no,toolbar=no,scrollbars=no,location=no,status=no,width=600,height=400')
}
//--> </SCRIPT>
<center><table width=80% class=vfbord3>
<tr><td width=100% height=24 valign=middle class=vfbord bgcolor=#330000 colspan=2><p align=center>$name</td></tr>
<tr><td class=vfbord valign=top><p align=center>$f1url$f2url$f3url$f4url$f5url</td>
<td width=100% valign=top class=vfbord>          
<ul><br>
<li>Город:&nbsp;$city$mline$teline$eline$othline$urline<br><br>
<li>Предложение от:&nbsp;$category<br><li>Услуги:&nbsp;$tr&nbsp;<br>$pr1line$pr2line<br><br>
<li>Возраст:&nbsp;$age<br><li>Рост:&nbsp;$height<br><li>Вес:&nbsp;$weight<br><li>Бюст:&nbsp;$bust<br><li>Образование:&nbsp;$edu<br><li>Телосложение:&nbsp;$body<br><li>Цвет волос:&nbsp;$hair<br><li>Цвет глаз:&nbsp;$eyes<br><br>
<li>Просмотров сегодня:&nbsp;$count<li>Рейтинг:&nbsp;$reiting<li>Дата регистрации:&nbsp;$date<br><br>
</td>
</tr>
<tr><td valign=top colspan=2 class=vfbord><p align=center>$comment<br><br></td></tr>
<tr><td colspan=2 height=15 class=vfbord><p align=center>$commentline<a href=# OnClick=WindowOpen()>Послать ссылку другу</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=list.php?g=$g>К списку анкет</a></p></td></tr>
</table><br><br>
");
}
}
}//1
}//0
include("down.php");
?>