%
artist_image_url="http://www.union.wisc.edu/events/UWU_Calendar_Images/"
if request("date") <> "" then
date_clause = " c.Start_Date >= to_date('" & request("date") & " 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') and c.Start_Date <= to_date('" & request("date") & " 11:59:59 PM','MM/DD/YYYY HH:MI:SS AM')"
thetop = 9998
elseif request("month") <> "" then
end_month = dateadd("m",1,request("month") & "/1/" & request("year"))
date_clause = " c.Start_Date >= to_date('" & request("month") & "/1/" & request("year")& " 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') and c.Start_Date <= to_date('" & end_month & " 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')"
thetop = 9997
elseif request("search_term") <> "" then
date_clause = "upper(event_title) like '%" & ucase(request("search_term")) & "%' "
thetop = 10
elseif request("start_date") <> "" or request("end_date") <> "" then
if request("start_date") <> "" then
start_date_clause = " c.Start_Date >= to_date('" & request("start_date") & " 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') "
end if
if request("end_date") <> "" then
end_date_clause = " c.end_Date <= to_date('" & request("end_date") & " 11:59:59 PM','MM/DD/YYYY HH:MI:SS AM') "
end if
if start_date_clause <> "" and end_date_clause <> "" then
date_clause = start_date_clause & " and " & end_date_clause
elseif end_date_clause <> "" then
date_clause = end_date_clause
else
date_clause = start_date_clause
end if
thetop = 9999
else
date_clause = " (c.Start_Date >= sysdate AND c.Start_Date < sysdate+14 ) or (c.End_Date >= sysdate AND c.End_Date < sysdate +14 ) "
date_clause = "c.Start_Date >= sysdate "
thetop = 10
end if
sql="SELECT c.id as date_id,a.event_id,a.image_url,l.location_name, to_char(c.start_date,'HH:MI AM') as thestart, to_char(c.start_date,'DD') as thedate,to_char(c.start_date,'Mon') as themonth, to_char(c.start_date,'Day') as theday, a.Event_Title, a.Short_Description, a.Description, a.Location_ID, a.Other_Location, a.Cost, a.URL, c.Start_Date, c.End_Date, b.Series_Name, buy_tickets_url, ARTIST_LISTEN_URL,ARTIST_VIEW_URL,ARTIST_INFO_URL FROM Event_WH.Event a, Event_WH.Series b, Event_WH.Event_Date c, location l WHERE a.visible_theater=1 and a.location_id = l.location_id(+) and a.App_ID=1 AND a.DELETED=0 AND a.APPROVED=1 AND c.App_ID=1 AND c.DELETED=0 AND a.Event_ID=c.Event_ID AND a.Ongoing=0 AND b.App_ID(+)=1 AND b.DELETED(+)=0 AND a.Series_ID=b.Series_ID(+) AND (" & date_clause & " ) Order by to_Char(c.Start_Date,'yyyy-mm-dd'), a.Ongoing, c.Start_Date, b.Series_Name || a.Event_title"
'response.write(sql)
set rs = MyConn.execute(Sql)
%>
Wisconsin Union Theater