%@LANGUAGE="VBScript"%> <% TOTAL = 0 ERRTEXT = "" if request("CALC") = "yes" then SALARY1 = Request.Form("SALARY1") SALARY2 = Request.Form("SALARY2") if isnull(SALARY1) or SALARY1 = "" then SALARY1 = 0 if isnull(SALARY2) or SALARY2 = "" then SALARY2 = 0 if SALARY1 = 0 and SALARY2 = 0 then ERRTEXT = "Both salaries are empty." if isnumeric(SALARY1) = false then ERRTEXT = "Your salary does not contain a valid amount." if isnumeric(SALARY2) = false then ERRTEXT = "Your partner's salary does not contain a valid amount." if isnumeric(SALARY1) = false and isnumeric(SALARY2) = false then ERRTEXT = "Both salaries do not contain valid amounts." if ERRTEXT = "" then SALARY1 = cdbl(SALARY1) SALARY2 = cdbl(SALARY2) if SALARY1 > 1000000 then ERRTEXT = "Your salary is higher than the maximum possible for the calculator." if SALARY2 > 1000000 then ERRTEXT = "Your partner's is higher than the maximum possible for the calculator." if SALARY1 > 1000000 and SALARY2 > 1000000 then ERRTEXT = "Both salaries are higher than the maximum possible for the calculator." end if if ERRTEXT = "" then if SALARY1 > 0 and SALARY2 > 0 then TOTAL = (SALARY1 + SALARY2) * 3.4 TOTAL1 = SALARY1 * 5 TOTAL2 = SALARY2 * 5 if TOTAL < TOTAL1 or TOTAL < TOTAL2 then if TOTAL1 > TOTAL2 then TOTAL = TOTAL1 else TOTAL = TOTAL2 end if elseif SALARY1 < 0 or SALARY2 < 0 then ERRTEXT = "Please make sure salaries contain postive numbers." elseif SALARY1 > 0 then TOTAL = SALARY1 * 5 elseif SALARY2 > 0 then TOTAL = SALARY2 * 5 else ERRTEXT = "Please make sure salaries contain postive numbers." end if end if end if %>
|
|||||||||||||||
|
| Web Design & Hosting by NHN |