views:

68

answers:

2

Hi

I'm just after a bit of advice - I am building an online store (using php/mysql) and at present can view current orders by clicking through to the relevant section and applying filters etc. An email is also sent to my inbox.

Because of the nature of the business (orders need to be prepared and dispatched within half hour), I would like to have a page on my website that displays orders 'live' as they come through the website, that I can manage and mark off as they are fulfilled.

What would be the best approach to take for this??

+3  A: 

Using AJAX and a Comet based approach.

Basically you have a Web page showing "live" orders that has an AJAX query constantly running and hitting a PHP page that effectively polls for live orders and then sleeps for 1-30 seconds (depending on how responsive you need it to be). You need to set the max execution time to 0 so it never ends.

The Webpage will also have to detect when it closes (or the user moves to another page) and kill the AJax request and also restart it if it errors or times out.

cletus
+1  A: 

If you dont mind digging deep and making the solution work for you, you know what I would do?

Turn it into a Vista Sidebar gadget or some other gadget. All of them are HTML/Javascript based. If you go the sidebar route, you don't even need to keep the browser open.

Just thinking about loud. Technically though, Cletus is pretty much right on the money. I'm just thinking of the later on top of the HTML :-)

Cory R. King
Thanks for the extra suggestion - I'm on a bit of a tight deadline and so cannot implement anything like this just yet, but it's definitely a great idea and the next route to take once I have time :)
Tray