I have a code on home page and click button to submit user input which is collected in the database. Now I want to calculate 5 fields based on collected data and display it when user put email address in field and click on get report now. Get report now is linked to another page that is where I wish to display data.
export function averagemonthlyshopsales_viewportEnter(event)
{
$w.onReady( function () {
let averagemonthlyshopsales = Number($w(‘#averagemonthlyshopsales’).value);
let averageroamount = Number($w(‘#averageroamount’).value);
let numberoftechnicians = Number($w(‘#numberoftechnicians’).value);
let numberofmanagers = Number($w(‘#numberofmanagers’).value);
let equipmentinvestment = Number($w(‘#equipmentinvestment’).value);
let monthlyfees = Number($w(‘#monthlyfees’).value);
let numberofcarspermonth = Number($w(‘#numberofcarspermonth’));
let techniciansproductivitygain = Number($w (‘#techniciansproductivitygain’));
let bodylabordollarssaved = Number($w(‘#bodylabordollarssaved’));
let managerproductivitygain = Number($w(“#managerproductivitygain”));
let managerlabordollarssaved = Number($w(‘#managerlabordollarssaved’));
let totalannualsavings = Number($w(‘#totalannualsavings’));
let additionalrepaircapacity = Number($w(‘#additionalrepaircapacity’));
let additionalsalescapacity = Number($w(‘#additionalsalescapacity’));
}
export function calculateroi_click(event) {
techniciansproductivitygain = ((((numberoftechnicians) * (.5)) * 21) * 12);
bodylabordollarssaved = techniciansproductivitygain * (24);
managerproductivitygain = ((numberofmanagers * 21) * 12);
managerlabordollarssaved = managerproductivitygain * (35);
totalannualsavings = (bodylabordollarssaved + managerlabordollarssaved);
additionalrepaircapacity = (techniciansproductivitygain / 20);
additionalsalescapacity = (additionalrepaircapacity) * (averageroamount);
}
I tried to get the result on the same page but getting some errors, so my code is not correct. Could anyone look into it and check what is that I am doing wrong?
I would appreciate help with how to do database calculations and display it on totally different page after clicking on get report button. Thank you!