Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Calculate data from different feilds and show 08 Apr 2013 00:50 #7031

Hi, not a coder :blink: so not even sure where to start.

I have a small number of fields in a monthly report entry form.

- Hours worked
- Total of entry type one
- Total of entry type two
- Total of entry type three
- Total of entry type four

I need to have the following results to be auto calculated and inputed into separate fields once the form is refreshed (or saved) or when ever it is best to happen.

- Total of entry type four x 1000'000 / Hours worked
- Total of (Total of entry type one + Total of entry type two + Total of entry type three + Total of entry type four) x 1000'000 / Hours worked.
- Total of (Total of entry type two + Total of entry type three + Total of entry type four) x 1000'000 / Hours worked.

Hope that is enough information and thanks in advance to anyone is able to help.

Please Log in or Create an account to join the conversation.

Re: Calculate data from different feilds and show 09 Apr 2013 03:54 #7034

Hey Jonathan,

Seems like you're working on some kind of risk-analysis tool ;)

For this kind of job, you'll really have to get into the source a tiny bit...

For starters, I'd be reluctant to have these fields into the database as they are easily autogenerated... (only exception I could think of: if some other program extracts data from the database that is too stupid to do the calculations itself)

So basically, you'll have to change what you get to see... (in the "MVC" lingo... this is what the V stands for: VIEW)
So you go to the VIEWS directory (be it admin or site, depending on frontend or backend), and select the view you want to edit (you named those views in your pages tab or J-Cook).
In here you have a file called view.html.php and a folder called tmpl. These two are of importance.
In the tmpl folder, you basically have HTML pages with some added PHP snippets to put the dynamic content inside. Reading this shouldn't be that difficult...

I hope you'll have a start with this...

Grtz,
Jurgen.

Please Log in or Create an account to join the conversation.

Re: Calculate data from different feilds and show 09 Apr 2013 19:16 #7037

Ah yes you right I am. I am more of a HSEQ professional rather than a programmer, but have a few skills so thought I would have a go at creating my own online risk system. One way to keep the brain ticking. I'll have a look at the templates and see what I can manipulate. Thanks for the response. :)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.078 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started