<?php
if ($status<2)
{
$sysmsg='<b>Недостаточно прав для удаления разделов.</b><br/>';
include($rootpath_forum."main.php");
}
$addtopic=$addtopic+0;
if ($addtopic>0)
{
$addtopic=$addtopic+0;
$q=mysql(DBName,"SELECT `l3` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `l1` = '$addtopic'");
$s=mysql_num_rows($q)+0;
$sysmsg='<b>Раздел не существует (уже удален).</b><br/>';
if ($s<1) include($rootpath_forum."main.php");
@mysql(DBName,"DELETE FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `l1` = '$addtopic'");
$sysmsg='<b>Раздел удален.</b><br/>';
include($rootpath_forum."main.php");
}
print cyr2utf('<card id="forum" title="'.$title.'Форум">'.
'<p>');
$q=mysql(DBName,"SELECT `l1` , `text` FROM `".$table."` WHERE `domain` = '$domain' AND `site` = '$site' AND `l2` = 0 AND `l3` = 0 ORDER BY `l1` ASC LIMIT 0, 29");
$s=mysql_num_rows($q);
print cyr2utf('<anchor>Назад<prev/></anchor><br/><br/>'.
'Раздел:<br/>'.
'<select name="pr" title="Удалить" value="1">');
for ($i=0;($i<$s);$i++)
{
$f=mysql_fetch_array($q);
$text=$f['text'];
$l1=$f['l1'];
$q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` = 0");
$countertopic=@mysql_num_rows($q1)+0;
$q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` != 0");
$countermsg=@mysql_num_rows($q1)+0;
print cyr2utf('<option value="'.$l1.'">'.$text.'</option>');
}
print cyr2utf('</select><br/>'.
'<anchor>Удалить'.
'<go href="'.$forum.'?'.$user.'&a=dr" method="post">'.
'<postfield name="at" value="$(pr)"/>'.
'</go>'.
'</anchor><br/>'.
'<anchor>Назад<prev/></anchor>').
$endtext;
exit();
?>