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

<html><head>
<?php
include("var.php");
echo "<html><head><title>Администрирование - Удаление салонов/саун: $sitename</title>";
echo "<META HTTP-EQUIV=\"Expires\" Content=\"Mon, 28 Mar 1999 00:00:01 GMT\">";
include("top.php");
$db=@mysql_connect($bdhost,$bdlogin,$bdpass);
@mysql_select_db($bdname,$db);
$err1="Неверный пароль!<br>";
$err2="Не выбрано ни одного салона/сауны!<br>";
$error = "";
if ($QUERY_STRING != "del"){
$n = getenv('REQUEST_URI');
$n = ereg_replace("\?.*$","",$n);
$result = @mysql_query("SELECT ID,status,date FROM $saluntable WHERE status='ok' order by date DESC");
$totalThread = @mysql_num_rows($result);
$mes = $totalThread;
unset($result);
if(!isset($page)) $page = 1;
if( $totalThread <= $maxThread ) $totalPages = 1;
elseif( $totalThread % $maxThread == 0 ) $totalPages = $totalThread / $maxThread;
else $totalPages = ceil( $totalThread / $maxThread );
if( $totalThread == 0 ) $threadStart = 0;
else $threadStart = $maxThread * $page - $maxThread + 1;
if( $page == $totalPages ) $threadEnd = $totalThread;
else $threadEnd = $maxThread * $page;
$initialMsg = $maxThread * $page - $maxThread;
$pages = (int) (($totalThread + $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 |";}
}
echo "<center><p><strong><big>Администрирование - Удаление салоно/саун</strong></big>";
echo "<form name=delreg method=post action=sadminds.php?del>";
$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 status='ok' order by date DESC");
$totaltexts=@mysql_num_rows($result);
if ($totaltexts == 0) {echo "<center><b>Салонов/саун пока нет!</b>";}
else
{ //2
echo "<center>Для удаления салонов/саун пометьте их галочкой и нажмите кнопку \"Удалить\"<br>Всего салонов/саун: <b>$totaltexts</b><br><br>";
while ($myrow=mysql_fetch_array($result)) 
{ //4
$ID=$myrow["ID"];
$name=$myrow["name"];
$city=$myrow["city"];
$metro=$myrow["metro"];
$telephone=$myrow["telephone"];
$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 ($metro != "") {$mline="Метро:<br>$metro";}
if ($metro == "") {$mline="";}
if ($foto1 != "") {$f1url="<a href=$photodir$foto1 target=_blank>Фото1</a><br><br>";}
if ($foto1 == "") {$f1url="";}
if ($foto2 != "") {$f2url="<a href=$photodir$foto2 target=_blank>Фото2</a><br><br>";}
if ($foto2 == "") {$f2url="";}
if ($foto3 != "") {$f3url="<a href=$photodir$foto3 target=_blank>Фото3</a><br><br>";}
if ($foto3 == "") {$f3url="";}
if ($foto4 != "") {$f4url="<a href=$photodir$foto4 target=_blank>Фото4</a><br><br>";}
if ($foto4 == "") {$f4url="";}
if ($foto5 != "") {$f5url="<a href=$photodir$foto5 target=_blank>Фото5</a>";}
if ($foto5 == "") {$f5url="";}
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>г.$city</td>
<td width=23% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>$mline</td></tr>
<tr><td width=26% height=17 valign=top class=vfbord bgcolor=#330000><p align=center>$category</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=28% valign=top rowspan=3 class=vfbord><p align=center>$f1url$f2url$f3url$f4url$f5url</td>
<tr>
<td width=23% valign=top class=vfbord align=center>$tr</td>
<td width=26% valign=top class=vfbord>$comment</td></tr>
<tr><td width=28% height=15 valign=top class=vfbord><p align=left><input type=checkbox name=delmes[] value=$ID>&nbsp;<b><font color=#ff33cc>Отметить</font></b></td>
<td height=15 valign=top colspan=2 class=vfbord><p align=right><a href=slist.php?g=$category&link=$ID>Подробнее &gt;&gt;</a></td></tr>
</table><br><br>
");    
} //4
echo "<center>$line<p>";
echo ("
<center><table>
<tr><td align=right><strong><font color=#FF0000>*</font>Имя:</strong></td>
<td><input type=text name=namenew size=30></td></tr>
<tr><td align=right><strong><font color=#FF0000>*</font>Пароль:</strong></td>
<td><input type=password name=passnew size=30></td></tr>
</table>
<hr width=90% size=1>
<center><input type=submit value='Удалить отмеченные' name=submit></form>
");
}//2
}
if ($QUERY_STRING == "del"){
if (($adminname != $namenew) or ($adminpass != $passnew)) {
	$error .= "$err1";}
if (count($delmes)==0) {
	$error .= "$err2";}
if ($error != ""){
echo "<center><h3>Ошибка</h3><font color=red>$error</font><p><a href=# onClick=history.go(-1)>Вернуться назад</a><p><br><br><br><br><br><br><br><br>";
}
if ($error==""){
unset($result);
for ($i=0;$i<count($delmes);$i++){
$result=@mysql_query("delete from $saluntable WHERE ID=$delmes[$i]");
unset($result);
$result = @mysql_query("SELECT tid FROM $saluncommtable WHERE tid=$delmes[$i]");
if (@mysql_num_rows($result) != 0) {
while($myrow=mysql_fetch_array($result)) {
$result = @mysql_query("delete from $saluncommtable where tid=$delmes[$i]");
}}}
echo "<center><b>Выбранные салоны/сауны удалены!</b><br><a href=sadminds.php>Вернуться</a><p><br><br><br><br>";
}
}
echo "<center><a href=admin.php>На общую страницу администрирования</a><br><br>";
mysql_close($db);
include("down.php");
?>