<!--/***************** DO NOT REMOVE! *********************/---->
<!--/*   Author: Nevezhyn Evgeny  Date : 10/01/2003       */---->
<!--/*             All Rights Reserved ...                */---->
<!--/*        Supplied by WTN-WDYL Team `2004             */---->
<!--/***************** DO NOT MODIFY! *********************/---->

<?php
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 (!isset($g))
{
echo "<center><br><br><b>Выберите раздел:</b><br><br>";
echo "<a href=slist.php?g=Салоны>Салоны</a><br>";
echo "<a href=slist.php?g=Сауны>Сауны</a><br>";
}
else
{ //1
$result = @mysql_query("SELECT ID,category,status FROM $saluntable 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%><tr><td width=100% valign=top align=center>
<table class=vfbord bgcolor=#330000 width=97%><tr><td width=100%><p align=center>Всего в данной категории: <b>$totaltexts</b></td></tr></table>
");
$result = @mysql_query("SELECT ID,name,email,city,metro,telephone,othercon,category,tr,comment,foto1,foto2,foto3,foto4,foto5,aid,date,status FROM $saluntable 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"];
$tr=$myrow["tr"];
$category=$myrow["category"];
$comment=$myrow["comment"];
$foto1=$myrow["foto1"];
$foto2=$myrow["foto2"];
$foto3=$myrow["foto3"];
$foto4=$myrow["foto4"];
$foto5=$myrow["foto5"];
$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="Метро:&nbsp;$metro";}
if ($metro == "") {$mline="";}
if ($commenttrue == 'TRUE') {$commentline="<a href=scomment.php?ID=$ID><b>Отзывы</b></a>";}
else {$commentline="";}
echo ("
<table width=97% class=vfbord3>
<tr><td width=28% valign=top class=vfbord bgcolor=#330000><p align=center><b>$name</b></td>
<td width=23% valign=top class=vfbord bgcolor=#330000><p align=center><b>г.$city</b></td>
<td width=23% valign=top class=vfbord bgcolor=#330000><p align=center>$mline</td></tr>
<tr><td width=26% valign=top class=vfbord bgcolor=#330000><p align=center><b>$category</b></td>
<td width=23% valign=middle class=vfbord><p align=center>Услуги:</td>
<td width=26% valign=middle class=vfbord><p align=center>Условия:</td></tr>
<tr><td width=28% valign=middle class=vfbord><p align=center><img src=$photodir$fotourl border=0 width=200></td>
<td width=23% valign=top class=vfbord align=center>$tr</td>
<td width=26% valign=top class=vfbord align=center>$comment</td></tr>
<tr>
<td width=23% height=15 valign=top class=vfbord>&nbsp;</td>
<td width=23% height=15 valign=top class=vfbord><p align=center><a href=slist.php?g=$g&link=$ID><b>Подробнее &gt;&gt;</b></a></td>
<td width=23% height=15 valign=top class=vfbord><p align=center>$commentline</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,name,email,city,metro,telephone,othercon,url,category,tr,comment,foto1,foto2,foto3,foto4,foto5,aid,date,status FROM $saluntable 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"];
$tr=$myrow["tr"];
$category=$myrow["category"];
$comment=$myrow["comment"];
$foto1=$myrow["foto1"];
$foto2=$myrow["foto2"];
$foto3=$myrow["foto3"];
$foto4=$myrow["foto4"];
$foto5=$myrow["foto5"];
$date=$myrow["date"];
$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 ($commenttrue == 'TRUE') {$commentline="<a href=scomment.php?ID=$ID><b>Отзывы</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;";}
else {$commentline="";}
}
echo ("
<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;$category<li>Город:&nbsp;$city$mline$teline$eline$othline$urline<li>Дата регистрации:&nbsp;$date<br><br>
<li>Услуги:&nbsp;$tr<br><br>
<li>Условия:&nbsp;$comment
</td>
</tr>
<tr><td colspan=2 height=15 class=vfbord><p align=center>$commentline<a href=slist.php?g=$g><b>К списку</b></a></p></td></tr>
</table><br><br>
");
}
}
}//1
include("down.php");
?>