zgkhoo Posted August 12, 2007 Share Posted August 12, 2007 how to use php display a organization structure chart? which all these human resource data save in mysql thanks. Quote Link to comment https://forums.phpfreaks.com/topic/64523-solved-how-to-use-php-display-a-organization-structure-chart/ Share on other sites More sharing options...
nloding Posted August 12, 2007 Share Posted August 12, 2007 Too vague, I'm not going to code the entire thing for you. Try something, post some code. In general, you need a relational database designed that shows the relationships between the departments, staff, whatever you're organizing. Then you need to decide how you want it displayed on the website and create the HTML template for it. Then you create your backend queries (the PHP part) to fill that template with the info you want. Quote Link to comment https://forums.phpfreaks.com/topic/64523-solved-how-to-use-php-display-a-organization-structure-chart/#findComment-321662 Share on other sites More sharing options...
Barand Posted August 12, 2007 Share Posted August 12, 2007 With any chart of this type you need a data structure which holds a parent id for each item. The "parent" in the case of an organisation chart would be the person's boss. You then need a recursive algorithm to create a box for a person with lower level boxes for the people reporting to that person. Each of the lower level boxes then have lower level boxes for people reporting to them and so on. You would probably have to do two passes on the data, the first to find out the max number at the bottom of the pyramid, and how many levels, so you know how to to size/scale it. The second pass can then draw it. Quote Link to comment https://forums.phpfreaks.com/topic/64523-solved-how-to-use-php-display-a-organization-structure-chart/#findComment-321666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.