'Live orders' view on website - Advice needed!

怎甘沉沦 提交于 2019-12-24 06:03:28

问题


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??


回答1:


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.




回答2:


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 :-)



来源:https://stackoverflow.com/questions/693905/live-orders-view-on-website-advice-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!