[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessBody ShowRecords.cfm,1.3,1.4
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-05-09 04:08:05
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody In directory sc8-pr-cvs1:/tmp/cvs-serv21925/dbProcessBody Modified Files: ShowRecords.cfm Log Message: Functionality Added: [ 735008 ] Add Limit Rows to ShowRecords dbProcess Index: ShowRecords.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody/ShowRecords.cfm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShowRecords.cfm 18 Apr 2003 04:17:11 -0000 1.3 --- ShowRecords.cfm 9 May 2003 04:08:02 -0000 1.4 *************** *** 6,15 **** * -url.table (table name) must have been passed from calling template * ********************************************************************************************---> ! <!-------------------------------------> ! <!--- Show Records in Current Table ---> ! <!-------------------------------------> ! <!---||| Show table name |||---> Table Name:<cfoutput>#url.table#</cfoutput> <table width="100%" border="1" cellspacing="0" cellpadding="2"> <!---||| Create Header |||---> --- 6,69 ---- * -url.table (table name) must have been passed from calling template * ********************************************************************************************---> ! <!-----------------------> ! <!--- Show Table Name ---> ! <!-----------------------> Table Name:<cfoutput>#url.table#</cfoutput> + <br /> + + <!-------------------------> + <!--- Records Navigator ---> + <!-------------------------> + <!---||| Initiate a Read Only lock to ensure the integrity of session variables |||---> + <cflock timeout = "30" throwontimeout="no" type = "readonly" scope = "session"> + <!---||| Create Navigate Records Form |||---> + <cfform action="#currentPath#?#session.URLToken#&dbProcess=ShowRecords&table=#table#" method="post" name="FORM_NavigateRecords" enablecab="yes"> + <!---||| Pass Hidden Fields |||---> + <cfoutput> + <!--- Pass the first record number of the current page ---> + <input name="firstRecord" type="hidden" value="#initialRecord#"> + <!--- Calculate the last record number of the current page, by adding the initial record and total number of records ---> + <!--- take into account that in MySQL the first record is numbered 0, not 1, therefore subtract one ---> + <cfset lastRecord = initialRecord + numberOfRecords - 1> + <!--- Pass the last record number of the current page ---> + <input name="lastRecord" type="hidden" value="#lastRecord#"> + </cfoutput> + + <!---||| Allow user to specify the number of records to show |||---> + Maximum Number of Rows: <cfinput name="numberOfRecords" type="text" value="#numberOfRecords#" size="3" required="yes" validate="integer"><br /> + + <!---||| Allow Navigation to First n Records |||---> + <input name="First" type="submit" value="<< First"> + <!---||| Navigate to the Previous n Records as long as first record is not zero, because there are no records before 0 |||---> + <!--- If initial record is 0 ... ---> + <cfif initialRecord EQ 0> + <!--- Disable Previous button ---> + <input name="Previous" type="submit" value="< Previous" disabled="true"> + <!--- otherwise ... ---> + <cfelse> + <!--- Allow Navigation to Previous n Records ---> + <input name="Previous" type="submit" value="< Previous"> + </cfif> + + <!---||| Navigate to the Next n Records as long as not alread at end of records |||---> + <!--- If initialRecord is greater than or equal to the difference between available records and requested number of records ... ---> + <cfif initialRecord GTE recordCount.numOfRows - numberOfRecords> + <!--- Disable Next button ---> + <input name="Next" type="submit" value="Next >" disabled="true"> + <!--- otherwise ... ---> + <cfelse> + <!--- Allow Navigation to Next n Records ---> + <input name="Next" type="submit" value="Next >"> + </cfif> + + <!---||| Allow Navigation to Last n Records |||---> + <input name="Last" type="submit" value="Last >>"> + </cfform> + </cflock> + + <!------------------------------> + <!--- List Requested Records ---> + <!------------------------------> <table width="100%" border="1" cellspacing="0" cellpadding="2"> <!---||| Create Header |||---> |