session_start(); require("./upweb/class.mysql.php"); require("./upweb/class.action.php"); require("./upweb/config.ini.php"); require("./upweb/function.php"); $mysql->query("SET CHARSET cp1251;"); $query = $mysql->query("SELECT * FROM ".DB_PX."conf WHERE 1;"); while ($row = $mysql->fetch_object($query)) { $conf[$row->name] = $row->description; } $html = ""; $title = ""; $id_main = 0; $login = ""; require("./upweb/login.php"); $mod = $action->parser("charnohtml", "GET", "mod", 20, "title"); //echo $mod; if(is_file("./upweb/mod_".$mod.".php")) { require("./upweb/mod_".$mod.".php"); } else { $html = "error"; } $q=0; $main = ""; $query = $mysql->query("SELECT * FROM ".DB_PX."main WHERE 1 ORDER BY sort_id ASC;"); while ($row = $mysql->fetch_object($query)) { if($loginuser->user_id>0 AND $row->name=="Регистрация") { $row->name = "Панель управления"; } if($id_main==$row->num OR $row->url=="/user_reg.php" AND $mod=="reg") { $q=1; $main.="\"\""; $main.="url."\">".$row->name.""; $main.="\"\""; } else { $main.="\"\""; $main.="url."\">".$row->name.""; $main.="\"\""; } } if($q==0 AND $mod=="title") { $ingsearch="/images/search.gif"; $main = "Новости\"\"".$main; } else { $ingsearch="/images/search2.gif"; $main = "Новости\"\"".$main; } $mark_id = $action->parser("int", "POST", "marka", 11, $action->parser("int", "GET", "marka", 11, 0)); $tow_id = $action->parser("int", "POST", "tow", 16, 0); $city_id = $action->parser("int", "POST", "city", 16, 0); $sql = ""; $query = $mysql->query("SELECT * FROM ".DB_PX."city_of_user WHERE 1 GROUP BY id_city;"); while ($row = $mysql->fetch_object($query)) { $sql.= ", ".$row->id_city." "; } $city = ""; $marklist = ""; $tow = ""; if(isset($_POST['marka']) AND isset($mark)) { $chars = preg_split('/\,/', $marklist.$mark, -1, PREG_SPLIT_NO_EMPTY); while(list($key,$val) = each($chars)) { $ma[$val] = $key; if(!isset($nsql)) { $nsql = "num=\"$val\""; } else { $nsql.= " OR num=\"$val\""; } } $mark = ""; } else { if(isset($marklist2)) { $marklist = $marklist2; } $chars = preg_split('/\,/', $marklist, -1, PREG_SPLIT_NO_EMPTY); while(list($key,$val) = each($chars)) { $ma[$val] = $key; } $mark = ""; } $query = $mysql->query("SELECT * FROM ".DB_PX."vote WHERE 1 ORDER BY num DESC LIMIT 1;"); $rows = $mysql->fetch_object($query); $_SESSION['voteid'] = $rows->num; $otv = ""; $query = $mysql->query("SELECT * FROM ".DB_PX."vote_otvet WHERE id_vote=\"".$rows->num."\";"); while($row = $mysql->fetch_object($query)) { $otv.= "num."\" id=\"vote".$row->num."\">
"; } $vote = <<
$rows->name
$otv
архив опросов

END; $array = array( '{vote}' => $vote, '{mark}' => $mark2, '{sel_tow}' => $tow, '{sel_mark}' => $mark, '{sel_city}' => $city, '{imgsearch}' => $ingsearch, '{login}' => $login, '{main}' => $main, '{title}' => $title." - ".$conf['title'], '{html}' => $html, '{block1}' => file_get_contents("./templates/block1.html"), '{block2}' => file_get_contents("./templates/block2.html"), '{block3}' => file_get_contents("./templates/block3.html"), '{block4}' => file_get_contents("./templates/block4.html"), '{reklama}' => file_get_contents("./templates/reklama.html"), '{count}' => file_get_contents("./templates/count.html"), ); $html = file_get_contents("./templates/plgraph.html"); $html = strtr($html, $array); echo $html; function select_list($mas,$id=false){ $list=''; if(count($mas)!=0){ foreach($mas as $index => $val){ if(!$id){ $list.=''; }else{ if($index==$id){ $list.=''; }else{ $list.=''; } } }} return $list; }