10 pr. side fra array i asp
Er der nogen der kan hjælpe mig med at ændre denne side fra at vise alle lokaler til at vise 10 pr. sideMvh. Henrik
<!--#INCLUDE VIRTUAL="/INCLUDE/dbconn.asp"-->
<!--#INCLUDE VIRTUAL="/INCLUDE/incFunctions.asp"-->
<!--#INCLUDE VIRTUAL="/INCLUDE/MD5.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
if session("subscriber") = 1 then
strNewsletterText = "Mailadressen er allerede tilmeldt"
end if
Dim intCounter
Dim formCount
Dim arrCounter
Dim arrTempCounter
Dim intRegion
Dim ids(9000)
Dim intIdsCounter
Dim arrAllLocations(7,9000)
intIdsCounter = 0
intRegionID = request.QueryString("rid")
if intRegionID <> "" then
if strSQLADD = "" then
strSQLADD = strSQLADD & " WHERE tblRegion.id = " & intRegionID
end if
end if
intCounter = 0
strFormName = request.Form("formName")
if strFormName = "simpleForm" then
for each item in request.Form
if item = "locationTypes" then
if not request.Form(item) = "" then
locationTypes = request.Form(item)
'rw(locationTypes)
if strSQLADD <> "" then
strSQLADD = strSQLADD & " AND tblLocationLocationType.LocationTypeId IN (" & locationTypes & ")"
else
strSQLADD = strSQLADD & " WHERE tblLocationLocationType.LocationTypeId IN (" & locationTypes & ")"
end if
session("locationTypes") = locationTypes
end if
end if
if item = "city" then
if not request.Form(item) = "0" then
strCity = request.Form(item)
'rw(strCity)
if strSQLADD <> "" then
strSQLADD = strSQLADD & " AND tblCity.Name = '" & strCity & "'"
else
strSQLADD = strSQLADD & " WHERE tblCity.Name = '" & strCity & "'"
end if
end if
end if
if item = "region" then
if not request.Form(item) = "0" then
strRegion = request.Form(item)
'rw(strRegion)
if strSQLADD <> "" then
strSQLADD = strSQLADD & " AND tblRegion.id = " & strRegion
else
strSQLADD = strSQLADD & " WHERE tblRegion.id = " & strRegion
end if
end if
end if
'rw(request.Form.Key(item) & "-" & request.Form(item))
'rw(locationTypes & "-" & strCity & "-" & strRegion)
next
end if
strSQL = "SELECT DISTINCT tblLocation.Id, tblLocation.locationName, tblLocation.LocationAddress, " &_
"tblLocation.LocationAddressSub, tblPostalCode.Name, tblCity.Name AS CityName, " &_
"tblCountry.Name AS Countryname, tblOrder.PaymentApproved AS PA " &_
"FROM tblRegion INNER JOIN tblPostalCode " &_
"ON tblRegion.Id = tblPostalCode.RegionId INNER JOIN tblCity " &_
"ON tblPostalCode.Id = tblCity.PostalCodeId INNER JOIN tblCountry " &_
"ON tblRegion.CountryId = tblCountry.Id INNER JOIN tblLocation " &_
"ON tblPostalCode.Id = tblLocation.LocationPostalCodeID INNER JOIN tblLocationLocationType " &_
"ON tblLocation.Id = tblLocationLocationType.LocationId " &_
"INNER JOIN tblOrder " &_
"ON tblLocation.Id = tblOrder.LocationId " &_
"INNER JOIN tblOrderLine " &_
"ON tblOrder.Id = tblOrderLine.OrderId"
if strSQLAdd <> "" then
strSQLAddPaymentBusiness = " AND tblLocationLocationType.LocationTypeId IN (1,2) AND " &_
"(GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate) AND " &_
"tblOrderLine.ProductId = 9 AND tblOrder.PaymentApproved IS NOT NULL ORDER by PA desc"
strSQLAddPaymentDiff = " AND tblLocationLocationType.LocationTypeId IN (1,2) AND " &_
"(GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate) AND " &_
"tblOrderLine.ProductId <> 9 AND tblOrder.PaymentApproved IS NOT NULL ORDER by PA desc"
else
strSQLAddPaymentBusiness = " WHERE tblLocationLocationType.LocationTypeId IN (1,2) AND " &_
"(GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate) AND " &_
"tblOrderLine.ProductId = 9 AND tblOrder.PaymentApproved IS NOT NULL ORDER by PA desc"
strSQLAddPaymentDiff = " WHERE tblLocationLocationType.LocationTypeId IN (1,2) AND " &_
"(GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate) AND " &_
"tblOrderLine.ProductId <> 9 AND tblOrder.PaymentApproved IS NOT NULL ORDER by PA desc"
end if
'Finder alle lokaler der har et aktivt business produkt
strSQLSpecial = strSQL & strSQLAdd & strSQLAddPaymentBusiness
set objRS = objConn.Execute(strSQLSpecial)
'sendEmail Application("defaultmailsender"), Application("defaultMailname"), "fckmax@hotmail.com", "test", myArray(0) & myArray(1)
if not objrs.EOF then
arrLocations = objRS.getRows()
end if
objectClose(objRS)
strSQL = "SELECT DISTINCT tblLocation.Id, tblLocation.locationName, tblLocation.LocationAddress, " &_
"tblLocation.LocationAddressSub, tblPostalCode.Name, tblCity.Name AS CityName, " &_
"tblCountry.Name AS Countryname, tblOrder.PaymentApproved AS PA " &_
"FROM tblRegion INNER JOIN tblPostalCode " &_
"ON tblRegion.Id = tblPostalCode.RegionId INNER JOIN tblCity " &_
"ON tblPostalCode.Id = tblCity.PostalCodeId INNER JOIN tblCountry " &_
"ON tblRegion.CountryId = tblCountry.Id INNER JOIN tblLocation " &_
"ON tblPostalCode.Id = tblLocation.LocationPostalCodeID INNER JOIN tblLocationLocationType " &_
"ON tblLocation.Id = tblLocationLocationType.LocationId " &_
"INNER JOIN tblOrder " &_
"ON tblLocation.Id = tblOrder.LocationId " &_
"INNER JOIN tblOrderLine " &_
"ON tblOrder.Id = tblOrderLine.OrderId"
'Finder alle lokaler der har et andet aktivt produkt end business
strSQLSpecial2 = strSQL & strSQLAdd & strSQLAddPaymentDiff
'sendEmail Application("defaultmailsender"), Application("defaultMailname"), "fckmax@hotmail.com", "test", strSQLSpecial & "<br /><br /><br />" & strSQLSpecial2
set objRS = objConn.Execute(strSQLSpecial2)
if not objrs.EOF then
arrLocations2 = objRS.getRows()
end if
objectClose(objRS)
strSQL2 = "SELECT DISTINCT " &_
"tblLocation.Id, tblLocation.locationName, tblLocation.LocationAddress, tblLocation.LocationAddressSub, tblPostalCode.Name, " &_
"tblCity.Name AS CityName, tblCountry.Name AS Countryname " &_
"FROM tblRegion INNER JOIN " &_
"tblPostalCode ON tblRegion.Id = tblPostalCode.RegionId INNER JOIN " &_
"tblCity ON tblPostalCode.Id = tblCity.PostalCodeId INNER JOIN " &_
"tblCountry ON tblRegion.CountryId = tblCountry.Id INNER JOIN " &_
"tblLocation ON tblPostalCode.Id = tblLocation.LocationPostalCodeID INNER JOIN " &_
"tblLocationLocationType ON tblLocation.Id = tblLocationLocationType.LocationId"
'Finder alle lokaler
strSQL2 = strSQL2 & strSQLAdd & " ORDER BY Id desc"
set objRS = objConn.Execute(strSQL2)
'sendEmail Application("defaultmailsender"), Application("defaultMailname"), "fckmax@hotmail.com", "test", myArray(0) & myArray(1)
if not objrs.EOF then
arrLocations3 = objRS.getRows()
end if
objectClose(objRS)
Dim intArrAllLocationsSize
intArrAllLocationsSize = 0
if isArray(arrLocations) then
for arrCounter=0 to Ubound(arrLocations,2)
blnSkip = false
for arrTempCounter=0 to Ubound(ids)
if ids(arrTempCounter) = arrLocations(0,arrCounter) then
blnSkip = true
end if
next
if not blnSkip then'læg lokalet i det store array hvis der er tale om et id der ikke har været anvendt tidligere..
ids(intIdsCounter) = arrLocations(0,arrCounter)
arrAllLocations(0,intIdsCounter) = arrLocations(0,arrCounter)
arrAllLocations(1,intIdsCounter) = arrLocations(1,arrCounter)
arrAllLocations(2,intIdsCounter) = arrLocations(2,arrCounter)
arrAllLocations(3,intIdsCounter) = arrLocations(3,arrCounter)
arrAllLocations(4,intIdsCounter) = arrLocations(4,arrCounter)
arrAllLocations(5,intIdsCounter) = arrLocations(5,arrCounter)
arrAllLocations(6,intIdsCounter) = arrLocations(6,arrCounter)
intIdsCounter = intIdsCounter + 1
intArrAllLocationsSize = intArrAllLocationsSize + 1
end if
next
end if
if isArray(arrLocations2) then
for arrCounter=0 to Ubound(arrLocations2,2)
blnSkip = false
for arrTempCounter=0 to Ubound(ids)
if ids(arrTempCounter) = arrLocations2(0,arrCounter) then
blnSkip = true
end if
next
if not blnSkip then'læg lokalet i det store array hvis der er tale om et id der ikke har været anvendt tidligere..
ids(intIdsCounter) = arrLocations2(0,arrCounter)
arrAllLocations(0,intIdsCounter) = arrLocations2(0,arrCounter)
arrAllLocations(1,intIdsCounter) = arrLocations2(1,arrCounter)
arrAllLocations(2,intIdsCounter) = arrLocations2(2,arrCounter)
arrAllLocations(3,intIdsCounter) = arrLocations2(3,arrCounter)
arrAllLocations(4,intIdsCounter) = arrLocations2(4,arrCounter)
arrAllLocations(5,intIdsCounter) = arrLocations2(5,arrCounter)
arrAllLocations(6,intIdsCounter) = arrLocations2(6,arrCounter)
intIdsCounter = intIdsCounter + 1
intArrAllLocationsSize = intArrAllLocationsSize + 1
end if
next
end if
if isArray(arrLocations3) then
for arrCounter=0 to Ubound(arrLocations3,2)
blnSkip = false
for arrTempCounter=0 to Ubound(ids)
if ids(arrTempCounter) = arrLocations3(0,arrCounter) then
blnSkip = true
end if
next
if not blnSkip then'læg lokalet i det store array hvis der er tale om et id der ikke har været anvendt tidligere..
ids(intIdsCounter) = arrLocations3(0,arrCounter)
arrAllLocations(0,intIdsCounter) = arrLocations3(0,arrCounter)
arrAllLocations(1,intIdsCounter) = arrLocations3(1,arrCounter)
arrAllLocations(2,intIdsCounter) = arrLocations3(2,arrCounter)
arrAllLocations(3,intIdsCounter) = arrLocations3(3,arrCounter)
arrAllLocations(4,intIdsCounter) = arrLocations3(4,arrCounter)
arrAllLocations(5,intIdsCounter) = arrLocations3(5,arrCounter)
arrAllLocations(6,intIdsCounter) = arrLocations3(6,arrCounter)
intIdsCounter = intIdsCounter + 1
intArrAllLocationsSize = intArrAllLocationsSize + 1
end if
next
end if
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%setTitle %></title>
<link rel="stylesheet" href="/include/css/meetin_show.css" type="text/css" />
<link rel="stylesheet" href="/include/css/jd.gallery.css" type="text/css" media="screen" />
<script language="javascript" src="/include/js/scripts.js"></script>
<script language="javascript" src="/include/js/gfv.js" type="text/javascript"></script>
<script language="javascript" src="/include/js/autocomplete.js" type="text/javascript"></script>
<script language="javascript" src="/include/js/gallery/mootools.v1.11.js" type="text/javascript"></script>
<script language="javascript" src="/include/js/gallery/jd.gallery.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function dOnload()
{
var subscriber = '<%= session("subscriber") %>';
if (subscriber==1)
{
tableExpandNewsletter(newsLetterCheck.childNodes.item(0));
}
}
window.status = '<%= Application("Debug")%>';
</script>
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
showCarousel: false,
showArrows: false
});
}
window.addEvent('domready', startGallery);
</script>
</head>
<body onload="dOnload();">
<div id="divPageContainer">
<div id="divPageLeftColumn">
<a href="http://www.....dk">
<div id="divPageHeader">
</div></a>
<div id="divPageLeftContent">
<div id="divPageLeftMenu">
<% arrBanner = getBanner(5,10,120,600) %>
<% response.Write(arrBanner) %>
</div>
<div id="divPageMainContentADVSearch">
<%'*************Tager et lokale af gangen og viser det..*****
blnEven = true
if isArray(arrAllLocations) then
'fra 0 til array lenght-1
'for arrCounter=0 to intArrAllLocationsSize-1
for arrCounter=10 to 19
if blnEven then
rowSelected = "searchResultListOdd"
blnEven = false
else
rowSelected= "searchResultListEven"
blnEven = true
end if
strSQLLocationType = "SELECT tblLocationType.Name " &_
"FROM tblLocationType INNER JOIN tblLocationLocationType ON tblLocationType.Id = tblLocationLocationType.LocationTypeId " &_
"INNER JOIN tblLocation ON tblLocationLocationType.LocationId = tblLocation.Id " &_
"WHERE tblLocation.id = " & arrAllLocations(0,arrCounter)
set objRS3 = objConn.Execute(strSQLLocationType)
strType = ""
if not objRS3.EOF then
strType = objRS3("Name")
if strType = "Mødelokale" then
strType = "Mødelokale"
elseif strType = "Selskabslokale" then
strType = "Festlokale"
end if
objRS3.MoveNext
end if
if not objRS3.EOF then
strType = "Mødelokale & Festlokale"
end if
'objectClose(objRS3)
intLocationId = arrAllLocations(0,arrCounter)
strSQLDoubleHeight = "SELECT tblorder.id AS OrderID " &_
"FROM tblOrder INNER JOIN tblLocation ON tblOrder.LocationId = tblLocation.Id " &_
"INNER JOIN tblOrderLine ON tblOrder.Id = tblorderline.OrderId " &_
"WHERE tblLocation.id = " & intLocationId & " AND (tblOrderLine.ProductId = 22 AND tblOrder.PaymentApproved IS NOT NULL " &_
"AND (GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate) " &_
"OR tblOrderLine.ProductId = 9 AND tblOrder.PaymentApproved IS NOT NULL " &_
"AND (GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate))"
set objRS2 = objConn.Execute(strSQLDoubleHeight)
if not objRS2.EOF then
'sendEmail Application("defaultmailsender"), Application("defaultMailname"), "fckmax@hotmail.com", "test", "<br><br>" & intLocationId
'dobbelthøjde i søgeresultat - ellers almindelig højde som skrives nede i else-delen..
%>
<table class="doubleHeightResult" border="0">
<tr valign="top" class="<%=rowSelected %>" onmouseover="this.className='searchResultListMark'"
onmouseout="this.className='<%= rowSelected %>'" onclick="goToURL('/include/showLocation.asp?id=<%=arrAllLocations(0,arrCounter) %>');">
<td class="doubleHeightResult" width="80px">
<img src="<%=getResultListPicture(arrAllLocations(0,arrCounter))%>" width="60px" height="60px" /></td>
<td class="doubleHeightResult" width="420px">
<b>
<%=arrAllLocations(1,arrCounter) %>
</b><span style="float: right;"><% response.Write(strType) %> </span>
<br />
<%=arrAllLocations(2,arrCounter) %>
<br />
<%=arrAllLocations(3,arrCounter) %>
<br />
<%=arrAllLocations(4,arrCounter) %>
<%= arrAllLocations(5,arrCounter) %> - <%=arrAllLocations(6,arrCounter) %><br />
</td>
</table>
<%else %>
<table class="" border="0">
<tr valign="top" class="<%=rowSelected %>" onmouseover="this.className='searchResultListMark'"
onmouseout="this.className='<%= rowSelected %>'" onclick="goToURL('/include/showLocation.asp?id=<%=arrAllLocations(0,arrCounter) %>');">
<td width="80px">
<img src="<%=getResultListPicture(arrAllLocations(0,arrCounter))%>" width="60px" height="60px" /></td>
<td width="420px">
<b>
<%=arrAllLocations(1,arrCounter) %>
</b><span style="float: right;"><% response.Write(strType) %> </span>
<br />
<%=arrAllLocations(2,arrCounter) %>
<br />
<%=arrAllLocations(3,arrCounter) %>
<br />
<%=arrAllLocations(4,arrCounter) %>
<%= arrAllLocations(5,arrCounter) %> - <%=arrAllLocations(6,arrCounter) %><br />
</td>
</table>
<%end if
blnEven = false
if rowSelected = "searchResultListEven" then
blnEven = true
end if
next
end if
if intArrAllLocationsSize = 0 then 'Hvis der ingen lokaler fundet er..
%>
<b>Din søgning gav desværre intet resultat...</b>
<%
end if
%>
</div>
</div>
</div>
<div id="divPageRightColumn">
<div id="divPageRightLogin" language="javascript" ondragleave="return divPageRightLogin_ondragleave()">
<%if(session("uiGlobalUserID") = "") then %>
<form action="/include/login.asp" name="form" method="post" show_alert="0" onsubmit="return Validate(this);">
<div class="expandTable">
<div class="expandHeader" onclick="tableExpand(this.childNodes.item(0))">
<%=getLoginBoxText() %></div>
<div class="expandContent">
<div>
<label>
Brugernavn (email)</label><span class="validationMessage" id="brugernavnError"></span><br />
<input type="text" name="brugernavn" class="formfeltLogin" validate="not_empty|email"
msg="Indtast brugernavn" error_container="brugernavnError" /><br />
<label>
Kodeord</label><br />
<input type="password" name="kodeord" class="formfeltLogin" validate="not_empty"
msg="Indtast kodeord" />
</div>
<div class="divLoginForgotPassword">
<a href="/include/newpassword.asp">Glemt password?</a>
</div>
<div class="divLoginForgotPassword">
<a href="/include/newCustomer.asp">Ny bruger?</a>
</div>
<div class="divButtonRight">
<input type="Submit" value="login" class="button" />
</div>
</div>
</div>
</form>
<%else %>
<div class="expandTable">
<div class="expandHeader" onclick="tableExpand(this.childNodes.item(0))">
<%=getLoginBoxTextLoggedIn() %></div>
<div class="expandContent">
<div>
<div class="headline">
Brugeroplysninger</div>
<div>
Fornavn:<%=session("nvcUserFirstname") %><br />
Efternavn:<%=session("nvcUserLastname") %><br />
Emailadresse:<%=session("nvcUserEmailAddress") %><br />
Oprettet d.:<%=session("nvcUserActivatedDate") %><br />
</div>
</div>
<div class="divChangePassword">
<a href="/include/changepassword.asp">Skift kodeord?</a>
</div>
<div class="divChangePassword">
<a href="/include/logoff.asp">Log af</a>
</div>
</div>
</div>
<%end if %>
</div>
<div id="divPolariodContainer">
<div id="myGallery">
<%
Dim my_num,max,min
max=7
min=1
Randomize
my_num=int((max-min+1)*rnd+min)
strSQLAdd = ""
if my_num = "1" then
strSQLAdd = " Order by OrderID"
end if
if my_num = "2" then
strSQLAdd = " Order by OrderID desc"
end if
if my_num = "3" then
strSQLAdd = " Order by locationId"
end if
if my_num = "4" then
strSQLAdd = " Order by locationId desc"
end if
if my_num = "5" then
strSQLAdd = " Order by PaymentApproved"
end if
if my_num = "6" then
strSQLAdd = " Order by PaymentApproved desc"
end if
if my_num = "7" then
strSQLAdd = " Order by PaymentApproved desc"
end if
strSQL = "SELECT tblorder.id AS OrderID, tblorder.locationid AS LocID, tblOrder.PaymentApproved " &_
"FROM tblOrder INNER JOIN tblLocation ON tblOrder.LocationId = tblLocation.Id " &_
"INNER JOIN tblOrderLine ON tblOrder.Id = tblorderline.OrderId " &_
"WHERE tblOrderLine.ProductId = 9 AND tblOrder.PaymentApproved IS NOT NULL " &_
"AND GETDATE() BETWEEN tblOrderLine.StartDate AND tblOrderLine.EndDate" & strSQLAdd
set objRSOrderID = objConn.Execute(strSQL)
while (not objRSOrderID.EOF)
oid = objRSOrderID("OrderID")
lid = objRSOrderID("LocID")
strSQL2 = "SELECT tblLocationProductImages.imgField FROM tblLocationProductImages " &_
"WHERE tblLocationProductImages.LocationId = " & lid & " AND tblLocationProductImages.orderid = -1 AND tblLocationProductImages.productid = -1"
set objRSImage = objConn.Execute(strSQL2)
if not objRSImage.EOF then
strImage = objRSImage("imgField")
objectClose(objRSImage)
end if
strSQL3 = "SELECT tblLocation.locationdescription as LD, tblLocation.locationName as LN " &_
"FROM tblLocation WHERE tblLocation.Id = " & lid
set objRSLoc = objConn.Execute(strSQL3)
if not objRSLoc.EOF then
strDescription = objRSLoc("LD")
strDescription = Mid(strDescription, 1, 100) & "..."
strLocName = objRSLoc("LN")
objectClose(objRSLoc)
end if
%>
<div class="imageElement">
<h3><%=strLocName %><br /><%=strDescription %></h3>
<p>
</p>
<a href="showLocation.asp?id=<%=lid %>" title="<%=strLocName %>" class="open"></a>
<center><img src="/upload/location/<%=strImage %>" width="272px" height="200px" class="full" STYLE="cursor: pointer" />
</center></div>
<%
objRSOrderID.MoveNext
wend
objectClose(objRSOrderID)
%>
</div>
</div>
<div id="divPageRightNewsletter">
<form action="/include/xt_newsletter.asp" name="newsletterForm" method="post" show_alert="0"
onsubmit="return Validate(this);">
<div class="expandTableNewsletter">
<div id="newsLetterCheck" class="expandHeaderNewsletter" onclick="tableExpandNewsletter(this.childNodes.item(0));">
Nyhedsbrev</div>
<div class="expandContentNewsletter">
<div>
<label>
Email</label><span id="newsletterError" class="validationMessage"><%=strNewsletterText %></span><br />
<input type="text" name="newsletterEmail" class="formfeltLogin" validate="not_empty|email"
msg="Indtast brugernavn|Emailen er ikke valid!" error_container="newsletterError" /><br />
</div>
<div class="divButtonRight">
<input type="submit" name="submit" value="Tilmeld" class="button" />
<input type="submit" name="submit" value="Afmeld" class="button" />
</div>
</div>
</div>
</form>
</div>
<div id="divPageRightArticles">
<div class="divArticles">
<div class="headline" onclick="goToURL('/include/allArticles.asp')" STYLE="cursor: pointer">Artikelsamling</div>
<!--#INCLUDE VIRTUAL="/INCLUDE/incArticles.asp"-->
</div>
<div>
</div>
</div>
</div>
<div id="divPageRowBottom" onclick="goToURL('/include/about.asp')" STYLE="cursor: pointer" />
<div id="companyInformation">
<% companyInfo %>
</div>
</div>
</body>
</html>