Hey Erik, maybe it's just me because I've yet to have breakfast, but you don't help yourself with posts like this.
Strip the code down to only the SQL and some basic output. No one should have to see your <td valign="bottom" align="left"><font size="2"><b> formatting. There are 16 spaces pushing that first bunch of CF over to the right, the table more so, which plays havoc with trying to read it (maybe it's my email client!). I normally read fresh posts but I looked at this and though "I can't be bothered". I'm sure others did the same. Sorry dude, but if you make it easier for someone to have a quick look at your code you'll probably get more responses. Adrian > -----Original Message----- > From: erik tom [mailto:[email protected]] > Sent: 19 February 2009 21:50 > To: cf-talk > Subject: ColdFuison Course display > > > I have a code that i wrote looking for the specific courses and check > for the completion. Now the requirenment has changed. > 4. Date Rule: This will have a number of possibilities. > 0: Ignore start and end dates. Display this course for all EDITs > 1: This course will be displayed to an edit if the EDIT date is after > the Start date. > 2: This course will be displayed to an edit if the EDIT date is before > the End date. > 3: This course will be displayed to an edit if the EDIT date is > between the Start date and the End date. > 5. Equivalent Course: Chosen from a dropdown list of all Sunrise > courses. If the main course has been completed display that one. If > the main course has not been completed but the Equivalent one has, then > display the equivalent one. If neither have been done then display > main course but without a completion date. The EDIT may put in a > completion if course rules allow this. Note the date rules still > apply. > The Equivalent course is to be a list of courses. This will allow a > course to be equivalent to 2 or 3 courses. If displaying the > Equivalents display all the courses in the list. > 6. Online: Yes or no. Display only this is automated by the > system and cannot be set by the Administrator. If the course is an > online course the EDIT will not be able to input a completion date. > This completion date will then be automated. > > The Equivalent stored in the list. How would I achieve this code change > Here is my current code > > <!--- Get employee ---> > <cfquery name="getEmployee" datasource="cfelsunrise" > dbtype="ODBC"> > select * > from Employee e > Join EmployeeJobHistory h on e.EmployeeID > = h.EmployeeID > inner join JobAssignment a on (h.sequence > = a.sequence and a.EndDate is NULL) > inner join Location l ON l.LocationID > = a.LocationID > inner join JobCode_List j on h.JobCode = > j.JobCode > where e.terminationdate is NULL > and e.EmployeeID = #sel_EmpID# > Order by a.startDate DESC > </cfquery> > <cfquery name="getDynamicCourses" > datasource="cfelsunrise"> > Select > d.Courseid,d.ISoNLINE,c.description,c.name,d.equivalentto from > DynamicCourseList d > inner join Course_catalog c on > c.courseID = d.courseID > where whatFor = 'EDIT' > </cfquery> > > <cfset lstartDt = DateFormat(getEmployee.StartDate, > "mm/dd/yy")> > <cfset ReqCourseNrray = ArrayNew(1)> > <cfset ReqCourserray = ArrayNew(1)> > <cfset ReqdEquivalentCourserray = ArrayNew (1)> > > <cfif getDynamicCourses.recordcount gt 0> > <cfloop query="getDynamicCourses"> > <cfset > ArrayAppend(ReqCourseNrray, #getDynamicCourses.description#)> > <cfset > ArrayAppend(ReqCourserray, #getDynamicCourses.name#)> > > </cfloop> > </cfif> > > > <!---- get non-requiredmtraining ---> > <cfset lLast_Name = getEmployee.Last_Name> > <cfset lFirst_Name = getEmployee.First_Name> > <cfset lmiddle_Name = getEmployee.middle_Name> > <cfset lEmployeeID = getEmployee.EmployeeID> > <cfset lName = getEmployee.Name> > <cfset lState = getEmployee.State> > <cfset lDeptName = getEmployee.DeptName> > <cfset lBusiness = getEmployee.Business> > <cfset lHireDate = getEmployee.HireDate> > <cfset lServiceDate = getEmployee.ServiceDate> > <cfset lReHireDate = getEmployee.ReHireDate> > <cfset lpositionDate = getEmployee.StartDate> > <cfset reqdHrs = 0> > <cfset reqdHrsCompl = 0> > <cfset TotalHrs = 0> > <!--- Display info ---> > > <div align="center"> > > <!--- If Basic, display the current page. > If book, include the book page > if misc, include misc page > ---> > > <cfset lasttg = "**"> > > <table width="100%" > align="center" border="0"> > <tr> > <td > align="center" valign="bottom"><font size="2"><b>Course/Certification > </b></font></td> > <td width="11" > align="left" valign="bottom"><font size="2"><b>Attended</b></font></td> > <td > valign="bottom" align="left"><font > size="2"><b>Facilitator/SME</b></font></td> > <td > valign="bottom" align="left"><font size="2"><b>Comments</b></font></td> > </tr> > <!--- <cfdump > var="#ReqCourserray#">---> > <!--- Loop through > array and display Reqd courses ---> > <cfloop from="1" > to="#ArrayLen(ReqCourserray)#" index="i"> > <cfset selTGID > = #ReqCourserray[i]#> > <cfset selTGNID > = #ReqCourseNrray[i]#> > > <cfquery name="getDynamicCourses2" datasource="cfelsunrise"> > > Select d.Courseid,d.ISoNLINE,c.description,c.name from > DynamicCourseList d > > inner join Course_catalog c on c.courseID = d.courseID > > where c.name = '#selTGID#' > > </cfquery> > <cfset reqmtmsg > = ""> > <!--- Get > Course from Array ---> > <cfquery > name="getcOURSE" datasource="cfelsunrise" dbtype="ODBC"> > select > c.CourseID as reqCourseID, c.Type, > > c.Name as CourseName, c.Description as CourseDesc, c.HrsLength > from > Course_Catalog c > where > c.Name = '#selTGID#' > </cfquery> > <cfif > getCourse.recordcount is not 0> > <cfset > selCID = getCoURSe.reqCourseID> > > <cfquery name="getReqmts" datasource="cfelsunrise" dbtype="ODBC"> > > select et.StartDate, et.CompletionDate, et.Sequence, et.CourseLength, > et.Instructor, et.Comments > > from EmployeeTraining et > > where et.CourseID = '#selCID#' > > and et.EmployeeID = #sel_EmpID# > > </cfquery> > </cfif> > <cfoutput> > <input > type="hidden" name="ETCourseName#i#" value="#TRIM(selTGNID)#"> > <cfif > getCourse.recordcount is not 0> > > <input type="hidden" name="ETCourseID#i#" > value="#getCourse.reqCourseID#"> > > <input type="hidden" name="ETCourseType#i#" value="#getCourse.Type#"> > > <input type="hidden" name="ETCourseLength#i#" > value="#getCourse.HrsLength#"> > > <input type="hidden" name="ETSequence#i#" value=<cfif > getReqmts.recordcount is not > 0>"#getReqmts.Sequence#"<cfelse>"0"</cfif>> > > <cfif getReqmts.recordcount is not 0> > > <input type="hidden" name="ETCourseLength#i#" > value="#TRIM(getReqmts.CourseLength)#"> > > </cfif> > > <cfset reqdHrs = reqdHrs + getcourse.HrsLength> > > <cfif (#DateFormat(getReqmts.CompletionDate, "mm/dd/yy")# is not "")> > > <cfset reqdHrsCompl = reqdHrsCompl + getReqmts.CourseLength> > > <cfset TotalHrs = TotalHrs + getReqmts.CourseLength> > > </cfif> > > <tr> > > <td valign="top"><font size=2>#TRIM(selTGNID)# [#TRIM(selTGID)#]</td> > > <td width="11" valign="top" align="center"><font size=2> > > <input type="text" name="ETCompletionDate#i#" value > ="#DateFormat(getReqmts.CompletionDate, "mm-dd-yyyy")#" size=10 > maxlength=10 <cfif getDynamicCourses2.isOnline eq > 1>disabled</cfif>></td> > > <td valign="top" align="left"><font size=2> > > <input type="text" name="ETInstructor#i#" value > ="#TRIM(getReqmts.Instructor)#" <cfif getDynamicCourses2.isOnline eq > 1>disabled</cfif>></td> > > <td valign="top" align="left"><font size=2> > > <input type="text" size=40 name="ETComments#i#" value > ="#TRIM(getReqmts.Comments)#" <cfif getDynamicCourses2.isOnline eq > 1>disabled</cfif>></td> > > </tr> > > <cfelse> > > <input type="hidden" name="ETCourseID#i#" value="0"> > > <input type="hidden" name="ETCourseType#i#" value="0"> > > <input type="hidden" name="ETCourseLength#i#" value="0"> > > <input type="hidden" name="ETSequence#i#" value="0"> > > <input type="hidden" name="ETCompletionDate#i#" value="0"> > > <input type="hidden" name="ETInstructor#i#" value="0"> > > <input type="hidden" name="ETComments#i#" value="0"> > > <tr> > > <td width="40%" valign="top"><font size=2>#TRIM(selTGNID)# [course not > yet available]</td> > > <td valign="top" align="center"><font size=2> > > <input type="text" name="blank" size="10" disabled style="background- > color:CCCCCC"></td> > > <td valign="top" align="left"><font size=2> > > <input type="text" name="blank" style="background-color:CCCCCC" > DISABLED></td> > > <td valign="top" align="left"><font size=2> > > <input type="text" size=40 "blank" style="background-color:CCCCCC" > DISABLED></td> > > </tr> > </cfif> > </cfoutput> > </cfloop> > </table></td> > </tr> > <tr> > <td><table width="90%" align="center" > border="0"> > <tr> > <td colspan="3" > ><hr></td> > </tr> > <tr> > <td colspan="3" > align="center"><font size=2><cfoutput><b>Hours Summary - </b>Required > Courses: #NumberFormat(reqdHrs, "999.99")# - Required Courses Taken: > #NUmberFormat(reqdHrsCompl, "999.99")#</cfoutput> </td> > </tr> > </table></td> > </tr> > <tr> > <td><table width="90%" align="center" > border="0"> > <tr> > <td> </td> > </tr> > <tr> > <td > align="center"><input type="submit" name="submit" value="Process > Update"> > > <input > type="button" name="Cancel" id="Cancel" value="Cancel" > onClick="goCancel()"> > </td> > </tr> > </table></td> > </tr> > <!--- End content here ---> > </td></tr></table> > </form> > </div> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319596 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

