Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow How to generate network diagram?

    Hi, I'm Rane and I need some helps!

    I have a member table in MySQL database. Each member have a 'referralID' which indicate their respective referral. The 'referalID' is refer to 'MemberID' field, that is, the referalID must be an existed valid MemberID in the table.

    For example: C is a new member, his referal is B who have 5 subsidiary(C,D,E,F,G). B's referal is A and so on and so forth.


    A
    |
    B
    _______|_________
    | | | | |
    C D E F G


    Now I have to write PHP program to retrieve these information from the database and draw the network diagram to the browser(by automatically).

    I'd write the code to retrieve all members form the table and now I'd stuck here for a day!

    Please do help me! Thank you.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So you know what you've got in the database (by the way, a member that has no referralId, what value is stored there? That's important..).

    What you need is a data structure in PHP called a graph to store the data in your database. You want to have a method of adding to the graph the relations in your database (ie. you need to add a node to your graph, and then add an edge between two nodes in the graph). Then you need a method of printing out the graph based on a root node in the graph.

    I don't know of classes off hand, but I'll take a look for you. But hopefully that gives you a better idea of what you're looking at. If you already knew this, and you're looking for a ready-made script waiting for you, that might not work out so well.

    Also try searching for things like family-trees (although this may limit a node to having only 2 referals.. but that shouldn't be too hard to modify), uml diagramers.. stuff like that.

    Good luck,
    Sadiq.

  • #3
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thank You Sad69

    Dear Sad69, thanks for your reply.

    If a member do not have a ReferalID, the initial value will be 'CompanyName', which means that he/she is a immediate member of our company.

    I've ask a friend and he told me there is no way to display a large family tree/network diagram through the PC's screen and also to the printer.

    So now I'm thinking of discuss this issue with my supervisor and maybe I'll use another method to display it out.

    Thank you.

  • #4
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To design Network diagram or any other flow chart you can use any third party tool, these type of software allows you to design diagrams professionally. So it is recommended that use Network diagram designer software and make perfect network diagrams through its more than 6000 vector symbols.

  • #5
    Regular Coder
    Join Date
    Sep 2002
    Posts
    454
    Thanks
    0
    Thanked 20 Times in 20 Posts
    You would need to check out a 'family tree' or geneology script to see how they process the loops.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •