This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View Csc317 Answer Scheme Oct 2006 as PDF for free.
claimProcess.asp <%@ LANGUAGE="JAVASCRIPT"%> Claim Process <% var StaffId = Request.Form("StaffId"); var name = Request.Form("name"); var distance = Request.Form("distance"); var position = Request.Form("Positions "); var group = Request.Form("group"); var claimamount; if (distance <= 500) claimamount = distance * 0.6; else { var first500 = 500 * 0.6; var x = distance - 500; var next500 = x * 0.55; claimamount = first500 + next500; } var conObj=Server.CreateObject ("ADODB.Connection"); conObj.Open("claim_dsn");
var sqlStr = "INSERT INTO claimrecord VALUES (' " + StaffId + " ' , ' " + name + " ' , ' " + position + " ' , ' " + group + " ' , ' " + distance + " ' , ' " + claimamount + " ' )"; conObj.Execute(sqlStr); conObj.Close(); conObj = null; %> Record has been saved successfully. Thank you for using this system. Staff Number: <% Response.write(StaffId)%> Name: <% Response.write(name)%> Distance traveled: <% Response.write(distance))%> Position: <% Response.write(position)%> Group: <% Response.write(group)%> Total Claim Amount: <% Response.write(claimamount)%>