% strCheckAdmin = Mid(Session("SbNuAdmin"), 6, 1) strDate = DateAdd("d", -1, Date) intPageSize = 25 intPage = Request.QueryString("page") If intPage = "" Then intPage = 1 If Request.Form("org") = "" Then strOrga = Request.QueryString("org") Else strOrga = Request.Form("org") End If If Request.Form("land") = "" Then strLand = Request.QueryString("country") Else strLand = Request.Form("land") End If %> <% Set RSShow = Server.CreateObject("ADODB.Recordset") If Request.QueryString("what") = "country" Then If Request.Form("land") = "falsk" Then Response.Redirect "default.asp" Else If strCheckAdmin = "1" Then Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.CountryID = " & strLand & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" Else Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate > #" & strDate & "# AND tblFair.CountryID = " & strLand & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" End If End If ElseIf Request.QueryString("what") = "org" Then If Request.Form("org") = "falsk" Then Response.Redirect "default.asp" Else If strCheckAdmin = "1" Then Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.OrgID = " & strOrga & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate , tblFair.CountryID, tblFair.City" Else Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate > #" & strDate & "# AND tblFair.OrgID = " & strOrga & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate , tblFair.CountryID, tblFair.City" End If End If ElseIf Request.QueryString("what") = "all" Or Request.QueryString("what") = "" Then If strCheckAdmin = "1" Then Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" Else Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate > #" & strDate & "# AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" End If ElseIf Request.QueryString("what") = "year" Then If strCheckAdmin = "1" Then Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE Year(tblFair.FairDate) = " & Request.QueryString("info") & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" Else Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate > #" & strDate & "# AND Year(tblFair.FairDate) = " & Request.QueryString("info") & " AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" End If ElseIf Request.QueryString("what") = "checkdate" Then If strCheckAdmin = "1" Then Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate = #" & Request.QueryString("info") & "# AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" Else Visa = "SELECT tblFair.*, tblCountry.SName AS CoName FROM tblFair INNER JOIN tblCountry ON tblFair.CountryID = tblCountry.ID WHERE tblFair.FairDate = #" & Request.QueryString("info") & "# AND tblFair.Deleted = False ORDER BY tblFair.FairDate, tblFair.CountryID, tblFair.City" End If End If With RSShow .ActiveConnection = Connect .Source = Visa .PageSize = intPageSize .CursorType = 3 .LockType = 1 .Open End With %>
<% If Request.QueryString("what") = "country" Then
Set RSCoun = Server.CreateObject("ADODB.Recordset")
ILand = "SELECT SName FROM tblCountry WHERE ID = " & strLand & " GROUP BY SName ORDER BY SName "
RSCoun.Open ILand, Connect, adOpenDynamic, adLockOptimistic %>
Visar Mässor i: <% =RSCoun("SName") %>
<% RSCoun.Close
ElseIf Request.QueryString("what") = "org" Then
If Not RSShow("OrgID") = "" Then
Set RSOrga = Server.CreateObject("ADODB.Recordset")
Orga = "SELECT * FROM tblFairOrg WHERE ID = " & strOrga & " "
RSOrga.Open Orga, Connect, adOpenDynamic, adLockOptimistic
Else
End If %>
Visar Mässor av: <% If Not RSShow("OrgID") = "" Then %><% =RSOrga("Name") %><% Else %>-<% End If %>
<% RSOrga.Close
ElseIf Request.QueryString("what") = "all" Or Request.QueryString("what") = "" Then %>
Visar Alla Mässor!
<% ElseIf Request.QueryString("what") = "year" Then %>
Visar Mässor under: <% =Request.QueryString("info") %>
<% End If %>
<% Call PageNavigation(intPage, intTotalPages) Else %>
Inga Mässor hittade... |
---|