>Ya know if that tree was flattened into a few database tables, it'd all be >much easier :-) >-- >Tom Chiverton >Advanced ColdFusion Programmer
The information comes from 4 tables. There's many more fields in each table, but here is the short break down. Project_table Proj_id Proj_name WorkPlan_id Task_table Task_id Task_name Proj_id Cost_id Task_lvl(works with the Task_number, 1(is lvl 1), 1.1(lvl 2), 1.1.1(lvl 3) and so forth) Task_number(this is the closes to linking parent/children, the numbers are 1, 1.1 1.2, 1.1.1, 1.1.2) So a task with number 1.1 is a child to 1 Cost_table Cost_id Cost_area Hours_table Task_id Task_name Person_name Hours Cost_per_hour Worker_type What is wanted is, put a workplan_id in and get all projects/tasks/person(cost/hours). Hope I can explain this, :o) All Projects and tasks need to be displayed(whether hours are logged against it or not). The display is hierarical(much more graphical, lol): Project_name --1 Task_name --1.1 Task_name ----1.1.1 Task_name ----1.1.2 Task_name --------Person_name: Hours/cost --------Person_name: Hours/cost --2 Task_name ----Person_name: Hours/cost When a user mouses over the project_name or task_name, they get a popup display with roll ups for that lvl(ie. Mouse over 1.1 would include 1.1,1.1.1, 1.1.2). Mouse over the project_name gives the over all totals for the whole project. These are boken out into: Total: hours/Costs; Totals by Worker_type1: hours/costs; Totals by Worker_type2: hours/costs;(etc..) Totals by cost_area1: hours/costs; Totals by cost_area2: hours/costs;(etc..) I do two queries that populate/create the structure. The first links: Project, Task and Cost Tables and creates the main structure. The second gets the information from the hours table and adds it to the structure(per examples in previous emails). While adding the worker information, the totals are also calculated and placed in the structure. Then loop thru the structure to create the displays. The other ways I could come up with had me looping thru queries multipule times while creating the display, which was slower. If there is a better way to do this, please let me know. I don't really like the way I am doing it, but unfortunetly I havent come up with anything better and I do seem to do things the hard way. Thanks Rodney ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238129 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54