"SID")); page_open(array("sess" => "SID")); include("std.inc"); include("dt.inc"); include("klm.inc"); include("html.inc"); include("vault.inc"); include("template.inc"); include("template_helper.inc"); // include("reporter.inc"); include("standard.inc"); include("iao-shop.inc"); $sess->register("reporters_url"); page_close(); /* Notwendigen Variablen initialisieren oder aus dem POST/GET-Request ziehen*/ $id=get_var('id', $_REQUEST,"int", 50,"",1); $lang=get_var('lang', $_REQUEST,"char", 2,"de",1); $sort=get_var('sort', $_REQUEST,"char", 10,"titel",1); $skip=get_var('skip', $_REQUEST,"int", 10,"0",1); if($skip<0){$skip=0;} $filter_jahr=get_var('filter_jahr', $_REQUEST,"char", 255,"",1); $filter_autor=get_var('filter_autor', $_REQUEST,"char", 255,"",1); $filter_sorter=get_var('filter_sorter', $_REQUEST,"char", 255,"",1); $allowed_sort=array("titel","nachname1","jahr"); if(in_array($sort,$allowed_sort)){ $sql_sort=$sort; if($sort=="jahr"){$sql_sort.= " DESC";} ${"sort_$sort"} = "selected"; } $dbc = new DB_BU; $dbu = new DB_BU; $this_template_url=$sess->url(""); $SID = str_replace("?SID=","",$this_template_url); $main_subst["#SID#"] = $SID; $main_subst["#post_url#"] = $sess->url("blaettern.php"); /*---------- Template for Data ----------*/ $template = new t_file("template4.html"); $main_subst["#current3#"] = "id=current"; $main_subst["#current_1#"] = ""; $main_subst["#current_2#"] = ""; $main_subst["#current_3#"] = "current1"; $main_subst["#current_4#"] = ""; $main_subst["#bread#"] = "Blättern"; $main_subst["#vignette#"] = ""; //$main_subst["#this#"] = $_SERVER['HTTP_HOST'].$_SERVER[REQUEST_URI]; $stmts = explode("&",$_SERVER['QUERY_STRING']); $i = 0; foreach($stmts as $stmt) { $st = explode("=", $stmt); if ($st[0] != "SID") { $i++; if($i == 1) $params .= "?"; else $params .= "&"; $params .= $st[0]."=".$st[1]; } } $main_subst["#this#"] = $_SERVER['HTTP_HOST'].urlencode($_SERVER['PHP_SELF'].$params); //Daten abfragen $table="publikationen"; $DEF_FIELDS = $dbc->listfields($table); $input_skip=$skip; $limit=10; $SQL_ORDERBY="created DESC"; if($filter_sorter=="Titel"){$SQL_ORDERBY="$table.titel";} if($filter_sorter=="Jahr"){$SQL_ORDERBY="$table.jahr DESC";} if($filter_sorter=="Autor"){$SQL_ORDERBY="$table.nachname1";} $this_template_url=$sess->url("blaettern.php"); ////////////////////////////////////////////////////////////////////////////////////////////// //// Filter aufbauen ////////////////////////////////////////////////////////////////////////////////////////////// $DEF_FIELDS_FILTER=array("vorname1","nachname1","vorname2","nachname2","vorname3","nachname3","vorname4","nachname4","vorname5","nachname5","vorname6","nachname6","vorname7","nachname7","vorname8","nachname8","vorname9","nachname9","vorname10","nachname10","vorname11","nachname11","vorname12","nachname12","jahr"); $dbc->query("SELECT ".implode(",",$DEF_FIELDS_FILTER)." FROM $table"); if($dbc->num_rows()){ while($dbc->next_record()){ reset($DEF_FIELDS_FILTER); while(list($row,$field) = each($DEF_FIELDS_FILTER)){ $$field = clean_html($dbc->f($field)); } for($n=1;$n<=12;$n++){ $this_vorname= clean_html($dbc->f("vorname".$n)); $this_nachname= clean_html($dbc->f("nachname".$n)); if($this_vorname!="" OR $this_nachname!=""){$array_filter_autor[]=iao_clean_autorname($this_nachname).", ".iao_clean_autorname($this_vorname);} } /* if($vorname1!="" OR $nachname1!=""){ $array_filter_autor[]=iao_clean_autorname($nachname1).", ".iao_clean_autorname($vorname1);} if($vorname2!="" OR $nachname2!=""){ $array_filter_autor[]=iao_clean_autorname($nachname2).", ".iao_clean_autorname($vorname2);} if($vorname3!="" OR $nachname3!=""){ $array_filter_autor[]=iao_clean_autorname($nachname3).", ".iao_clean_autorname($vorname3);} if($vorname4!="" OR $nachname4!=""){ $array_filter_autor[]=iao_clean_autorname($nachname4).", ".iao_clean_autorname($vorname4);} if($vorname5!="" OR $nachname5!=""){ $array_filter_autor[]=iao_clean_autorname($nachname5).", ".iao_clean_autorname($vorname5);} */ if($jahr!=""){$array_filter_jahr[]=$jahr;} } if(is_array($array_filter_jahr)){ $array_filter_jahr=array_unique($array_filter_jahr); sort($array_filter_jahr); } if(is_array($array_filter_autor)){ $array_filter_autor=array_unique($array_filter_autor); sort($array_filter_autor); } $array_filter_sorter=array("Titel","Jahr","Autor"); $afilter_vignette="
url("blaettern.php")."\" name=\"filterform\">

Katalog filtern

".iao_filter_pulldown("filter_jahr",$filter_jahr,$array_filter_jahr,"Alle Jahre")."
".iao_filter_pulldown("filter_autor",$filter_autor,$array_filter_autor,"Alle Autoren")."

Katalog sortieren

".iao_filter_pulldown("filter_sorter",$filter_sorter,$array_filter_sorter,"")."
"; $main_subst["#content_spalte#"] = $afilter_vignette; } $SQL_WHERE="WHERE 1"; if($filter_jahr!=0 AND $filter_jahr!="alle"){ $SQL_WHERE.=" AND (jahr='$filter_jahr')"; } if($filter_autor!="" AND $filter_autor!="alle"){ $autor_splitter=explode(",",$filter_autor); $suche_autor=$autor_splitter[0]; $SQL_WHERE.=" AND (nachname1 LIKE '%".trim($suche_autor)."%' OR nachname2 LIKE '%".trim($suche_autor)."%' OR nachname3 LIKE '%".trim($suche_autor)."%' OR nachname4 LIKE '%".trim($suche_autor)."%' OR nachname5 LIKE '%".trim($suche_autor)."%' OR nachname6 LIKE '%".trim($suche_autor)."%' OR nachname7 LIKE '%".trim($suche_autor)."%' OR nachname8 LIKE '%".trim($suche_autor)."%' OR nachname9 LIKE '%".trim($suche_autor)."%' OR nachname10 LIKE '%".trim($suche_autor)."%' OR nachname11 LIKE '%".trim($suche_autor)."%' OR nachname12 LIKE '%".trim($suche_autor)."%' )"; } $parameter="&source=1&filter_autor=".urlencode($filter_autor)."&filter_jahr=".urlencode($filter_jahr)."&filter_sorter=".urlencode($filter_sorter).""; include("back_iao.inc"); $dbc->query("SELECT * FROM $table $SQL_WHERE ORDER BY $SQL_ORDERBY LIMIT $start,$limit"); if($dbc->num_rows()){ while($dbc->next_record()){ include("iao_publikationen_liste.inc.php"); } }else{ $publikationen_liste="Kein passender Eintrag vorhanden! \"\" "; } $content="

Blättern

Stöbern Sie in unserem Katalog oder schränken Sie die angezeigten Publikationen durch die Filter in der linken Spalte ein.

$publikationen_liste
\"\" \"\"
\"\"
"; if($dbc->num_rows()){ $content.="
Seiten: $jump "; } $main_subst["#content#"] = $content; $main_subst["#reporter_list#"] = $reporter_list; $gen = new t_generator($template); $gen -> output_section("main", $main_subst); ?>