Main Content

Planning a hotel refurb - an example of a Gant chart in PHP

Archive - Originally posted on "The Horse's Mouth" - 2006-05-14 16:29:01 - Graham Ellis

We're planning for a grand opening in the Autumn of Well House Manor, and we've a very great deal to do ahead of time. A sound building, 100 years old, is showing the signs of age in a frumpy decor, an access that's suitable for the horse and cart era, and a garden where the Leylandia towers above the neighbour's houses. What a lot to plan (and to pay for!), and that dreaded fear that something will be overlooked - that we'll end up without mirrors for the bathrooms, coffee beans for the coffee machine, or staff aprons for the kitchen a few days before we open.

Lisa and I have spent much of the weekend getting tasks and purchase lists together, and entering them; I've gone for a plain text file just at first - a "spike" solution and test of concept that may migrate to a database, and as we all want to see the data through our browsers, I wrote a piece of PHP code this morning to display it.



Yes, it's a Gant chart ... I did a module on Critical Path analysis, Gant charts and all the rest at University way back 'when', and it all came flooding back!

Interesting to note too that as I started to write the code associated with each task, including correlating it with other tasks and analysing specification strings, I came down to writing my task handlers via a PHP class - that way, I can encapsulate all the awkward data handling and heterogenous mix of variables I need to hold for each task in an object, and just pluck information out as I need it; the display you see above is the first I've produced, but I'm sure it's the first of many I'll be producing with the same data yet my once-only class writing is already complete and I'll just need to extend that a little as the project progresses.

You're very welcome to view my source code if you wish - we teach this sort of technique on our Object Orientation in PHP course which next runs on 7th July if you want to know more.