LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Generating report
Posted:  06 May 2014 11:40

I use luxcal for our staff shift schedules and there's a requirement to generate a timesheet report each month. The search function in luxcal more or less does the job of giving the necessary information however I wish to view it on a different format.

We configured luxcal in a way that the "Event" name is the employee name.

At the moment if I search for the event name (in this case the employee name), it gives me the information I need however I wish to view it on a certain format and with some category filtering because I only want to include certain categories. Here's a sample of a view I wish to get:

Category     Day                      Time in     Time out     Total Hours
Early shift    Thu 1 May 2014     06:30       15:30          9

Can you please give a me a mysql query or something so I can get these data from the database so that I can create a page with the format I want.

Thanks in advance!
Posted:  06 May 2014 15:12
Just an update, I tried this:

SELECT * FROM mycal_events WHERE title='xxxx' AND category_id='x';

It basically shows the info I need but I have a problem with recurring events, how can I query the database within a time period (i.e. from 1 May - 31 May only)?

Posted:  06 May 2014 15:31   Last Edited By: Roel B.
Hi there,

Querying the database and processing recurring events is quite a job. The good news is that this is already done for you!
The function 'retrieve' in the file common/retrieve.php is doing exactly what you want.
This function works as follows:

function call:


Where $sDate is the start date and $eDate is the end date. Format of both fields 'yyyy-mm-dd' (ISO format)

The function returns an array called $evtList with all events found (including recurring and multi-day events), which is a multi-dimensional array:
- 1st dimension: date (yyyy-mm-dd)
- 2nd dimension: array with all event data

How the array with event data is filled, you can see on lines 163 - 218 of the file 'common/retrieve.php'

An example of how the $evtList is processed can be found for instance in the file 'views/month.php' line 25 - 65.

Hope this helps.