#INCLUDE WCONNECT.H
DEFINE CLASS Tips AS rbPage
FUNCTION Page()
LOCAL loDataManager
STORE .NULL. to loDataManager
loDataManager = This.DataManager()
This.Content = This.DataGrid(loDataManager)
This.PageTitle = "VFP Tips and Tricks"
This.Merge("TemplatePage.htm")
ENDFUNC
HIDDEN Function DataManager
LOCAL loDataMan
STORE .NULL. to loDataMan
loDataMan = CreateObject("DataManager")
loDataMan.SQL = [Select * from ]+Site.DataPath+"Tip.dbf where approved = .T. order by Title"
loDataMan.PageSize = 20
loDataMan.QueryAsNeeded()
RETURN loDataMan
ENDFUNC
HIDDEN FUNCTION DataGrid(toData)
LOCAL lcHTML, lcNewTipLink
LOCAL loTable
STORE .NULL. to loGrid
STORE [] TO lcHTML, lcNewTipLink
loGrid = CreateObject("DataGrid", toData)
loGrid.FieldList = [Title,Tip,PostedBy,PostedDate]
loGrid.CaptionList = [Title,Tip,Posted By,Posted Date]
loGrid.Col_Title.Sortable = .F.
loGrid.Col_Tip.Sortable = .F.
loGrid.Col_PostedBy.Sortable = .F.
loGrid.Col_PostedDate.Sortable = .F.
lcNewTipLink = [<br><a href="/tipsubmit.page.fox?SessionID=_71Y1DVSEW">Submit New Tip</a><br>]
lcHTML =[<B>]+This.PageTitle+[</B>] ;
+lcNewTipLink ;
+loGrid.HTMLGrid() ;
+loGrid.HTMLNavBar()
RETURN lcHTML
ENDFUNC
ENDDEFINE
csCodeParser v0.9 stats: 68 lines in 0.00 seconds.