d42mcy
12-11-2009, 07:56 AM
Firstly I apologize if this is the wrong forum, I wasn't too sure of where to post it as my problem covers several areas.
I have been writing a 'Facebook Application' which is primarily in PHP. It is about the economics of futuristic spaceship production. I have done the bulk of the game mechanics in PHP and have set about making the interface.
I am stuck on a page which can be viewed here (http://faceappz.com/sa/test.php) where you can employ workers to work in your mines/factories.
Each worker has five skill types (worker, miner, manager etc...) and to be employed he must be offered a contract for one of those skills.
The process of employing someone works like this.
1. You search for the 'type' of worker you want.
2. Search Results are shown.
3. You click on the name of the person you want to employ.
4. A new form appears (under the table) for you to fill in the contract details.
5. The person (PHP function!) rejects or accepts the contract.
If you look at the link above you will see I've made a search box which uses AJAX/html/php to make the table (which I'm quite proud of as I'm a bit of a noob when it comes to javascript/ajax). Ive come unstuck as to how to select which worker to offer a contract to. What needs to happen is:
1. The name or a tick box is selected.
2. It sends some form of unique identifier back to the same page so the form (to offer a contract) knows which person in the table is being referred to *preferably without a page refresh*.
Any help/advice would be greatly appreciated. I'm assuming I'm going to need to use some form of get/post and ajax but i cant figure out how to do it.
I hope all this makes sense.
I have been writing a 'Facebook Application' which is primarily in PHP. It is about the economics of futuristic spaceship production. I have done the bulk of the game mechanics in PHP and have set about making the interface.
I am stuck on a page which can be viewed here (http://faceappz.com/sa/test.php) where you can employ workers to work in your mines/factories.
Each worker has five skill types (worker, miner, manager etc...) and to be employed he must be offered a contract for one of those skills.
The process of employing someone works like this.
1. You search for the 'type' of worker you want.
2. Search Results are shown.
3. You click on the name of the person you want to employ.
4. A new form appears (under the table) for you to fill in the contract details.
5. The person (PHP function!) rejects or accepts the contract.
If you look at the link above you will see I've made a search box which uses AJAX/html/php to make the table (which I'm quite proud of as I'm a bit of a noob when it comes to javascript/ajax). Ive come unstuck as to how to select which worker to offer a contract to. What needs to happen is:
1. The name or a tick box is selected.
2. It sends some form of unique identifier back to the same page so the form (to offer a contract) knows which person in the table is being referred to *preferably without a page refresh*.
Any help/advice would be greatly appreciated. I'm assuming I'm going to need to use some form of get/post and ajax but i cant figure out how to do it.
I hope all this makes sense.