Web Connect How To : Show Me the Code!

 LAFOX Home How URL Maps to Code  LAFOX Design Oveview  Framework Extensions 
*Bootcamp.prg #include WCONNECT.H DEFINE CLASS BootCamp as rbpage PictureOdd = [] PictureEven = [] FUNCTION Page LOCAL loDataManTopics, loDataManCosts This.SaveEventIDtoSession() ** Prepare Data loDataManTopics = This.DataManagerTopics() loDataManCosts = This.DataManagerCosts() This.DataSetup() ** Create the HTML Table This.Content = This.MeetingHTML()+[<br>]+; [<b>Topics</b><br>]+ ; [(Choose your own classes the day of the event.)]+; This.DataGridTopics(loDataManTopics)+[<br>]+; [<b>Prices</b><br>]+; This.DataGridCosts(loDataManCosts) ** Show the page This.Merge('TemplatePage.htm') ENDFUNC ****************************************************************** ** Helper functions below ****************************************************************** HIDDEN Function SaveEventIDtoSession() LOCAL lcEvents_ID lcEvents_ID = Request.QueryString("Events_ID") SessionVars.Globals.Set("Events_ID",lcEvents_ID) ENDFUNC HIDDEN PROCEDURE DataSetup() LOCAL lcEvents_ID lcEvents_ID = Request.QueryString("Events_ID") ** Get the next meeting SELECT events.*, ; location_ds ; FROM (site.Datapath+'events'), (site.dataPath+'locations') ; WHERE events.locations_id = locations.locations_id ; AND Events_ID = lcEvents_ID ; INTO CURSOR qResults ENDPROC HIDDEN Function MeetingHTML LOCAL lcHTML lcHTML = [] SELECT qResults SCAN IF MOD(RECNO(),2) = 0 This.PictureEven = ; [ <td> ] + CRLF+; [ <!--This table contains the boardroom picture-->] + CRLF+; [ <table border="0">] + CRLF+; [ <tr>] + CRLF+; [ <td>] + CRLF+; [ <img src="/images/INTEREST.jpg" height="197" width="300">] + CRLF+; [ </td> ] + CRLF+; [ </tr>] + CRLF+; [ </table>] + CRLF+; [ <!--ends the table with the boardroom picture--> ] + CRLF+; [ </td>] + CRLF ELSE This.PictureOdd = ; [ <td> ] + CRLF+; [ <!--This table contains the boardroom picture-->] + CRLF+; [ <table border="0">] + CRLF+; [ <tr>] + CRLF+; [ <td>] + CRLF+; [ <img src="/images/boardroom.jpg" height="197" width="300">] + CRLF+; [ </td> ] + CRLF+; [ </tr>] + CRLF+; [ </table>] + CRLF+; [ <!--ends the table with the boardroom picture--> ] + CRLF+; [ </td>] + CRLF Endif lcHTML = lcHTML + This.MergeToString("Home_per_Conference.htm") ENDSCAN RETURN lcHTML ENDFUNC HIDDEN Function DataManagerTopics LOCAL loDataMan, lcEvents_ID lcEvents_ID = Request.QueryString("Events_ID") STORE .NULL. to loDataMan ** Remember to set procedure to DataLayer.prg additive!! loDataMan = CreateObject("DataManager") loDataMan.Alias = "zTopics" loDataMan.SQL = [Select Topics.*, speakers.name from ]+Site.DataPath+[Topics.dbf, ]+Site.DataPath+[Speakers.dbf where Topics.Speakers_id = Speakers.Speakers_id and events_id="]+lcEvents_ID+[" order by speakers.speakers_id] loDataMan.PageSize = 20 && Defaults to 20 - for next prev pages automatically loDataMan.QueryAsNeeded() &&New Name?? Name the 3 functions * loDataMan.OrderDefault="Room" && Since we want to search - we must have an initial order set RETURN loDataMan ENDFUNC HIDDEN FUNCTION DataGridTopics(toData) LOCAL lcHTML LOCAL loTable STORE .NULL. to loGrid STORE [] TO lcHTML ** Required ** Remember to set procedure to HTMLTable.prg additive!! loGrid = CreateObject("DataGrid", toData) loGrid.Border=[0] ** Optional - defaults to ALL fields ** Creates a column object for each field ** Will create This.Col_LastName, This.Col_FirstName etc ** Col_FieldName :-) loGrid.FieldList = [Level,Title,Name,Room,Time] ** Optional - defaults to Field Names loGrid.CaptionList = [Level,Title,Speaker,Room,Time] ** Optional ** link to the detail page - ** NOTE this expression will be evaluated - so quote the strings loGrid.Col_Title.HrefExpression = ['/Topic.Page.fox?SessionID=_71P0O15YP&Topics_id='+Topics_ID] loGrid.Col_Name.HrefExpression = ['/Speaker.Page.fox?SessionID=_71P0O15YP&Speakers_id='+Speakers_I] ** Optional - all columns default to sortable ** For this column no sort - they all look the same loGrid.Col_Level.Sortable = .F. loGrid.Col_Title.Sortable = .F. loGrid.Col_Name.Sortable = .F. loGrid.Col_Room.Sortable = .F. loGrid.Col_Time.Sortable = .F. lcHTML = loGrid.HTMLGrid() RETURN lcHTML ENDFUNC *********************** HIDDEN Function DataManagerCosts LOCAL loDataMan, lcEvents_ID lcEvents_ID = Request.QueryString("Events_ID") STORE .NULL. to loDataMan ** Remember to set procedure to DataLayer.prg additive!! loDataMan = CreateObject("DataManager") loDataMan.Alias = "zCosts" loDataMan.SQL = [Select * from ]+Site.DataPath+[EventsPriceSchedule.dbf where events_id="]+lcEvents_ID+[" and end_dt >=DATE() order by start_dt] loDataMan.PageSize = 20 && Defaults to 20 - for next prev pages automatically loDataMan.QueryAsNeeded() &&New Name?? Name the 3 functions *loDataMan.OrderDefault="Room" && Since we want to search - we must have an initial order set RETURN loDataMan ENDFUNC HIDDEN FUNCTION DataGridCosts(toData) LOCAL lcHTML LOCAL loTable STORE .NULL. to loGrid STORE [] TO lcHTML ** Required ** Remember to set procedure to HTMLTable.prg additive!! loGrid = CreateObject("DataGrid", toData) ** Optional - defaults to ALL fields ** Creates a column object for each field ** Will create This.Col_LastName, This.Col_FirstName etc ** Col_FieldName :-) loGrid.FieldList = [price_ds,start_dt,end_dt,amount] ** Optional - defaults to Field Names loGrid.CaptionList = [When,Start&nbsp;Date,End&nbsp;Date,Amount] ** Optional ** link to the detail page - ** NOTE this expression will be evaluated - so quote the strings * loGrid.Col_MoreInfo.HrefExpression = ['/MemberDirectory.Details.fox?SessionID=_71P0O15YP&ID='+MemberID] ** Optional - all columns default to sortable ** For this column no sort - they all look the same loGrid.Col_Price_ds.Sortable = .F. loGrid.Col_Start_dt.Sortable = .F. loGrid.Col_End_dt.Sortable = .F. loGrid.Col_Amount.Sortable = .F. lcHTML = loGrid.HTMLGrid() RETURN lcHTML ENDFUNC ENDDEFINE
csCodeParser v0.9 stats: 201 lines in 0.01 seconds.