11
jegelstaff
Re: need module for ratios tracking
  • 2008/12/16 14:44

  • jegelstaff

  • Module Developer

  • Posts: 518

  • Since: 2004/7/2 2


Sure, Formulize could do something like this in a few ways. Here's a simple way:

1. Create a form with all the services/products people can choose. It would be a set of checkboxes presumably.

2. Also add name, address, etc. to the form.

3. Also add a derived value element to the form, this is an element which can do some math based on the other elements in the form. Set this element to be only visible to Webmasters. You will need to write the math part in PHP, it would look something like this:

// I'm assuming the caption of the checkbox series
// is "Choose your services".  You would need to use
// whatever the caption actually is.
$services "Choose your services";
$total 0;
foreach(
$services as $thisService) {
  switch(
$thisService) {
     case 
"Haircut"// use the exact text of the checkbox options
        
$total += 10// haircut costs $10
        
break;
     case 
"Shine shoes":
        
$total += 5// shining shoes costs $5
        
break;
  }
}
$value $total;


So that will add up the value of all the services.

4. Then you need to set the permissions for the form, so Registered users can presumably view the form, and add their own entries, and maybe update their own entries if you are letting people review submissions they have made in the past. Webmasters would have all permissions.

5. Then you need to setup the notification options so you will get notified every time someone fills in the form or updates an entry. Go to the form itself (accessible through a URL like this: /modules/formulize/index.php?fid=1 where the number is the id number of the form you're working with -- ID numbers are visible on the main Formulize admin page). On the fid=1 page, you can click the Notifications button to set the notification options. You want to create a notification that happens when new entries are created, and it gets sent to webmasters, I assume, and you want to use a custom template file for the notification.

In the custom template file, you can include the specific contents of the entry, by referring to the element ID numbers (or the optional data handles if you've specified them...it can be easier to use handles instead of remembering lots of arbitrary numbers). You include the values of the elements in the template by referring to them like this: {ELEMENT_12}, that prints out the contents of element number 12. Or if you gave that element a data handle called "options", then you could do this: {ELEMENT_OPTIONS} (note, it has to be upper case).

So you can include all the things people checked off, and the calculated total, in your message template, so you would get e-mailed when people fill in the form or update it.

You need to put the template file in the modules/formulize/language/[current language]/mail_template folder.

You can setup another notification for when entries are updated, and use the same template, or maybe a slightly modified one.

You can create a menu link to the fid=1 URL to give people access to the form, or use the form menu block. There are some other more advanced things you can do to customize more about how people interact with the form or with lists of previous entries they have made. But this is the basics. If you try this out and this functionality is what you need, then the rough edges can be dealt with. If this is not the actual functionality you need, then maybe there's a different way to construct what you need with Formulize, or maybe there's a different module that would be better.

I hope this helps, let us know how it goes.

--Julian

Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

12
Anonymous
Re: need module for ratios tracking
  • 2008/12/16 16:09

  • Anonymous

  • Posts: 0

  • Since:


Thanks Julian .. honestly it is profissional module

Login

Who's Online

416 user(s) are online (294 user(s) are browsing Support Forums)


Members: 0


Guests: 416


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits