Displaying Timesheet Records in Calendar Style View
hey peeps!
Currently having a little problem with trying to produce something and wonder if anyone out there can help.
I have 2 tables which contain the following fields;
# TABLE: time #
time_id
time_duration
time_task
time_datestamp
time_staff_id
time_project_id
time_task_id
time_desc
# TABLE: task #
task_id
task_title
task_desc
These tables are linked on IDs which im sure everyone can easily see from the names.
I want to pull the data from the tables and display the results so it looks something like:
[tt]
TASK/JOB | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|04/07/2004|05/07/2004|06/07/2004|07/07/2004|08/07/2004|09/07/2004|10/07/2004|
--------------------------------------------------------------------------------------------------
Task ID: 2 | Add | 4.5hrs | 3hrs | Add | Add | 2hrs | Add |
Desc: Doing summin | | | | | | | |
--------------------------------------------------------------------------------------------------
Task ID: 4 | 2.3hrs | 1.5hrs | Add | Add | 8hrs | 4hrs | 1hrs |
Desc: Doing summin2 | | | | | | | |
--------------------------------------------------------------------------------------------------
[/tt]
I just want to know what would be the best way to achieve this?
Like loop through the current week and select the data from the database each time i move onto a new day.
Or pull all the data, for the displayed week, from the database (WHERE clause time_datestamp >= 04/07/2004 AND <= 10/07/2004). I am currenly pulling all the data from the database using the WHERE clause above but when it comes to displaying the data as above I am unsure as to how to achieve this.
Any tips, hints would be much appreciated. EVen if its to say im going about it completely wrong. Something is better then nothing.
Thanks peeps!
- FateFirst
hey peeps!
Currently having a little problem with trying to produce something and wonder if anyone out there can help.
I have 2 tables which contain the following fields;
# TABLE: time #
time_id
time_duration
time_task
time_datestamp
time_staff_id
time_project_id
time_task_id
time_desc
# TABLE: task #
task_id
task_title
task_desc
These tables are linked on IDs which im sure everyone can easily see from the names.
I want to pull the data from the tables and display the results so it looks something like:
[tt]
TASK/JOB | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|04/07/2004|05/07/2004|06/07/2004|07/07/2004|08/07/2004|09/07/2004|10/07/2004|
--------------------------------------------------------------------------------------------------
Task ID: 2 | Add | 4.5hrs | 3hrs | Add | Add | 2hrs | Add |
Desc: Doing summin | | | | | | | |
--------------------------------------------------------------------------------------------------
Task ID: 4 | 2.3hrs | 1.5hrs | Add | Add | 8hrs | 4hrs | 1hrs |
Desc: Doing summin2 | | | | | | | |
--------------------------------------------------------------------------------------------------
[/tt]
I just want to know what would be the best way to achieve this?
Like loop through the current week and select the data from the database each time i move onto a new day.
Or pull all the data, for the displayed week, from the database (WHERE clause time_datestamp >= 04/07/2004 AND <= 10/07/2004). I am currenly pulling all the data from the database using the WHERE clause above but when it comes to displaying the data as above I am unsure as to how to achieve this.
Any tips, hints would be much appreciated. EVen if its to say im going about it completely wrong. Something is better then nothing.
Thanks peeps!
- FateFirst