<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <% '----------------------------------------------------------------------------------------------- 'VARIABLES '----------------------------------------------------------------------------------------------- dim page dim page_num, projectitems_per_page projectitems_per_page = 7 dim project_detail_page project_detail_page = "projectdetail.asp" page_num = rq("pn") if page_num = "" then page_num = 1 elseif not isnumeric(page_num) then page_num = 1 elseif page_num < 1 then page_num = 1 end if dim section section = rq("sec") dim rs set rs = getRecordSet(section) ' If invalid section then back to beginning if rs.eof then if page_num > 1 then response.redirect(request.ServerVariables("SCRIPT_NAME") & "?sec=" & section) else response.Redirect(request.ServerVariables("SCRIPT_NAME") & "?sec=res") end if end if '----------------------------------------------------------------------------------------------- 'BEGIN ASP '----------------------------------------------------------------------------------------------- set page = new wrapper page.title = "Our Clients: " & getSectionTitle(section) & " | " & page.title page.lefttext = "Our Clients" page.pageid = "" page.javascript = " $(document).ready(function(){ $('.projectitem').hover(function() { $(this).children('.projecttext').css({ backgroundColor: '#666', color: '#fff' });}, function(){$(this).children('.projecttext').css({ backgroundColor: '', color: '' });}); });" page.printHeader() %>
<% page.printOurClientsLinks(section) %> <% printNavBar section, page_num %>
<% printProjects(rs) %>
Keyinteriors Projects
<% page.printFooter() '----------------------------------------------------------------------------------------------- 'PROCEDURES '----------------------------------------------------------------------------------------------- function getRecordSet(section) db_conn() dim query query = "SELECT * FROM key_clients_temp20090115 WHERE projtype='" & db_escape_string(section) & "'" _ & " ORDER BY client_order LIMIT " & ((page_num - 1) * projectitems_per_page) & ", " _ & (projectitems_per_page + 1) set getRecordSet = db_query(query) end function ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 'Also in projectdetail.asp function getSectionTitle(sec) getSectionTitle = replace(sec, " ", "") if instr(1,"residential", getSectionTitle, 1) then getSectionTitle = "Residential" elseif instr(1,"CommercialandPublicSpaces", getSectionTitle, 1) then getSectionTitle = "Commercial and Public Spaces" elseif instr(1,"ProjectsAbroad", getSectionTitle, 1) then getSectionTitle = "Projects Abroad" else getSectionTitle = "" end if end function ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = function getSectionImg(sec) getSectionImg = replace(sec, " ", "") if instr(1,"residential", getSectionImg, 1) then getSectionImg = "img_rightbar_residential.jpg" elseif instr(1,"CommercialandPublicSpaces", getSectionImg, 1) then getSectionImg = "img_rightbar_commercial.jpg" elseif instr(1,"ProjectsAbroad", getSectionImg, 1) then getSectionImg = "img_rightbar_projects.jpg" end if end function ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = sub printProjects(rs) dim num_items num_items = 0 do while not rs.eof and num_items < projectitems_per_page num_items = num_items + 1 %>
<% if isnumeric(rs("images")) then if rs("images") > 1 then %>"><% else %>"><% end if %>A.jpg" alt="Project thumbnail 1" /> <% if rs("images") > 1 then %>">B.jpg" alt="Project thumbnail 2" /><% end if end if %>
"> <%if rs("client_no") = 33 then %> <%= html(rs("address"))%>
<% else %> <%= html(rs("address")) %> <% end if if rs("client_no") = 27 or 33 then %> <%= html(rs("proptype"))%>
<% else %> <%= html(rs("proptype"))%> <% end if %>
<% rs.movenext loop if rs.eof then %> <% end if end sub ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 'Copied into projectdetail.asp 'Copied into photos.asp sub printNavBar(section, pn) %> <% end sub %>