Hi,
Don't ask for someone else to write code for you in this forum ...
(..unless you want to pay for this. Then place your post in the "jobs" section of the forum)
A forum is meant to help you to rectify your code. This means:
* You look for informations on how to solve the problem
* you try to find the solution on your own
* you write the code on your own
* you test the code
in case of problems:
* you show us your code
* you give detailed error description
* and test conditions.
--> then there are many people here in the forum to help you
Klaus