<% bTwoCol = true bShowThumbs = true bShowPics = true bShowName = false bShowCompany = true bShowEmail = false bShowName2 = true bShowCompany2 = false bShowEmail2 = true dirbgcolor = "#ffffff" dirtextcolor = "#000000" sDirFont="" sDirFontEnd="" sDirSubFont="" sDirSubFontEnd="" nMaxRows = 8 sCat1="Service/Product" sCat2="Address" sCat3="Telephone" sCat4="Website" sCat5="" %>
Home PageAbout UsObjectivesEventsGuestbookMembers LoginInsuranceNav54.pngKACO  AppreciationMadaraka
Directory
Add/Update an entry to the Directory
<% Dim nPageNo Dim oRs Dim oCmd Dim myconn Dim sThumbImage sThumbImage = "images/Img8.gif" if Request.QueryString("pageno") then nPageNo = CInt(Request.QueryString("pageno")) else nPageNo = 1 end if Set oRs = Server.CreateObject("ADODB.Recordset") Set myconn = GetConnection("passwords/") Set oCmd = Server.CreateObject("ADODB.Command") Set oCmd.ActiveConnection = myconn oCmd.CommandType = 1 oCmd.CommandText = "SELECT * FROM Directory INNER JOIN Members ON Directory.MemberID = Members.MemberID ORDER BY UserName, UserCompany" oRs.Open oCmd Dim nPageSize Dim nRecordCount if bTwoCol then nPageSize = nMaxRows*2 else nPageSize = nMaxRows end if if oRs.RecordCount <> -1 then nRecordCount = oRs.RecordCount else nRecordCount = GetDirectoryCount() end if fMaxPages = nRecordCount / nPageSize nMaxPages = Int(fMaxPages) if fMaxPages <> nMaxPages then nMaxPages = nMaxPages + 1 end if if not oRs is NOTHING and not oRs.eof then ' skip ahead? if nPageNo > 1 then oRs.Move((nPageNo-1) * nPageSize) width = "250" row = 0 col = 0 bDone = false do while not oRs.eof and not bDone Response.Write "" & vbCrLf ' Show thumbnail? if bShowThumbs then sImage = oRs("Thumbnail") if IsNull(sImage) or Len(sImage) = 0 then sImage = sThumbImage end if Response.Write "" end if ' Write the record Dim sDirHead Dim sEmail sEmail = oRs("UserEmail") if (bShowName and not IsNull(oRs("UserName"))) then sDirHead = oRs("UserName") elseif (bShowCompany and not IsNull(oRs("UserCompany"))) then sDirHead = oRs("UserCompany") elseif (bShowEmail and not IsNull(sEmail)) then sDirHead = sEmail end if Dim sDirSubHead Dim bAddBR sDirSubHead = "" bAddBR = False if (bShowName2 and not IsNull(oRs("UserName")) and Len(oRs("UserName")) > 0) then if (bAddBR = True) then sDirSubHead = sDirSubHead & "
" sDirSubHead = sDirSubHead & oRs("UserName") bAddBR = True end if if (bShowCompany2 and not IsNull(oRs("UserCompany")) and Len(oRs("UserCompany")) > 0) then if (bAddBR = True) then sDirSubHead = sDirSubHead & "
" sDirSubHead = sDirSubHead & oRs("UserCompany") bAddBR = True end if if (bShowEmail2 and not IsNull(sEmail) and Len(sEmail) > 0) then if (bAddBR = True) then sDirSubHead = sDirSubHead & "
" sDirSubHead = sDirSubHead & sEmail end if Response.Write "" & vbCrLf oRs.MoveNext row = row + 1 if row = nMaxRows then if bTwoCol and col = 0 then row = 0 col = 1 Response.Write "
 " & sDirFont Response.Write "" & sDirHead & "" & sDirFontEnd & "
" Response.Write sDirSubFont & sDirSubHead & sDirSubFontEnd & "
 " Response.Write "
 
" & vbCrLf else bDone = true end if end if loop ' Pad the extra spaces if not bDone then bDone = false do while not bDone Response.Write "" if bShowThumbs then Response.Write "" end if Response.Write "" Response.Write "" & vbCrLf row = row + 1 if row = nMaxRows then if bTwoCol and col = 0 then row = 0 col = 1 Response.Write "
  " & sDirFont & " " & sDirFontEnd Response.Write "
" & sDirSubFont & " " & sDirSubFontEnd & "
 
 
" & vbCrLf else bDone = true end if end if loop end if else ' Write a message that the directory is empty? end if %>
<% ' set directory page links ' if nPageNo > 1 then ' Response.Write "Prev  " ' end if Response.Write "Page:  " for i=1 to nMaxPages if i <> nPageNo then Response.Write "" & i & "  " else Response.Write "" & i & "  " end if next ' if nPageNo < nMaxPages then ' Response.Write "Next  " ' end if %>
<%'!!%>

Home Page | About Us | Services | Events | Guestbook | Member Account | Insurance | John Mwangi Appreciation | JOHN MWANGI - KACO APPRECIATION | Madaraka Day