mindlessLemming
06-11-2004, 02:56 PM
G'day :)
I've found myself flooded by new additions from a client merely a week before beta testing was meant to start ... Contracts,eh? Won't forget next time ;)
Anyway, there is a purpose to this, and that is this:
One of the features requested by the client is a js grants calculator that they use on their intranet. Leaving this as js just ain't gonna happen on my watch, but I'm knee deep in administration sections, access level permissions and other such mumbo. I fear that small things like this calculator might bite me in the butt on the last day and I'm asking if there is a kind soul out their who could take ten minutes of their time to convert this js function to php :o
function calculate(y, e, s){
var rate = [0.4, 0.2, 0.1, 0.075, 0.05];
if(y<3 && e>=20000){var grant = (e-15000)/2;}
else if(e>=20000){
var ge = (e-15000)/2;
var gs = s*rate[y-3];
if(ge<gs){var grant = ge;}
else{var grant = gs;}
}
else{var grant = 0; alert("Applicants need a minimum of $20,000 in eligible expenditure to be entitled to claim.");}
if(grant<0 || isNaN(grant)){grant=0; alert("Check your input and try again.");}
document.gui.grant.value=grant;
}
Thanks in advance if anyone decides to help me out :D:thumbsup:
Andrew.
I've found myself flooded by new additions from a client merely a week before beta testing was meant to start ... Contracts,eh? Won't forget next time ;)
Anyway, there is a purpose to this, and that is this:
One of the features requested by the client is a js grants calculator that they use on their intranet. Leaving this as js just ain't gonna happen on my watch, but I'm knee deep in administration sections, access level permissions and other such mumbo. I fear that small things like this calculator might bite me in the butt on the last day and I'm asking if there is a kind soul out their who could take ten minutes of their time to convert this js function to php :o
function calculate(y, e, s){
var rate = [0.4, 0.2, 0.1, 0.075, 0.05];
if(y<3 && e>=20000){var grant = (e-15000)/2;}
else if(e>=20000){
var ge = (e-15000)/2;
var gs = s*rate[y-3];
if(ge<gs){var grant = ge;}
else{var grant = gs;}
}
else{var grant = 0; alert("Applicants need a minimum of $20,000 in eligible expenditure to be entitled to claim.");}
if(grant<0 || isNaN(grant)){grant=0; alert("Check your input and try again.");}
document.gui.grant.value=grant;
}
Thanks in advance if anyone decides to help me out :D:thumbsup:
Andrew.