99999)){$id=1;} $query="SELECT * FROM `text` WHERE id=$id"; $result = mysql_query ($query)or die ("enter user Query failed.".mysql_error()); $row=mysql_fetch_array($result); $name=$row['name']; $img=$row['img']; $text=$row['text']; if ($id==1) { $news1=make_news(3); if (($_REQUEST['o']=='')and($HTTP_COOKIE_VARS['golos']<1)) { $news=show_opros_form(); } else { $w=array ();$p=array ();$max=0;$sum=0; $query="SELECT `id`,`sum` FROM `opros`"; $result = mysql_query ($query)or die ("Query failed.".mysql_error()); while ($row=mysql_fetch_array($result)) { $w[$row['id']]=$row['sum']; $sum+=$row['sum']; if ($max<$row['sum']){$max=$row['sum'];} } foreach ($w as $k=>$v) { $p[$k]=intval($v*100/$sum).'%'; $w[$k]=intval($v/$max*200); } $news=show_opros_result($p,$w); } if ($_POST['opros']!='') { $news=do_opros($_POST['opros']); } echo index($text,$news1.$news); } else { echo show($name,$img,$text); } include_once("inc/end.inc.php"); ?>