Hello folks!

I have a pseudocode witch I intend to use in PHP. I made this code so I can see what I'm trying to do.
Let me explain a little bit.
I have a Client database designed like this:

TABLES: | client_data | plati |
ROWS IN "plati":| platiID | clientID | SUM | lunaplata | dataplata |
ROWS in "client_data": | clientid | name | ip | email | scadenta |

where lunaplata is the MONTH for witch a user payed for the supscription (January, February, March etc. and they are enumarated), dataplata is the DATE when he payed.
SUM is the sum he payed (for ex: 30EUR)
where scadenta is the day he has to pay in a month: for example 15th of June...but stored as an integer: 15

So here's what I want to do:
1. I want to be able to show the clients who didn't payed for the current month and if they are past due.
2. I want to be able to show a list of Clients who payed for January for example.
3. I want to do a dependent drop down list from wich I can select the month to list wich client payed for that month. and the client name to list the months that client payed for.
4. and if I select a month or a name the page POSTS to itself, refreshes and displays the asked list on the same page.

I think the 3rd point is a little bit fuzzy...but I intend to do it with Drop Down list witch gets it's labels and values from a database.

Can anyone help me with this please?

This is my pseudocode for displaying the clients who didn't payed.

$nr_clienti=sql("select COUNT(clientid) from client_data");
for (int i=0; i<nr_clienti; i++)
$id_client=("select clientid from client_data limit $i,$i")
$scadenta_client=sql("select scadenta from client_data where clientid=$id_client");
$idplata=sql("select idplata from plati where clientid=$id_client and lunaplata=$luna_curenta")
if (i$dplata==null) && (scadenta_client>zi_curenta) 
$client=sql("select * from clienti where clientid=$id_client");
show($client); // shows that client didn't pay and it's past due date
Thanks in advice.