views:

267

answers:

2

Hi,

i have a list of say courses and certificates and fun_days. These are all called objects. Every object has its requirements object_requirements. A requirement can be either one of the objects or several of them.

You can take any object without object_requirements as a starting point. "Everybody is allowed to have those objects."

So it could be that:

  • Introduction_course is a starting point (no requirements)
  • Introduction_certificate can be obtained by those who have Introduction_course (this course is a requirement of this certificate)
  • Funday_swimming can be obtained by those who have a Introduction_certificate (the certificate is a requirement of the fun_day).

Is there a way to create a visual representation of the hierarchical or somewhat structured-flow of this system? The example is fairly simple, but multiple requirements anywhere in the 'tree' should be possible.

This is how I store the requirements:

TABLE: OBJECT_REQUIREMENT
 OBJECTTYPE                (pk)
 OBJECTID                  (pk)
 REQUIREMENT_OBJECTTYPE    (pk)
 REQUIREMENT_OBJECTID      (pk)

TABLE: COURSE
 OBJECTID                  (pk)
 OBJECTTYPE                       // value is always [1] for course

TABLE: CERTIFICATE
 OBJECTID                  (pk)
 OBJECTTYPE                       // value is always [2] for certificate

TABLE: FUN_DAY
 OBJECTID                  (pk)
 OBJECTTYPE                       // value is always [3] for fun_day

Oh and I use PHP and MySQL. But any piece of software which could generate these visual representations would be more than welcome also!

+2  A: 

You might consider something like a directed graph, to which this previous SO question might be useful:

http://stackoverflow.com/questions/850031/how-to-do-directed-graph-drawing-in-php

Amber
Just the thing I needed! Gonna look into GraphViz interface in PEAR
Ropstah
A: 
James Black