[an error occurred while processing this directive] Viewing Address entries
Make your own free website on Tripod.com
Viewing Address book entries : :
Home
Add
 

\n\n\n\n\n\n\n\n\n
<% function viewRecords(SEARCH_FILTER,CONTENT){ Response.write(showAlphabetList("view.asp")+"
"); pRecordSet=Server.CreateObject("adodb.RecordSet") var pText=""; var search_by_letter_param=""; var pRecordCount=0; var pRecordSerial=0; var counter=0; var psql=""; var pPage=parseInt(Request.queryString("page")) || 1; switch(SEARCH_FILTER){ case "VIEW_BY_LETTERS" : Response.write(showSearchBox("view.asp")+"
"); psql="SELECT * FROM pAddressTable WHER" +"E first_name LIKE '"+CONTENT+"%' ORDER BY serial ASC"; search_by_letter_param="&action=viewbyletter&le" +"tter="+CONTENT; break; case "VIEW_BY_SEARCH_WORD": CONTENT=filter_content(CONTENT); Response.write(showSearchBox("view.asp",CONTENT)+"
"); psql="SELECT * FROM pAddressTable WHERE " +"first_name LIKE '%"+CONTENT+"%' OR last_nam" +"e LIKE '%"+CONTENT+"%' OR email LIKE '%"+CONTENT+"%' " +"OR phone LIKE '%"+CONTENT+"%' OR nick_name LI" +"KE '%"+CONTENT+"%' OR address LIKE '%"+CONTENT+"%' O" +"RDER BY serial ASC"; search_by_letter_param="&action=search&q="+CONTENT; break; default : Response.write(showSearchBox("view.asp")+"
"); psql="SELECT * FROM pAddressTable ORDER BY SERIAL ASC"; break; } pRecordSet.CursorLocation=3; //adUseClient pRecordSet.CursorType = 1; //adOpenKeyset pRecordSet.LockType=1; //adLockReadOnly pRecordSet.Open(psql,db); if((pRequests["pAction"]=="search") && (CONTENT.length==0)){ Response.write(showSearchResult("Too short phrase to search. Try larger phrase.")); return false; } if(pRecordSet.EOF){ Response.write(showSearchResult("No results found in the address book regardin" +"g  "+CONTENT+" <\/font><\/span>")); } else{ pRecordSet.moveFirst(); while(!pRecordSet.EOF){ pRecordSet.moveNext(); counter++; } switch(pRequests["pAction"]){ case "search": Response.write(showSearchResult(counter+" result[s] found in the ad" +"dress book regarding   "+CONTENT+"  <\/span" +"><\/font>

")); break; case "viewbyletter": Response.write(showSearchResult(counter+" result[s] found in the ad" +"dress book starting first name with &n" +"bsp;"+CONTENT+" <\/b><\/span><\/font>

<\/p>")); break; default: break; } var pTotalPages=Math.ceil(counter/pViewPageSize); Response.write("

"+showPageNavigator(counter,pPage,pTotalPages,'view.asp',search_by_letter_param)+"<\/div>
"); pRecordSet.moveFirst(); pRecordSet.move(pViewPageSize*(pPage-1)); while((pRecordCount\n
"+pRecordSerial+"<\/b" +">"+pRecordSet.fields("first_name")+" "+pRecordSet.fields("last_name")+"
Email :: \n"+pRecordSet.fields("email")+"
Phone Numbe" +"r ::"+pRecordSet.fields("phone")+"
Nick Na" +"me ::"+pRecordSet.fields("nick_name")+"
Addres" +"s ::"+pRecordSet.fields("address")+"
\n


\n" pRecordSet.MoveNext(); pRecordSerial++; pRecordCount++; } Response.write(pText); pRecordSet.close(); Response.write("
"+showPageNavigator(counter,pPage,pTotalPages,'view.asp',search_by_letter_param)+"<\/div>"); pText=""; } } var pRequests={ pAction : String(Request("action")), pLetter : String(Request("letter")), pQuery : String(Request("q")) }; switch(pRequests["pAction"]){ case "viewbyletter" : viewRecords("VIEW_BY_LETTERS",pRequests["pLetter"]); break; case "search": viewRecords("VIEW_BY_SEARCH_WORD",pRequests["pQuery"].trim()); break; default : viewRecords("",""); break; } %>