File size: 1.25Kb
<?
include_once '../sys/inc/thead.php';
title();
$razdel=mysql_fetch_array(mysql_query("SELECT * FROM `otvety_razd` WHERE `id` = '".intval($_GET['rid'])."' LIMIT 1"));
echo "<div class=\"trow\">\n";
echo "<a href=\"iindex.php\">Ответы</a> / $razdel[name]<br />\n";
echo "</div>\n";
aut();
if (isset($_GET['ok'])) msg('Вопрос успешно создан');
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `otvety_t` WHERE `id_razdel` = '".intval($_GET['rid'])."'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q1=mysql_query("SELECT * FROM `otvety_t` WHERE `id_razdel` = '".intval($_GET['rid'])."' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q1)==0) {
echo "Нет вопросов\n<br/>";
}
while ($them = mysql_fetch_array($q1))
{
if($num==1){
$num=0;
}else{
$num=1;}
echo '»<a href="iindex.php?tid='.$them['id'].'&rid='.intval($_GET['rid']).'">'.$them['name'].'</a> ';
echo "(".mysql_result(mysql_query("SELECT COUNT(*) FROM `otvety_p` WHERE `id_them` = '$them[id]'"),0).")<br/>";
}
echo "<img src='/img/lj.gif' alt='' /> ";
echo "<a href='add.php?rid=$_GET[rid]'>Создать вопрос</a> \n";
?>