'0' "; $q .= "order by st_nazwa"; $nr = db_query($q,DB_QUERY); while ($TAB = db_query($nr, DB_FETCHROW)) { $ARG["menu"][$TAB["st_gr_id"]]["strony"][$TAB["st_id"]] = $TAB; } if($ARG["g_page"] == "szukaj") { $ARG["wynik"] = array(); $q = "select st_id,st_nazwa,st_gr_id,gr_nazwa from ".$_GLOBAL["db_pre"]."_strona "; $q .= "left join ".$_GLOBAL["db_pre"]."_grupa on gr_id=st_gr_id "; $q .= "where st_nazwa like '%".$ARG["keyword"]."%' or st_kod like '%".$ARG["keyword"]."%' "; $q .= "group by st_gr_id,st_id "; $q .= "order by st_data_in desc"; $nr = db_query($q,DB_QUERY); $ARG["wynik_poz"] = 0; while ($TAB = db_query($nr, DB_FETCHROW)) { $ARG["wynik"][$TAB["st_gr_id"]]["gr_nazwa"] = $TAB["gr_nazwa"]; $ARG["wynik"][$TAB["st_gr_id"]]["strony"][$TAB["st_id"]] = $TAB["st_nazwa"]; $ARG["wynik_poz"]++; } } } function prezentuj ($ARG) { $PAGE["title"] = ""; if(isset($ARG["g_gr_id"]) and $ARG["g_gr_id"]){ if(isset($ARG["g_gr_id"])) $gr_id = $ARG["g_gr_id"]; else $gr_id = $ARG["p_gr_id"]; $PAGE["action"]= "onload=\"my_zmiana('dir_".$gr_id."','strony_".$gr_id."')\""; } else $PAGE["action"]=""; $PAGE["class"] = ""; $PAGE["js"] = "./phpinc/script.js"; $PAGE["css"] = "./phpinc/style.css"; if($ARG["page"] == "0") $PAGE["index"] = 1; else $PAGE["index"] = 0; poczatek($PAGE); table_op(0,0,0,"h.100% w.100%"); tr(); prn_menu($ARG); td("top"); if(is_array($ARG["komunikat"])){ print("
");print(join("
",$ARG["komunikat"]));print("
"); } switch($ARG["g_page"]) { case "info": $ARG["g_st_id"]=0;prn_strona($ARG); break; case "strona": if($ARG["g_gr_id"]==0)$ARG["g_st_id"]=0;prn_strona($ARG); break; case "szukaj": prn_wynik($ARG); break; case "szukaj_err": break; default: if(file_exists("./parts/plik_".$ARG["g_page"].".htm")) { $fp = fopen("./parts/plik_".$ARG["g_page"].".htm","r"); fpassthru($fp); } } table_cl(); koniec($PAGE); } main(); ?>