I need a very simple one or two paged MySQL backed site.
The database will also contain only two or three very simple tables.
The logic is as follows:
The user comes to the page. He writes a person's name in a textbox and a message in a textarea. Then he submits the form. The name and the message is written into the database. When another user has already written a message to the same person's name, then the person has already two messages. One person can have many messages.
After the submit, the person with the message is saved in the database.
The page must also contain a table of the submitted person names along with the newest message associated with him.
Also, the date when the last message was added to the person and a number indicating how many messages this person has.
The user must be saved in the database (and shown in the table) using Ajax, without doing a page refresh.
The user can click on the person's name. When the name is clicked, the person's name with all the messages (with the insertion date) associated to the person are shown below the table.
The table that shows the persons that were inserted should have some features. First, it should not show all the persons at once. Rather, it should show only ten last inserted persons (not persons with the message last added to. I want the last added persons). And there should be another textbox somewhere by which the user should be able to filter the table by persons name. And the table should be scannable by links such as
"prev/first ... 5 6 7 8 ... last/next"
And the table should get the data partially, only the visible part should be selected from the database through Ajax call (without any page refresh).
This page should be also designed to look good.
I also need another PHP page that takes in two GET parameters: "what" and "id" which, when executed, deletes the person with all the messages or deletes only one message, depending on the GET variables' values.
1) when the "what" is "msg" and "id" is "432" then the message with the id of 432 is removed.
2) When the "what" is "psn" and "id" is "947" then the person with the id of 947 is removed with all the messages
that were associated with him.
The page itself may return nothing.
When the last message from the person is deleted through executing this PHP page, the person is also removed from the database.