Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ColdFusion Suggestion

Posted on 2009-06-30
6
Medium Priority
?
1,715 Views
Last Modified: 2013-12-20
I have a task which involve a lot decision making. For example, I have the main course. If the there is no completion for that course i need to check the alternative courses, (if there any). If there are alternative course and they done by the date EndDate of the main course the give completion for the main course (all the alternaitives has be done), Also check the prerequsite course. If there are any make sure they are done . If tey not done then grayed out the main course.

What would be best approach to this task. There a lot more criterias for the task But I want to start from the begging.
0
Comment
Question by:erikTsomik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 1500 total points
ID: 24747885
0
 
LVL 19

Author Comment

by:erikTsomik
ID: 24747934
i understand what i need to do , I am looking for the best approach in terms of programming Technics
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 24747989
I was really just a little joke, that's how you answer many of your questions.

Here's my real suggestion.

Make a flow chart which each decision you have to make
Here's a sample image

http://mtanga.com/images/flowchart.jpg

Then you convert each step into coldfusion, perform the needed test using cfquery (or whatever is needed) check it with CFIF and branch down another path.

You can set a series of flags to help keep you organized such as this..

<cfset isCourseCompleted = false>
<cfset isOtherCoursesAvailable = true>
.. etc..

Then you can use this variables in your code along the way..
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 19

Author Comment

by:erikTsomik
ID: 24748080
what I am doing is I am creating a static query for the main course, prereq, and alternative. Then I will combibe all 3 static query in to one ,\

Do you think it will work ???
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 24748124
I think having a query to answer each of the questions you have is good.  
The questions being:  

1) Is the main course completed
2) Are there any alternative courses, are they done by endDate
3) Are there any prerequisite courses, are they done

If you can write a query to answer each of these, I think that will really help you.

I don't think there are any real advantages to combining them into one query.  Just keep them separate, it will be easier to code and debug.  It won't be any slower..



0
 
LVL 19

Author Comment

by:erikTsomik
ID: 24766963
OK. I ve built the the 3 queries and trying to output the result but get the error that query of queries only support 2 tables . Please advice . How can i get around this . I do not really want to use another QofQ

here is how I am outputting
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dynamic Menu System</title>
<style type="text/css">
	body,tr,td,th{font-family:Arial, Helvetica, sans-serif; font-size:14px;}
	html{background-color:#4AA5FF}
</style>
</head>
 
<cfinclude template="DynamicMenu_dataset.cfm">
<cfdump var="#TempQuery#">
<cfdump var="#PreReq#">
<cfdump var="#Alternatives#">
 
<cfquery name="TempQuery" dbtype="query">
	Select *
	from TempQuery,PreReq,Alternatives
	where TempQuery.WorkFlowID = PreReq.WorkFlowID 
	and Alternatives.WorkFlowID = TempQuery.WorkFlowID
</cfquery>
 
<body>
<h2 align="center">Dynamic Menu System</h2>
<table width="50%" border="1">
<cfoutput query="TempQuery" group="workFlowID">
	<cfif DoIseeThelink eq 1>
		<tr>
			<td>#WORKFLOWID#--#MAINCOURSENAME#</td>
			<td>Due Date:#DateFormat(DueDate,"mm/dd/yyyy")#</td>
		</tr>
			
			<tr>
				<td colspan="2">
					<strong>Prerequisites:</strong><br />
				
			
					<cfoutput>#PREREQNAME#</cfoutput>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<strong>Alternatives:</strong><br />
				
			
					<cfoutput>#ALTERNATIVENAME#</cfoutput>
				</td>
			</tr>
			
 	</cfif>
</cfoutput>
</table>
</body>
</html> 

Open in new window

0

Featured Post

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question