Forums

Create a simple timesheet

bmzed 14 Jan, 2016
Hello everyone,

I want to create a simple timesheet and i'm a bit confused about how to do it correctly.
On the website/article I want to display two Comboboxes, one with the month and one with the year. Further a kind of table with date column, from column, to column and a hour column. Here is a picture

My current progress is, that the correct dates are calculated and filled in the right field with js function if the "Laden" (load)-button is hit. Also the hours calculated with a js function if a from ... to field changed and both are set. The next step to do is the one i'm confused about or have no accurate plan how to do this.
The data should be saved/loaded in/from a external database. The current structure of the database is the following: a single table for every month with ID (int, primary key), Date (date), From (time), To (time), PersonID(int) columns. The PersonID is there to show a logged in user his own data (Joomla user id and the PersonID are the same). But now i'm missing the connection how exactly to save/load the data from my external database into my form. I'm also not sure about whether Chronoforms is the right way to do this or I should better use ChronoConnectivity.


Thanks.
bmzed
GreyHead 14 Jan, 2016
Hi bmzed,

In general ChronoForms is used for entering and editing data and ChronoConnectivity is used to display lists of data from a database table - though you can make the lists editable. I'm not clear exactly what this form is supposed to do? Are you planning to use it for data entry or display or both?

Bob
bmzed 27 Jan, 2016
Hi GreyHead,

thanks for your answer. I found my way to do it now by myself.
But I got 2 more question. First is there a possiblity to update always all entries with the "Update list" Button in Chronoconnectivity?
Further, can I create a customfield which is not saved in the database? For example, I have 2 int-Columns in my db and don't want to save the difference between them, but I want to show them in my front end.

bmzed
GreyHead 27 Jan, 2016
Hi bmzed,

Q1 I don't know, I've never tried to use this button. This FAQ suggests that you can - or you can ask Max exactly what it does using the Contact Us link above.

Q2 You can define a column either by setting an entry in the Fields box on the Models tab to add a calculated column to the DB Query; or you can use the PHP Functions box on the Front List > Settings tab to define a new column using PHP to do the calculation.

If you only need to show the difference then the first of these should work OK.

Bob
This topic is locked and no more replies can be posted.