$oLangPack=setLangpack("",$defaultlanguage);?>
\n"; echo " ". $oLangPack->translatestring("Angemeldet").": ".user_getname(); echo " | ". $oLangPack->translatestring("Abmelden")."\n"; echo " | ". $oLangPack->translatestring("Kennwort ändern")."\n"; echo " ". $oLangPack->translatestring("Unser momentanes Angebot umfasst %1 Objekte", array("$AnzahlObjInDB")).". ". $oLangPack->translatestring("Stand").": ".Date("d.m.Y")."\n"; } else { $AnzahlObjInDB = $oCon->getvalue("SELECT count(DSN) from $table_dat where member = 0"); echo "
\n"; echo " ". $oLangPack->translatestring("Unser momentanes Angebot umfasst %1 Objekte", array("$AnzahlObjInDB")).". ". $oLangPack->translatestring("Stand").": ".Date("d.m.Y")."\n"; } //--------------------------------------------------------------------------- //---------------- Abfrage und Anzeige auf Objekte ---------------- //--------------------------------------------------------------------------- if( empty($limit) ) //--- beim Ersten Aufruf einer Objektart $limit = 0; ?> if( empty($ansicht) ) //--- welche Suchfelder werden angezeigt $ansicht = 0; //--- standard/kurz $abfrage = "select DSN, MEMBER, KENNUNG, ".$oLangPack->GetColumnName("KURZEXPOSE").", OBJEKTART, EART, ".$oLangPack->GetColumnName("HEADLINE").", KAUFPREIS, MIETE, NUTZFLAECHE, GRUNDSTUECKSFLAECHE, WOHNFLAECHE, LAND_PLZ_ORT, ZIMMER, PROVINT from $table_dat"; //##pib //Funktion für array_walk function AddWhereKlausel($item, $key, $F_OBJEKTART) { global $WhereKlausel; if ($F_OBJEKTART == $item["ID"]) { $WhereKlausel = " ".$item["where"]." and "; } }//End AddWhereKlausel if (!empty($Typ)) { array_walk($EstateTypeParams, "AddWhereKlausel", $Typ); } else { array_walk($EstateTypeParams, "AddWhereKlausel", $F_OBJEKTART); } switch($F_EART) { case "kauf": $WhereKlausel .= " (EART= 0) and "; if (!empty($F_KPREISVON)) { $WhereKlausel .= " (KAUFPREIS >= '".$F_KPREISVON."') and "; } if (!empty($F_KPREISBIS)) { $WhereKlausel .= " (KAUFPREIS <= '".$F_KPREISBIS."') and "; } break; case "miet": $WhereKlausel .= " (EART = 1) and "; if (!empty($F_KPREISVON)) { $WhereKlausel .= " (MIETE >= '".$F_KPREISVON."') and "; } if (!empty($F_KPREISBIS)) { $WhereKlausel .= " (MIETE <= '".$F_KPREISBIS."') and "; } break; default: $WhereKlausel .= "1 = 1 and "; // alle Nutzungsarten if (!empty($F_KPREISVON)) { $WhereKlausel .= " ((KAUFPREIS >= '".$F_KPREISVON."') or "; $WhereKlausel .= " (MIETE >= '".$F_KPREISVON."')) and "; } if (!empty($F_KPREISBIS)) { $WhereKlausel .= " ((KAUFPREIS <= '".$F_KPREISBIS."') or "; $WhereKlausel .= " (MIETE <= '".$F_KPREISBIS."')) and "; } } if (!empty($F_ORT)) $WhereKlausel .= " (LAND_PLZ_ORT like '%".$F_ORT."%') and "; if (!empty($F_PLZ)) $WhereKlausel .= " (LAND_PLZ_ORT like '".$F_PLZ."%') and "; if (!empty($F_LAND)) $WhereKlausel .= "(LAND_PLZ_ORT like '%".$F_LAND."%') and " ; //##pib function AddDetailWhereKlausel($Param, $Param_von, $Param_bis) { global $WhereKlausel, $DetailParams; if (!empty($Param_von) || !empty($Param_bis)) { $fldarten = split(";" , $DetailParams[$Param]["fldart"]); $sqlOr = ""; foreach($fldarten as $fldart) { if(!empty($fldart)) { $sql2 = "("; if (!empty($Param_von)) { if (!empty($Param_bis)) { if(is_numeric($Param_von)==true) { $sql2 .= $fldart. " >= ".$Param_von . " "; } else { if($Param == "F_Param4")//Kennung { $sql2 .= $fldart. " >= '".$Param_von . "' "; }else{ $sql2 .= $fldart. " like '%".$Param_von . "%' "; } } } else { if(is_numeric($Param_von)==true) { $sql2 .= $fldart. " = ".$Param_von . " "; } else { $sql2 .= $fldart. " like '%".$Param_von . "%' "; } } } if (!empty($Param_bis)) { if (!empty($Param_von)) $sql2 .= " and "; $sql2 .= $fldart. " <= '".$Param_bis."'"; } $sql2 .= ") "; $sqlOr .= $sql2 . " or "; } } $sqlOr = substr($sqlOr, 0, strlen($sqlOr) - 3); $WhereKlausel .= "(" . $sqlOr . ") and "; } } //Param1 AddDetailWhereKlausel("F_Param1", $F_Param1_von, $F_Param1_bis); //Param2 AddDetailWhereKlausel("F_Param2", $F_Param2_von, $F_Param2_bis); //Param3 AddDetailWhereKlausel("F_Param3", $F_Param3_von, $F_Param3_bis); //Param4 AddDetailWhereKlausel("F_Param4", $F_Param4_von, $F_Param4_bis); if($F_Param5 == "on") $WhereKlausel .= " " . $DetailParams["F_Param5"]["fldart"] . " " . $DetailParams["F_Param5"]["searchvalue"] . " and "; if($F_Param6 == "on") $WhereKlausel .= " " . $DetailParams["F_Param6"]["fldart"] . " " . $DetailParams["F_Param6"]["searchvalue"] . " and "; if($F_Param7 == "on") $WhereKlausel .= " " . $DetailParams["F_Param7"]["fldart"] . " " . $DetailParams["F_Param7"]["searchvalue"] . " and "; //Angemeldete Benutzer sehen nur Exclusive Objekte if ( user_islogin() ) $WhereKlausel .= " MEMBER = 1 and "; else $WhereKlausel .= " MEMBER = 0 and "; //------------------------------------------------------------------------ //--- prüft, ob am Ende von $where ein 'and' steht, wenn ja abschneiden if (strlen(strrchr($WhereKlausel, "and")) == 4) { $WhereKlausel = " where " .substr($WhereKlausel, 1, (strrpos($WhereKlausel, "and")-1)); } //------------------------------------------------------------------------ //--- ermittelt Gesamtanzahl der Treffer gem Eingrenzung bzw. Select $abfrage .= $WhereKlausel; $rs = $oCon->openrecordset($abfrage); $AnzahlGefundenerObj = $rs->recordcount; $rs->close(); //------------------------------------------------------------------------ //--- Sortieren der Objekte entsprechend der Auswahl //--- Anzeige der Ersten (20 bzw. gem. Variable) Objekte if (!empty($F_SORT)) { If($F_SORT == "preis") { If($F_EART == "kauf") { $abfrage .= " order by kaufpreis $F_SORTDIR"; } Else { $abfrage .= " order by miete $F_SORTDIR"; } } Else { $abfrage .= " order by $F_SORT $F_SORTDIR"; } } else { $abfrage .= " order by kennung desc "; } //Wenn Sortierung gewünscht, dann limit zurücksetzen if($_POST['cmdSort']!=NULL or $_POST['cmdSuchen']!=NULL or $_POST['cmdSearch']!=NULL ) { $limit = 0; } $abfrage .= " limit $limit, $objekteproseite"; $rs = $oCon->openrecordset($abfrage); $AnzahlAngezeigterObj = $rs->recordcount; //------------------------------------------------------------------------ //----- wieviel Objekte wurden von diesem Typ noch nicht angezeigt? ----- $RestOBJ = $AnzahlGefundenerObj - ( $limit + $objekteproseite ); if ($AnzahlGefundenerObj > 0) { echo "". $oLangPack->translatestring("Für Sie gefundene Objekte").": $AnzahlGefundenerObj \n"; } else { if( ( !empty($Typ) ) or ( !empty($F_OBJEKTART) ) ) { //echo "Kein Objekt gefunden.\n"; ffws_MsgBox($oLangPack->translatestring("Ergebnis der Suche"), "". $oLangPack->translatestring("Kein Objekt gefunden").""); } } //else if (($AnzahlGefundenerObj > 0) and ($AnzahlGefundenerObj > $objekteproseite)) { $BisObjekte = $AnzahlAngezeigterObj + $limit; $VonObjekte = $limit + 1; if ( $VonObjekte == $BisObjekte ) echo "". $oLangPack->translatestring("Angezeigt wird das Objekt")." $VonObjekte \n"; else echo "". $oLangPack->translatestring("Angezeigt werden die Objekte %1 bis %2", array("$VonObjekte","$BisObjekte")).".\n"; } echo "
echo $KURZEXPOSE ?>
echo $oLangPack->translatestring("Kauf- /Mietpreis") ?>
echo $oLangPack->translatestring($DetailParams["F_Param1"]["caption"]) ?>
echo $oLangPack->translatestring($DetailParams["F_Param3"]["caption"]) ?>
echo $oLangPack->translatestring("Wählen Sie eine Objektart aus") ?>!