%
'Chache ausschalten (abgeschwächt)
Response.Expires = 1
regionid = request("Regionid")
if isnull(regionid) or regionid="" or regionid="3" then
regionid="3"
reg_where = ""
reg_from = ""
else
reg_where = " KRZ.Eintrag_ID=Eintrag.ID and KRZ.Region_ID=" & regionid & " and"
reg_from = ", Kost_Reg_Zuord KRZ"
end if
akt_pg = request("Page")
if isnull(akt_pg) or akt_pg="" then
akt_pg = 1
else
akt_pg = int(akt_pg)
end if
'init Vars and Constants
heute = date
heute_2 = left(cstr(heute),6) & right(year(heute),2)
heute_4 = left(cstr(heute),6) & year(heute)
Const pg_size = 20
Const mpid = 4
'===========================================
'set the Group by Sparte (or not)
sp_group = false
'===========================================
set admin = Server.CreateObject("ADODB.Connection")
set markt = Server.CreateObject("ADODB.Connection")
set rs_a = Server.CreateObject("ADODB.RecordSet")
set rs_m = Server.CreateObject("ADODB.RecordSet")
sql_reg = "Select Region, R_Text_Neu, R_Titel from Region where ID=" & regionid
sql_branchen = "Select ID, Branche from Branche order by Sort"
sql_ang_all = "Select Eintrag.ID, Beginn_Datum, ABS(Beginn_Datum>Date()-5) as IsNew, HP_Img, EKunden_ID, Inhalt from Internet, Eintrag, Detail" & reg_from & " where" & reg_where & " Internet.ID=EKunden_ID and Eintrag.ID=Detail.Eintrag_ID and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and Feld_ID=1 and not Inhalt='' and Marktplatz_ID=" & mpid & " order by Beginn_Datum desc, Detail.Eintrag_ID, Feld_ID"
sql_ang_dtip = "Select Eintrag.ID, Beginn_Datum, HP_Img, EKunden_ID, Inhalt, Title, Breite, Hoehe from Internet, Eintrag, Detail, Kost_Reg_Zuord KRZ, Format where KRZ.Region_ID=" & regionid & " and KRZ.Eintrag_ID=Eintrag.ID and Internet.ID=EKunden_ID and Eintrag.ID=Detail.Eintrag_ID and Eintrag.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and (Feld_ID=1 or Feld_ID=2) and (Tagestipp like '%" & heute_2 & "%' or Tagestipp like '%" & heute_4 & "%') and Marktplatz_ID=" & mpid & " order by Detail.Eintrag_ID, Feld_ID"
'response.write sql_ang_all & "
"
'response.write sql_ang_dtip & "
"
admin.open("admin")
markt.open("kostenlos")
rs_a.open sql_reg, admin, 3
if not rs_a.EOF then
region = rs_a("Region")
r_text = rs_a("R_Text_Neu")
r_titel = rs_a("R_Titel")
end if
rs_a.close
rs_a.open sql_branchen, admin, 3
br_array = rs_a.getRows()
br_anz = rs_a.Recordcount-1
rs_a.close
admin.close
rs_m.open sql_ang_all, markt, 3
if not rs_m.EOF then
ang_anz = rs_m.RecordCount
rs_m.move (akt_pg-1)*pg_size
bookm = rs_m.Bookmark
ang_array = rs_m.getRows(pg_size,bookm)
pg_anz = get_Pageanz(ang_anz,pg_size)
list_anz = ubound(ang_array,2)
else
anz_anz = 0
pg_anz = 0
list_anz = -1
end if
rs_m.close
rs_m.open sql_ang_dtip, markt, 3
if not rs_m.EOF then
dtip_array = rs_m.getRows()
dtip_anz = rs_m.RecordCount/2
dtip = 2 * get_RND_Index(0,dtip_anz)
dtip_eid = dtip_array(0,dtip)
else
dtip_anz = -1
dtip_eid = 0
end if
rs_m.close
'avoid reading the Day-Tip again
sql_ang_hp_1 = "Select Eintrag.ID, Beginn_Datum, ZBS.Branche_ID, Branche, HP_Img, EKunden_ID, Inhalt, Title, Feld_ID, ZES.Sparte_ID, Breite, Hoehe from Internet, Eintrag, ZuordEintragSparte ZES, ZuordBrancheSparte ZBS, Branche, Detail, Kost_Reg_Zuord KRZ, Format where KRZ.Region_ID=" & regionid & " and KRZ.Eintrag_ID=Eintrag.ID and Homepage=-1 and Internet.ID=EKunden_ID and Eintrag.ID=ZES.Eintrag_ID and ZES.Sparte_ID=ZBS.Sparte_ID and ZBS.Branche_ID=Branche.ID and Eintrag.ID=Detail.Eintrag_ID and Eintrag.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and (Feld_ID=1 or Feld_ID=2) and Marktplatz_ID=" & mpid & " and not Branche.ID=17 and not Eintrag.ID=" & dtip_eid
sql_ang_hp_2 = "Select Eintrag.ID, Beginn_Datum, ZBS.Branche_ID, Branche, HP_Img, EKunden_ID, Inhalt, Title, Feld_ID, ZES.Sparte_ID, Breite, Hoehe from Internet, Eintrag, ZuordEintragSparte ZES, ZuordBrancheSparte ZBS, Branche, Detail, Kost_Reg_Zuord KRZ, Format where KRZ.Region_ID=" & regionid & " and KRZ.Eintrag_ID=Eintrag.ID and Homepage=-1 and Internet.ID=EKunden_ID and Eintrag.ID=ZES.Eintrag_ID and ZES.Sparte_ID=ZBS.Sparte_ID and ZBS.Branche_ID=Branche.ID and Eintrag.ID=Detail.Eintrag_ID and Eintrag.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and (Feld_ID=1 or Feld_ID=2) and Marktplatz_ID=" & mpid & " and Branche.ID=17 and not Eintrag.ID=" & dtip_eid
sql_ang_hp = sql_ang_hp_1 & " Union " & sql_ang_hp_2 & " order by ZBS.Branche_ID, ZES.Sparte_ID, Eintrag.ID, Feld_ID"
sql_aus_gr_1 = "Select Branche.ID, Branche, count(*) from Internet, Branche, ZuordBrancheSparte ZBS, ZuordEintragSparte ZES, Eintrag, Kost_Reg_Zuord KRZ where Internet.ID=EKunden_ID and Branche.ID=ZBS.Branche_ID and ZBS.Sparte_ID=ZES.Sparte_ID and ZES.Eintrag_ID=Eintrag.ID and Eintrag.ID=KRZ.Eintrag_ID and KRZ.Region_ID=" & regionid & " and Homepage=-1 and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and Marktplatz_ID=" & mpid & " and not Branche.ID=17 and not Eintrag.ID=" & dtip_eid & " group by Branche.ID, Branche"
sql_aus_gr_2 = "Select Branche.ID, Branche, count(*) from Internet, Branche, ZuordBrancheSparte ZBS, ZuordEintragSparte ZES, Eintrag, Kost_Reg_Zuord KRZ where Internet.ID=EKunden_ID and Branche.ID=ZBS.Branche_ID and ZBS.Sparte_ID=ZES.Sparte_ID and ZES.Eintrag_ID=Eintrag.ID and Eintrag.ID=KRZ.Eintrag_ID and KRZ.Region_ID=" & regionid & " and Homepage=-1 and Aktiv=-1 and Vorschau=0 and Online=-1 and Bann=0 and Date() between Beginn_Datum and Ende_Datum and Marktplatz_ID=" & mpid & " and Branche.ID=17 and Onlineshop=-1 and not Eintrag.ID=" & dtip_eid & " group by Branche.ID, Branche"
sql_aus_gr = sql_aus_gr_1 & " Union " & sql_aus_gr_2 & " order by Branche.ID"
'response.write sql_ang_hp & "
"
'response.write sql_aus_gr & "
"
rs_m.open sql_ang_hp, markt, 3
if not rs_m.EOF then
hp_anz = rs_m.RecordCount/2
hp_array = rs_m.getRows()
else
hp_anz = -1
end if
rs_m.close
rs_m.open sql_aus_gr, markt, 3
if not rs_m.EOF then
aus_anz = rs_m.Recordcount-1
aus_array = rs_m.getRows()
else
aus_anz = -1
end if
rs_m.close
markt.close
set rs_a = nothing
set rs_m = nothing
set admin = nothing
set markt = nothing
%>