Help with building a quote calculator

hmm.

ok Hello World with single quotes, redirects me to the home page, with double quotes it redirects me back to the form with no "Hello World" printed anywhere.

Code:
echo "<pre>";print_r($formModel->_formData);exit;

..redirects me back to the form with no results.
 
Strange.
Which exact fabrik version are you running? (GitHub update?)
Do you have other form plugins added?
 
Fabrik 3.0.8, updated from Github on Thursday or Friday I think.
The only thing I've activated since updating from Github was the calc element to see if that wouldn't work, but it's not going to work for what I need to accomplish with this.

I have another form which just acts as a regular search form. That has the redirect plugin activated.
 
do you think I might have run into a bug here? I've double checked everything so many times now that I doubt that it's still an issue on my side.

If you want I could maybe give you access to the site? if it's not too much trouble for you of course...
 
everyone that's been helping me with this so far, thank you very much. does anyone know how i can get hold of rob or hugh? i've sent them a message via the site contact form more than a week ago. i need to get a quote from them so that i can see whether i can afford to maybe just get them to build this thing for me. i've also messaged rob via the forum, but have had no luck with a reply.
i'm running our of time now with this client and don't have time anymore to battle like this. who knew getting some form data into variables can be such a difficult task!!
 
something really bizarre is going on now. once again i'm trying today to get my form data returned and the weirdest thing has now started happening. when I submit the form, i get redirected to a search form I had built previously.

there is a serious bug here in the system.

is there really no-one that can help me out here?
 
Sounds very strange.
Is this with all browsers?
Did you clear Joomla and Browser cache?
Do you have any 3rd party components/plugins (especially css and JS compressing ones)?
Did you try with a standard Joomla template?
 
hi troester. thanks for all you help so far. i decided to count my pennies and upgrade to professional support. i've been in email contact with Rob, so will see what happens next.
Joomla cache cleared, haven't tired browser cache. no other plugins except JCE, but don't have it's cache-ing enabled.
haven't tried a the standard joomla template...

...will get back to this
 
Hi Jack

I've move this one to pro.

Thanks fro the email explaining things, what you are after is highly complex. Can you post a URL to the site you are currently working on? And fill in the site's details in http://fabrikar.com/you/my-sites/ so we can log in and view what you are doing. You'll probably need to give us ftp access as well as no doubt we will be updating the PHP calculation file.

Would it be ok for me to post the csv file you emailed me to this thread (as it explains what it is you need) - or is that confidential?

-Rob
 
will those records at /my-sites/ be private?

it would be great to share that csv file here, but i think we should rather keep it private. a screenshot of that excel spreadsheet with the form we're after will be ok though? at least it helps to visually show what the result is to be.

thanks for the help!! i can feel my stress level over this project coming down a bit now... :p
 
will those records at /my-sites/ be private?


Yes, only you, me and Rob can see them.

Although of course as the data is on the server, its always possible it could be hacked, or bitrot might set in and cause it to be displayed when it shouldn't. But we do make every effort to keep it private.

So as the notes say on the form, use a dedicated account for us, not your main admin, and shut it down when it's not needed.

-- hugh
 
Hi

I spent a couple of hours on this today.
Here's what I've done.

First I created a new list to store the plan names called 'Medical Aid Names'
Then I edited the main 'Medical Aid Plan Rates' list's element 'Medical Aid Name' and changed that to a database join element and re-edited all the records to replace the string value with the db look up from 'medical aid names' list.
(As soon as you see yourself typing in the same value into several records, you should stop and re-consider your database design as the structure is not normalized. This can lead to discrepancies in the data as records are e added/edited etc. The way I have updated it means that the plan name is managed from a central table, and all other lists/tables/elements that need to use those strings reference that master table.)

Then I edited your PHP calc.

First of all you had it running only when users EDITED the form, but as its not storing to the database edit is not possible. I set it to run on BOTH. This is probably where a lot of your confusion about it not working comes from?

I then updated the script for reference here's what I did:

PHP:
<?php
 
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
 
$session = JFactory::getSession();
$data = $formModel->_formData;
 
// The search criteria.
 
$children = (int) $data['___nr_child_dependents'];
$adults = (int) $data['___nr_adult_dependent'];
$salary = (float) $data['___gross_salary'];
 
// Get all the plan rates
 
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('r.*, n.name AS med_aid_label')->from('medaid_plan_rates AS r')
->join('INNER', 'med_aid_names AS n ON n.id = r.med_aid_name');
$db->setQuery($query);
$planRates = $db->loadObjectList();
 
 
/*
 * Calculate the plan costs based on the search criteria. Store in session.
 * 'Calculation result' list has calc elements which then query the session.
 */
 
foreach ($planRates as $planRate)
{
$key = $plan->plan . '.' . $plan->med_aid_name;
if ($children <= $planRate->child_depend && $adults <= $planRate->adult_depend)
{
// The plan is available for the # children/adults
$total = $plan->member_rate + ($adults * $plan->adult_depend) + ($children + $plan->child_depend);
 
// echo "$key = $total <br>";
$session->set($key, $total, 'calc');
}
else
{
// Its not available so clear out old calcs.
$session->clear($key, 'calc');
}
 
}

So when someone submits a search the plans are queried and any acceptable plans are calculated and the cost stored in Joomla's session.

Then I created a new list called 'Calculator results'.
I added two example calculations elements to this list for the first three columns. '
Basic / low savings', '
Hospital', 'Only savings'


Each one has a calculation similar to:

PHP:
$session = JFactory::getSession();
$key = 'Hospital Only.{medaid_calculator_results___medical_aid_name_raw}';
 
return $session->get($key, null, 'calc');

You should be able to replicate these elements for the other plans. Although I see you have 2 sections in plan_rates with the same name 'Savings' - not sure why? But this should be changed I would think. Again that's another reason why probably plan_names should be a look up list, so you can have 2 labels 'Savings' each with a unique reference which would distinguish in your data one 'Savings' from another.
 
ok thanks so much Rob. I had a quick look at what you've done and I can see the sense in it. I still need to sit down with it now and properly work through it.

I think there might be some confusion with the 'Savings' that you're talking about. If you look at that excel spreadsheet with the form I sent you, you'll notice that the plans are broken up into 2 different kinds of plans, namely, Free Choice Options and Network options. That was another difficulty that I haven't gotten to yet, but I need to somehow get those table headings above those columns. It is the reason why I didn't think a list result might be the way to go (can you perhaps suggest a way around that?). You'll see there are a few columns in those two groups that have the same name. Savings, Hospital Only, Middle Plan, Higher Benefit, those are all repeated plans. Is this what you were talking about?

Then of course, there is still the Primary Care options that I need to work in. the ones that use the "Gross Salary" result to calculate.
 
can anyone please help me? i signed up for professional support hoping that i will get faster feedback, but this is the same as the community forum... rob, hugh, how do I get hold of you guys? i realise you guys are busy, but we're all busy and we all want to get our projects done and dusted.
 
i've removed the redirect you placed on my form rob and am trying to simply display the results from the entered form but i get redirected to the form again without any results. how do i at least just get any kind of info from input provided in the form?
 
I'm coming in to this one late, so I'm not sure what needs doing. If you want to hit me up on the live support link, and walk me through what Rob has done so far, I'll see what I can do.

Yes, we need to do a better job at responding faster for Pro support, but we have to also find a compromise between "support" and "custom development". This sounds more like a "custom development" job where you need us to simply do the work for you, rather than us help you do the work.

But I'll do my best to help, if you grab me for a live chat.

-- hugh
 
hi hugh. it's kind of reached a point where i've asked rob to give me a quote as the simplest things just don't seem to want to work and i don't know if it's me or fabrik. i've still been going at it though. i was just about to switch my phone off and go to sleep now. when is a good time to catch you online tomorrow?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top