Просмотр файла includes/main_forum/delrazdel.php

Размер файла: 1.69Kb
<?php
$addtopic=$addtopic+0;
if ($addtopic>0)
	{
	$addtopic=$addtopic+0;
	$q=mysql(DBName,"SELECT `l3` FROM `$table` WHERE `l1` = '$addtopic'");
	$s=mysql_num_rows($q)+0;
	$sysmsg='<b>Раздел не существует (уже удален).</b><br/>';
	if ($s<1) include($rootpath."main.php");

	@mysql(DBName,"DELETE FROM `$table` WHERE `l1` = '$addtopic'");

	$sysmsg='<b>Раздел удален.</b><br/>';
	include($rootpath."main.php");
	}

print '<card id="forum" title="'.$title.'Форум">';
print '<p>';

$q=mysql(DBName,"SELECT `l1` , `text` FROM `".$table."` WHERE 1 AND `l2` = 0 AND `l3` = 0 ORDER BY `l1` ASC LIMIT 0, 29");
$s=mysql_num_rows($q);

print '<anchor>Назад<prev/></anchor><br/><br/>';
print 'Раздел:<br/>';
print '<select name="pr" title="Удалить" value="0">';
print '<option value="0">-Не удалять-</option>';

for ($i=0;($i<$s);$i++)
	{
	$f=mysql_fetch_array($q);
	$text=cyr2utf(str_replace("$","$$",htmlspecialchars(stripslashes($f['text']))));
	$l1=$f['l1'];

#    $q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE 1 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 1 AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` != 0");
#    $countermsg=@mysql_num_rows($q1)+0;

	print '<option value="'.$l1.'">'.$text.'</option>';
	}

print '</select><br/>';

print '<anchor>Удалить';
print '<go href="'.$forum.'/dr" method="post">';
print '<postfield name="at" value="$(pr)"/>';
print '</go>';
print '</anchor><br/>';

print '<anchor>Назад<prev/></anchor>';
print $endtext;
exit();
?>