问题
We are creating a website on buses and booking tickets for the same. Here the admin expects to create and modify the seating arrangement using drag and drop (including the driver's seat) according to his wish.
This seating arrangement is to be maintained / recorded in a database table (in mysql). The table structure talked about in saving seat arrangement in Mysql table seems to be pretty close to the one we are looking for
The non-feasible part for us is the drag and drop and its maintainance in a mysql database table which is expected to be responsive to every drag and drop and should update itself accordingly.
I am sure somebody is going to come to out with a solution.I guess ajax could be used but we are pretty much new to ajax. Therefore I would really request an elaborate reply if someone comes out with a solution in ajax.
(N. B.: Coding is to be done in php)
回答1:
Your requirement could not only be fulfilled by only PHP, you need to use javascript/jquery and html5 as well..
Here is a good example of drag and drop jquery and retrieving the array.. A demo and download is available there for the example..
http://www.webresourcesdepot.com/dynamic-dragn-drop-with-jquery-and-php/
and also have a look at this..
http://devheart.org/examples/jquery-customizable-layout-using-drag-and-drop/2-saving-and-loading-items/index.html
来源:https://stackoverflow.com/questions/22086497/drag-and-drop-seating-arrangement-in-php