TrojanFrost 0 Newbie Poster

hi guys.. i really tried many things to solve this problem.. but i really cant figure this out..

i have 2 tables actually its 3 tables but the other is just for the user's account so here it is:

employee table

ins_ID -> pk
emp_ID* -> unique key
last_Name*
first_Name*
middle_Name*
position
pos_Stat* this is enum which can be RnF or M
branch

sample:
ins_ID emp_ID last_Name first_Name middle_Name position
1 727 lname fname mname tester
2 826 lName fName mName tester
3 999 name nam na manager

pos_Stat branch
RnF loc1
RnF loc1
M loc1

RnF is for Rank and File and M for Managers

payment table
payment_ID -> pk
emp_ID*
date*
amount*

sample:
payment_ID emp_ID date amount
1 727 2007-05-26 10.00
2 727 2007-05-27 50.00
3 727 2007-05-28 60.00
5 826 2007-05-26 30.00
6 826 2007-05-27 90.00
8 826 2007-05-29 50.00
9 999 2007-05-26 50.00
10 999 2007-05-27 50.00
11 999 2007-05-28 50.00
12 999 2007-05-29 50.00

i've placed * on the important data's needed in the creation of the report.

now here's the sample report i needed to display after choosing the from and to date..

for example the user chose May 26, 2007 to May 29,2007
it should look like:

i didn't include the first name, last name, middle name its just an example anyways. But if needed it is located just after Emp No.
im using php with html tables here. Any suggestions, comments,
will gladly be appreciated ^^


Emp No. May26 May27 May28 May29 Total
727 10.00 50.00 60.00 20.00 140.00
826 30.00 90.00 10.00 50.00 180.00
999 50.00 50.00 50.00 50.00 200.00

Total - RnF 40.00 140.00 60.00 50.00 290.00
Total - M 50.00 50.00 50.00 50.00 200.00
Grand Total 90.00 190.00 110.00 100.00 520.00

up there is what i cant get.. please help anyone!! thanks..
mine has tons of mysql queries.. im so tired of it T_T

the report feature is the most important part of my system T_T

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.