<% Response.Buffer = EW_RESPONSE_BUFFER %> <% Session.Timeout = 20 %> <% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% Server.ScriptTimeOut = 240 %> <% ' Define page object Dim All_Rebuilders_view Set All_Rebuilders_view = New cAll_Rebuilders_view Set Page = All_Rebuilders_view ' Page init processing Call All_Rebuilders_view.Page_Init() ' Page main processing Call All_Rebuilders_view.Page_Main() %> <% If All_Rebuilders.Export = "" Then %> <% End If %>

View TABLE: All Rebuilders

<% If All_Rebuilders.Export = "" Then %> Back to List  <% If Security.IsLoggedIn() Then %> Add  <% End If %> <% If Security.IsLoggedIn() Then %> Edit  <% End If %> <% If Security.IsLoggedIn() Then %> Delete  <% End If %> <% End If %>

<% All_Rebuilders_view.ShowMessage %>

<% If All_Rebuilders.Store.Visible Then ' Store %> > > ><%= All_Rebuilders.Store.ViewValue %> <% End If %> <% If All_Rebuilders.Stock_23.Visible Then ' Stock # %> > > ><%= All_Rebuilders.Stock_23.ViewValue %> <% End If %> <% If All_Rebuilders.zYear.Visible Then ' Year %> > > ><%= All_Rebuilders.zYear.ViewValue %> <% End If %> <% If All_Rebuilders.Make.Visible Then ' Make %> > > ><%= All_Rebuilders.Make.ViewValue %> <% End If %> <% If All_Rebuilders.Model.Visible Then ' Model %> > > ><%= All_Rebuilders.Model.ViewValue %> <% End If %> <% If All_Rebuilders.Price.Visible Then ' Price %> > > ><%= All_Rebuilders.Price.ViewValue %> <% End If %> <% If All_Rebuilders.Description.Visible Then ' Description %> > > ><%= All_Rebuilders.Description.ViewValue %> <% End If %> <% If All_Rebuilders.Image_1.Visible Then ' Image 1 %> > > <% If All_Rebuilders.Image_1.HrefValue <> "" Then %> <% If Not IsNull(All_Rebuilders.Image_1.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_1.ViewAttributes %>> <% End If %> <% Else %> <% If Not IsNull(All_Rebuilders.Image_1.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_1.ViewAttributes %>> <% End If %> <% End If %> <% End If %> <% If All_Rebuilders.Image_2.Visible Then ' Image 2 %> > > <% If All_Rebuilders.Image_2.HrefValue <> "" Then %> <% If Not IsNull(All_Rebuilders.Image_2.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_2.ViewAttributes %>> <% End If %> <% Else %> <% If Not IsNull(All_Rebuilders.Image_2.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_2.ViewAttributes %>> <% End If %> <% End If %> <% End If %> <% If All_Rebuilders.Image_3.Visible Then ' Image 3 %> > > <% If All_Rebuilders.Image_3.HrefValue <> "" Then %> <% If Not IsNull(All_Rebuilders.Image_3.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_3.ViewAttributes %>> <% End If %> <% Else %> <% If Not IsNull(All_Rebuilders.Image_3.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_3.ViewAttributes %>> <% End If %> <% End If %> <% End If %> <% If All_Rebuilders.Image_4.Visible Then ' Image 4 %> > > <% If All_Rebuilders.Image_4.HrefValue <> "" Then %> <% If Not IsNull(All_Rebuilders.Image_4.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_4.ViewAttributes %>> <% End If %> <% Else %> <% If Not IsNull(All_Rebuilders.Image_4.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_4.ViewAttributes %>> <% End If %> <% End If %> <% End If %> <% If All_Rebuilders.Image_5.Visible Then ' Image 5 %> > > <% If All_Rebuilders.Image_5.HrefValue <> "" Then %> <% If Not IsNull(All_Rebuilders.Image_5.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_5.ViewAttributes %>> <% End If %> <% Else %> <% If Not IsNull(All_Rebuilders.Image_5.Upload.DbValue) Then %> " border=0<%= All_Rebuilders.Image_5.ViewAttributes %>> <% End If %> <% End If %> <% End If %>
Store
St #
Year
Make
Model
Price
Description
Image 1
Image 2
Image 3
Image 4
Image 5

<% If All_Rebuilders.Export = "" Then %> <% End If %> <% ' Drop page object Set All_Rebuilders_view = Nothing %> <% ' ----------------------------------------------------------------- ' Page Class ' Class cAll_Rebuilders_view ' Page ID Public Property Get PageID() PageID = "view" End Property ' Table Name Public Property Get TableName() TableName = "All Rebuilders" End Property ' Page Object Name Public Property Get PageObjName() PageObjName = "All_Rebuilders_view" End Property ' Page Name Public Property Get PageName() PageName = ew_CurrentPage() End Property ' Page Url Public Property Get PageUrl() PageUrl = ew_CurrentPage() & "?" If All_Rebuilders.UseTokenInUrl Then PageUrl = PageUrl & "t=" & All_Rebuilders.TableVar & "&" ' add page token End Property ' Message Public Property Get Message() Message = Session(EW_SESSION_MESSAGE) End Property Public Property Let Message(v) If Session(EW_SESSION_MESSAGE) <> "" Then ' Append Session(EW_SESSION_MESSAGE) = Session(EW_SESSION_MESSAGE) & "
" & v Else Session(EW_SESSION_MESSAGE) = v End If End Property ' Show Message Public Sub ShowMessage() If Message <> "" Then ' Message in Session, display Response.Write "

" & Message & "

" Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session End If End Sub ' ----------------------- ' Validate Page request ' Public Function IsPageRequest() If All_Rebuilders.UseTokenInUrl Then IsPageRequest = False If Not (ObjForm Is Nothing) Then IsPageRequest = (All_Rebuilders.TableVar = ObjForm.GetValue("t")) End If If Request.QueryString("t").Count > 0 Then IsPageRequest = (All_Rebuilders.TableVar = Request.QueryString("t")) End If Else IsPageRequest = True End If End Function ' ----------------------------------------------------------------- ' Class initialize ' - init objects ' - open ADO connection ' Private Sub Class_Initialize() ' Initialize table object Set All_Rebuilders = New cAll_Rebuilders ' Initialize form object Set ObjForm = Nothing ' Intialize page id (for backward compatibility) EW_PAGE_ID = "view" ' Initialize table name (for backward compatibility) EW_TABLE_NAME = "All Rebuilders" ' Open connection to the database Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open EW_DB_CONNECTION_STRING End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Init ' - called before page main ' - check Security ' - set up response header ' - call page load events ' Sub Page_Init() Set Security = New cAdvancedSecurity If Not Security.IsLoggedIn() Then Call Security.AutoLogin() ' Global page loading event (in userfn7.asp) Call Page_Loading() ' Page load event, used in current page Call Page_Load() End Sub ' ----------------------------------------------------------------- ' Class terminate ' - clean up page object ' Private Sub Class_Terminate() Call Page_Terminate("") End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() If Not (Conn Is Nothing) Then Conn.Close ' Close Connection Set Conn = Nothing Set Security = Nothing Set All_Rebuilders = Nothing ' Go to url if specified If url <> "" Then Response.Clear Response.Redirect url End If End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- Dim lDisplayRecs ' Number of display records Dim lStartRec, lStopRec, lTotalRecs, lRecRange Dim lRecCnt ' ----------------------------------------------------------------- ' Page main processing ' Sub Page_Main() Dim sReturnUrl sReturnUrl = "" Dim bMatchRecord bMatchRecord = False If IsPageRequest Then ' Validate request If Request.QueryString("Stock_23").Count > 0 Then All_Rebuilders.Stock_23.QueryStringValue = Request.QueryString("Stock_23") Else sReturnUrl = "All_Rebuilderslist.asp" ' Return to list End If ' Get action All_Rebuilders.CurrentAction = "I" ' Display form Select Case All_Rebuilders.CurrentAction Case "I" ' Get a record to display If Not LoadRow() Then ' Load record based on key Message = "No records found" ' Set no record message sReturnUrl = "All_Rebuilderslist.asp" ' No matching record, return to list End If End Select Else sReturnUrl = "All_Rebuilderslist.asp" ' Not page request, return to list End If If sReturnUrl <> "" Then Call Page_Terminate(sReturnUrl) ' Render row All_Rebuilders.RowType = EW_ROWTYPE_VIEW Call RenderRow() End Sub Dim Pager ' ----------------------------------------------------------------- ' Set up Starting Record parameters based on Pager Navigation ' Sub SetUpStartRec() Dim nPageNo ' Exit if lDisplayRecs = 0 If lDisplayRecs = 0 Then Exit Sub If IsPageRequest Then ' Validate request ' Check for a START parameter If Request.QueryString(EW_TABLE_START_REC).Count > 0 Then lStartRec = Request.QueryString(EW_TABLE_START_REC) All_Rebuilders.StartRecordNumber = lStartRec ElseIf Request.QueryString(EW_TABLE_PAGE_NO).Count > 0 Then nPageNo = Request.QueryString(EW_TABLE_PAGE_NO) If IsNumeric(nPageNo) Then lStartRec = (nPageNo-1)*lDisplayRecs+1 If lStartRec <= 0 Then lStartRec = 1 ElseIf lStartRec >= ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 Then lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 End If All_Rebuilders.StartRecordNumber = lStartRec End If End If End If lStartRec = All_Rebuilders.StartRecordNumber ' Check if correct start record counter If Not IsNumeric(lStartRec) Or lStartRec = "" Then ' Avoid invalid start record counter lStartRec = 1 ' Reset start record counter All_Rebuilders.StartRecordNumber = lStartRec ElseIf CLng(lStartRec) > CLng(lTotalRecs) Then ' Avoid starting record > total records lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to last page first record All_Rebuilders.StartRecordNumber = lStartRec ElseIf (lStartRec-1) Mod lDisplayRecs <> 0 Then lStartRec = ((lStartRec-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to page boundary All_Rebuilders.StartRecordNumber = lStartRec End If End Sub ' ----------------------------------------------------------------- ' Load row based on key values ' Function LoadRow() Dim RsRow, sSql, sFilter sFilter = All_Rebuilders.KeyFilter ' Call Row Selecting event Call All_Rebuilders.Row_Selecting(sFilter) ' Load sql based on filter All_Rebuilders.CurrentFilter = sFilter sSql = All_Rebuilders.SQL If EW_DEBUG_ENABLED Then Response.Write sSql ' Show SQL for debugging Set RsRow = Server.CreateObject("ADODB.Recordset") RsRow.Open sSql, Conn If RsRow.Eof Then LoadRow = False Else LoadRow = True RsRow.MoveFirst Call LoadRowValues(RsRow) ' Load row values ' Call Row Selected event Call All_Rebuilders.Row_Selected(RsRow) End If RsRow.Close Set RsRow = Nothing End Function ' ----------------------------------------------------------------- ' Load row values from recordset ' Sub LoadRowValues(RsRow) All_Rebuilders.Preview.Upload.DbValue = RsRow("Preview") All_Rebuilders.Store.DbValue = RsRow("Store") All_Rebuilders.Stock_23.DbValue = RsRow("Stock #") All_Rebuilders.zYear.DbValue = RsRow("Year") All_Rebuilders.Make.DbValue = RsRow("Make") All_Rebuilders.Model.DbValue = RsRow("Model") All_Rebuilders.Price.DbValue = RsRow("Price") All_Rebuilders.Description.DbValue = RsRow("Description") All_Rebuilders.Image_1.Upload.DbValue = RsRow("Image 1") All_Rebuilders.Image_2.Upload.DbValue = RsRow("Image 2") All_Rebuilders.Image_3.Upload.DbValue = RsRow("Image 3") All_Rebuilders.Image_4.Upload.DbValue = RsRow("Image 4") All_Rebuilders.Image_5.Upload.DbValue = RsRow("Image 5") End Sub ' ----------------------------------------------------------------- ' Render row values based on field settings ' Sub RenderRow() ' Call Row Rendering event Call All_Rebuilders.Row_Rendering() ' --------------------------------------- ' Common render codes for all row types ' --------------------------------------- ' Store All_Rebuilders.Store.CellCssStyle = "" All_Rebuilders.Store.CellCssClass = "" ' Stock # All_Rebuilders.Stock_23.CellCssStyle = "" All_Rebuilders.Stock_23.CellCssClass = "" ' Year All_Rebuilders.zYear.CellCssStyle = "" All_Rebuilders.zYear.CellCssClass = "" ' Make All_Rebuilders.Make.CellCssStyle = "" All_Rebuilders.Make.CellCssClass = "" ' Model All_Rebuilders.Model.CellCssStyle = "" All_Rebuilders.Model.CellCssClass = "" ' Price All_Rebuilders.Price.CellCssStyle = "" All_Rebuilders.Price.CellCssClass = "" ' Description All_Rebuilders.Description.CellCssStyle = "" All_Rebuilders.Description.CellCssClass = "" ' Image 1 All_Rebuilders.Image_1.CellCssStyle = "" All_Rebuilders.Image_1.CellCssClass = "" ' Image 2 All_Rebuilders.Image_2.CellCssStyle = "" All_Rebuilders.Image_2.CellCssClass = "" ' Image 3 All_Rebuilders.Image_3.CellCssStyle = "" All_Rebuilders.Image_3.CellCssClass = "" ' Image 4 All_Rebuilders.Image_4.CellCssStyle = "" All_Rebuilders.Image_4.CellCssClass = "" ' Image 5 All_Rebuilders.Image_5.CellCssStyle = "" All_Rebuilders.Image_5.CellCssClass = "" ' ----------- ' View Row ' ----------- If All_Rebuilders.RowType = EW_ROWTYPE_VIEW Then ' View row ' Preview If Not IsNull(All_Rebuilders.Preview.Upload.DbValue) Then All_Rebuilders.Preview.ViewValue = All_Rebuilders.Preview.Upload.DbValue All_Rebuilders.Preview.ImageWidth = 160 All_Rebuilders.Preview.ImageHeight = 120 All_Rebuilders.Preview.ImageAlt = "" Else All_Rebuilders.Preview.ViewValue = "" End If All_Rebuilders.Preview.CssStyle = "" All_Rebuilders.Preview.CssClass = "" All_Rebuilders.Preview.ViewCustomAttributes = "" ' Store All_Rebuilders.Store.ViewValue = All_Rebuilders.Store.CurrentValue All_Rebuilders.Store.CssStyle = "" All_Rebuilders.Store.CssClass = "" All_Rebuilders.Store.ViewCustomAttributes = "" ' Stock # All_Rebuilders.Stock_23.ViewValue = All_Rebuilders.Stock_23.CurrentValue All_Rebuilders.Stock_23.CssStyle = "" All_Rebuilders.Stock_23.CssClass = "" All_Rebuilders.Stock_23.ViewCustomAttributes = "" ' Year All_Rebuilders.zYear.ViewValue = All_Rebuilders.zYear.CurrentValue All_Rebuilders.zYear.CssStyle = "" All_Rebuilders.zYear.CssClass = "" All_Rebuilders.zYear.ViewCustomAttributes = "" ' Make All_Rebuilders.Make.ViewValue = All_Rebuilders.Make.CurrentValue All_Rebuilders.Make.CssStyle = "" All_Rebuilders.Make.CssClass = "" All_Rebuilders.Make.ViewCustomAttributes = "" ' Model All_Rebuilders.Model.ViewValue = All_Rebuilders.Model.CurrentValue All_Rebuilders.Model.CssStyle = "" All_Rebuilders.Model.CssClass = "" All_Rebuilders.Model.ViewCustomAttributes = "" ' Price All_Rebuilders.Price.ViewValue = All_Rebuilders.Price.CurrentValue All_Rebuilders.Price.CssStyle = "" All_Rebuilders.Price.CssClass = "" All_Rebuilders.Price.ViewCustomAttributes = "" ' Description All_Rebuilders.Description.ViewValue = All_Rebuilders.Description.CurrentValue All_Rebuilders.Description.CssStyle = "" All_Rebuilders.Description.CssClass = "" All_Rebuilders.Description.ViewCustomAttributes = "" ' Image 1 If Not IsNull(All_Rebuilders.Image_1.Upload.DbValue) Then All_Rebuilders.Image_1.ViewValue = All_Rebuilders.Image_1.Upload.DbValue All_Rebuilders.Image_1.ImageWidth = 640 All_Rebuilders.Image_1.ImageHeight = 480 All_Rebuilders.Image_1.ImageAlt = "" Else All_Rebuilders.Image_1.ViewValue = "" End If All_Rebuilders.Image_1.CssStyle = "" All_Rebuilders.Image_1.CssClass = "" All_Rebuilders.Image_1.ViewCustomAttributes = "" ' Image 2 If Not IsNull(All_Rebuilders.Image_2.Upload.DbValue) Then All_Rebuilders.Image_2.ViewValue = All_Rebuilders.Image_2.Upload.DbValue All_Rebuilders.Image_2.ImageWidth = 640 All_Rebuilders.Image_2.ImageHeight = 480 All_Rebuilders.Image_2.ImageAlt = "" Else All_Rebuilders.Image_2.ViewValue = "" End If All_Rebuilders.Image_2.CssStyle = "" All_Rebuilders.Image_2.CssClass = "" All_Rebuilders.Image_2.ViewCustomAttributes = "" ' Image 3 If Not IsNull(All_Rebuilders.Image_3.Upload.DbValue) Then All_Rebuilders.Image_3.ViewValue = All_Rebuilders.Image_3.Upload.DbValue All_Rebuilders.Image_3.ImageWidth = 640 All_Rebuilders.Image_3.ImageHeight = 480 All_Rebuilders.Image_3.ImageAlt = "" Else All_Rebuilders.Image_3.ViewValue = "" End If All_Rebuilders.Image_3.CssStyle = "" All_Rebuilders.Image_3.CssClass = "" All_Rebuilders.Image_3.ViewCustomAttributes = "" ' Image 4 If Not IsNull(All_Rebuilders.Image_4.Upload.DbValue) Then All_Rebuilders.Image_4.ViewValue = All_Rebuilders.Image_4.Upload.DbValue All_Rebuilders.Image_4.ImageWidth = 640 All_Rebuilders.Image_4.ImageHeight = 480 All_Rebuilders.Image_4.ImageAlt = "" Else All_Rebuilders.Image_4.ViewValue = "" End If All_Rebuilders.Image_4.CssStyle = "" All_Rebuilders.Image_4.CssClass = "" All_Rebuilders.Image_4.ViewCustomAttributes = "" ' Image 5 If Not IsNull(All_Rebuilders.Image_5.Upload.DbValue) Then All_Rebuilders.Image_5.ViewValue = All_Rebuilders.Image_5.Upload.DbValue All_Rebuilders.Image_5.ImageWidth = 640 All_Rebuilders.Image_5.ImageHeight = 480 All_Rebuilders.Image_5.ImageAlt = "" Else All_Rebuilders.Image_5.ViewValue = "" End If All_Rebuilders.Image_5.CssStyle = "" All_Rebuilders.Image_5.CssClass = "" All_Rebuilders.Image_5.ViewCustomAttributes = "" ' View refer script ' Store All_Rebuilders.Store.HrefValue = "" ' Stock # All_Rebuilders.Stock_23.HrefValue = "" ' Year All_Rebuilders.zYear.HrefValue = "" ' Make All_Rebuilders.Make.HrefValue = "" ' Model All_Rebuilders.Model.HrefValue = "" ' Price All_Rebuilders.Price.HrefValue = "" ' Description All_Rebuilders.Description.HrefValue = "" ' Image 1 All_Rebuilders.Image_1.HrefValue = "" ' Image 2 All_Rebuilders.Image_2.HrefValue = "" ' Image 3 All_Rebuilders.Image_3.HrefValue = "" ' Image 4 All_Rebuilders.Image_4.HrefValue = "" ' Image 5 All_Rebuilders.Image_5.HrefValue = "" End If ' Call Row Rendered event Call All_Rebuilders.Row_Rendered() End Sub ' Page Load event Sub Page_Load() 'Response.Write "Page Load" End Sub ' Page Unload event Sub Page_Unload() 'Response.Write "Page Unload" End Sub End Class %>