i want to enforce security in my my prg comprising of asps. the first ASP will read the username and the password which will be remembered by the other ASPs. i want to use cookies to do the above. the following is the ASP that will read the login information:-
<%
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''
' default.asp
'
' This page is where users request authorization for using the
' application. If a user has lost his connection to the application
' he is directed back to this page to login again.
'
' If a user attempts to login through this page and he does not have
' an account setup in the database, he will not be able to use any
' part of the application.
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''
' This function is called when the page is loaded to check the
' username and password submitted by the user.
'
' If the username and password are valid for logging into the
' database, then access to the application should be granted
'
Option Explicit
Response.Expires = -1 ' Do not cache this page
Login Request("username"), Request("password")
Private Sub Login( username, password )
' Currently any username and password is accepted
' This procedure needs to be enhanced to enforce the security model
If Request("Username") <> "" and Request("Password") <> "" Then
Response.Redirect("mainfra
me.asp")
End If
End Sub
%>
<html>
<head>
<title>AIIMS2000(tm) Login...</title>
</head>
<body style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt" topmargin="1" leftmargin="1" background="images/fv_back
.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="4" height="412">
<tr>
<td width="100%" style="COLOR: #ffffff" bgcolor="#000000" height="79" background="images/bannerb
g.bmp" style="background-repeat:n
o-repeat;"
>
<p><img border="0" src="images/bannertitle.gi
f"></p>
</td>
</tr>
<tr>
<td width="100%" height="317" >
<form method="post" action="Default.asp">
<table border="0" cellpadding=2 cellspacing=0 style="background-color: #c0c0c0; font-family: Verdana; font-size: 10pt; border: 1px solid #000000" align=center>
<TR><TH color="#ffffff" bgcolor=navy colspan=2><P align=left style="COLOR: white">Login...</P></TH></
TR>
<tr>
<td height=40> User Name</td>
<td height=40><input name="Username"> </td
>
</tr>
<tr>
<td height=40> Password</
td>
<td height=40><input name="Password" type="password"> </td>
</tr>
<tr><td colspan=2 align=right><input type="submit" value="Login..." name="login"></td>
</tr>
</table>
</form>
</td></tr>
</table>
</body>
</html>
the following is the ASP that will remember the password read by the login ASP.:-
<%
OPTION EXPLICIT
Response.Expires = -1
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' This page performs all of the ASSET CRUD functions.
'
'
' Functions implemented in Phase I
'
' 1) Create New Asset Records
' 2) Edit existing asset records
' 3) View an asset's history
' 4) Delete an asset record
'
' Functions to be added:
'
' 5) Reclass
' 6) Improve
' 7) Transfer
' 8) Dispose
' 9) View Image
'
' Besides all of these functions, this page also defines the user-
' interface for viewing asset records.
'
' This ASP is particularly large and should be broken into several
' smaller pages. There should be one page to display the asset
' record and Each additional page should perform an action on a record
' and then call Redirect() to load the asset back into the frame.
'
' If the functions that have to be added to this page are not separated
' into new pages, this page will grow to nearly 2000 lines which is too
' large to maintain efficiently.
'
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
%>
<html>
<head>
<meta http-equiv="Content-Langua
ge" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Asset Record</title>
<base target="_self">
</head>
<script language=vbscript><!--
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
'' Record Locator Tags are dynamically generated by this Visual Basic
'' Code. The RLT is a random ten digit number.
''
Sub setRLT()
Dim mbRet, strNum 'value returned by msgbox / new rlt
mbRet = 6 '
If Len(assetForm("rlt").value
) > 0 Then
mbRet = MsgBox("This record already has an RLT set. " & _
" (RLTs should only be changed if the physical label has been replaced on the asset!)" & _
Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Are you certain you want to change it?", _
vbYesNoCancel, "Change RLT?")
End If
If mbRet = 6 Then
Randomize
strNum = CStr(Round(CDbl(Rnd * 9999999999 + 1)))
While Len(strNum) < 10
strNum = "0" & strNum
Wend
assetForm("rlt").value = strNum
assetForm("chrlt").value = 1
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
'' After quantity has been entered, uniticost and totalcost must be updated.
''
Sub blurQuantity()
Dim qt, tc, uc
qt = CLng( "0" & assetForm("quantity").valu
e ) ' Quantity
uc = CDbl( "0" & assetForm("showunitcost").
value ) ' Unit Cost
tc = CDbl( "0" & assetForm("showtotalcost")
.value ) ' Total Cost
If qt <= 0 Then ' Don't allow a quantity less than 1
qt = 1
assetForm("quantity").valu
e = 1
End If
If uc > 0 Then
tc = qt * uc
assetForm("totalcost").val
ue = FormatNumber(tc,2,true,fal
se,true)
assetForm("showtotalcost")
.value = tc
ElseIf tc > 0 Then
uc = tc / qt
assetForm("unitcost").valu
e = FormatNumber(uc,2,true,fal
se,true)
assetForm("showunitcost").
value = uc
Else
assetForm("unitcost").valu
e = 0
assetForm("totalcost").val
ue = 0
assetForm("showunitcost").
value = "0.00"
assetForm("showtotalcost")
.value = "0.00"
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Cost should be selected(hilited) when it receives focus.
'
Private Sub focusCost()
window.event.srcElement.se
lect
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' After unit cost has been changed, total cost must be re-computed.
'
Sub blurUnitCost()
Dim qt, tc, uc
qt = CLng( "0" & assetForm("quantity").valu
e )
uc = CDbl( "0" & assetForm("showunitcost").
value )
tc = CDbl( "0" & assetForm("showtotalcost")
.value )
If qt <= 0 Then
qt = 1
assetForm("quantity").valu
e = "1"
End If
If uc < 0 Then
assetForm("totalcost").val
ue = "0"
assetForm("showtotalcost")
.value = "0.00"
ElseIf uc >= 0 Then
tc = qt * uc
assetForm("totalcost").val
ue = tc
assetForm("showtotalcost")
.value = FormatNumber(tc,2,true,fal
se,true)
End If
assetForm("showunitcost").
value = FormatNumber(uc,2,true,fal
se,true)
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' After total cost has been changed, unit cost must be recomputed.
'
Sub blurTotalCost()
Dim qt, tc, uc
qt = CLng( "0" & assetForm("quantity").valu
e )
uc = CDbl( "0" & assetForm("showunitcost").
value )
tc = CDbl( "0" & assetForm("showtotalcost")
.value )
If qt <= 0 Then
assetForm("quantity").valu
e = "1"
qt = 1
End If
If tc < 0 Then
assetForm("showtotalcost")
.value = "0.00"
ElseIf tc >= 0 Then
uc = tc / qt
assetForm("showunitcost").
value = FormatNumber(uc,2,true,fal
se,true)
End If
assetForm("showtotalcost")
.value = FormatNumber(tc,2,true,fal
se,true)
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Format replacement cost with two decimal places.
'
Sub blurReplacementCost()
Dim rc
rc = CDbl("0" & assetForm("rplcmntcost").v
alue)
assetForm("rplcmntcost").v
alue = FormatNumber(rc,2,true,fal
se,true)
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Format Salvage Value with two decimal places.
'
Sub blurSalvageValue()
Dim sv
sv = CDbl( "0" & assetForm("salvagevalue").
value )
assetForm("salvagevalue").
value = FormatNumber(sv,2,true,fal
se,true)
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user assigns an account to an asset record.
'
' Note that this Sub is dependent on parseLng(), parseStr() and parseStr2
' These functions extract values from a string returned by the dialog box.
'
Sub showAccountSearch()
Dim retVal
retVal = showModalDialog("../../set
up/account
/accountse
arch/accou
nt_search.
asp","","d
ialogHeigh
t:400px; dialogWidth:550px; center:yes; help:no; status:no; resizable:yes;")
If Not IsNull(retVal) Then
If "::CLEAR::" = retVal Then ' The user has cleared the field
assetForm("accountid").val
ue = 0
assetForm("account").value
= ""
assetForm("acctdescription
").innerTe
xt = ""
Else ' The user has assigned an account from the dialog
assetForm("accountid").val
ue = parseLng(retVal)
assetForm("account").value
= parseStr(retVal)
assetForm("acctdescription
").innerTe
xt = parseStr2(retVal)
End If
assetForm.chaccount.value = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user assigns a fund to an asset record.
'
Sub showFundDlg()
Dim sFeatures, retVal
sFeatures = "dialogHeight:300px; dialogWidth:250px; center:yes; help:no; status:no; resizable:yes; scrollbars:no"
retVal = showModalDialog("lookupfie
lds/lookup
_fund.asp"
,"","dialo
gHeight:30
0px; dialogWidth:250px; center:yes; help:no; status:no; resizable:yes; scrollbars:no")
If Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then
assetForm("fundid").value = 0
assetForm("fund").value = ""
Else
assetForm("fundid").value = parseLng(retVal)
assetForm("fund").value = parseStr(retVal)
End If
assetForm("chfund").value = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user attempts to assign a new Department
'
Sub showDepartmentDlg()
Dim retVal
retVal = showModalDialog("lookupfie
lds/lookup
_departmen
t.asp","",
"dialogHei
ght:300px;
dialogWidth:400px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
If Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' The user has requested that this field should be cleared
assetForm("departmentid").
value = 0
assetForm("department").va
lue = ""
Else ' The user has assigned a department
assetForm("departmentid").
value = parseLng(retVal)
assetForm("department").va
lue = parseStr(retVal)
End If
assetForm("chdepartment").
value = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when a user attempts to assign a new Division
'
Sub showDivisionDlg()
Dim retVal, strURL
' If a department is already assigned, only select from divisions under
' the assigned department.
strURL = "lookupfields/lookup_divis
ion.asp"
If Not IsNull(assetForm("departme
ntid").val
ue) Then
strURL = strURL & "?department=" & assetForm("departmentid").
value
End If
retVal = showModalDialog(strURL,"",
"dialogHei
ght:300px;
dialogWidth:400px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
If Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' The user has requested that this field is cleared
assetForm("divisionid").va
lue = 0
assetForm("division").valu
e = ""
Else ' The user has assigned a new Division.
assetForm("divisionid").va
lue = parseLng(retVal)
assetForm("division").valu
e = parseStr(retVal)
End If
assetForm("chdivision").va
lue = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user attempts to assign a new Organization to an asset record
'
Sub showOrganizationDlg()
Dim retVal, strURL
' If this record is already assigned to a a division, show only orgs that belong
' to the assigned division.
strURL = "lookupfields/lookup_organ
ization.as
p"
If Not IsNull(assetForm("division
id").value
) Then
strURL = strURL & "?division=" & assetForm("divisionid").va
lue
End If
retVal = showModalDialog(strURL,"",
"dialogHei
ght:300px;
dialogWidth:400px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
if Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' User has requested that this field should be cleared.
assetForm("organizationid"
).value = 0
assetForm("organization").
value = ""
Else ' User has assigned a new organization
assetForm("organizationid"
).value = parseLng(retVal)
assetForm("organization").
value = parseStr2(retVal)
End If
assetForm("chorganization"
).value = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when a user attempts to assign a new value to Location
'
Sub showLocationDlg()
Dim retVal
retVal = showModalDialog("lookupfie
lds/lookup
_location.
asp","","d
ialogHeigh
t:300px; dialogWidth:400px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
if Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' User has requested this field should be cleared
assetForm("locationid").va
lue = 0
assetForm("txtlocation").v
alue = ""
Else ' User has assigned a new location
assetForm("locationid").va
lue = parseLng(retVal)
assetForm("txtlocation").v
alue = parseStr(retVal)
End If
assetForm("chlocation").va
lue = 1
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when user attempts to assign a facility
'
Sub showFacilityDlg()
Dim retVal
retVal = showModalDialog("lookupfie
lds/lookup
facility/f
acility_fr
ame.asp","
","dialogH
eight:300p
x; dialogWidth:400px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
if Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' User requests clear this field
assetForm("facilityid").va
lue = 0
assetForm("facility").valu
e = ""
Else ' User has assigned new Facility
assetForm("facilityid").va
lue = parseLng(retVal)
assetForm("facility").valu
e = parseStr2(retVal)
End If
assetForm("chfacility").va
lue = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when user attempts to change the condition field
'
Sub showConditionDlg()
Dim retVal
retVal = showModalDialog("lookupfie
lds/lookup
_condition
.asp","","
dialogHeig
ht:250px; dialogWidth:350px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
if Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' User requests clear this field
assetForm("conditionid").v
alue = 0
assetForm("condition").val
ue = ""
Else ' User has assigned a new Condition
assetForm("conditionid").v
alue = parseLng(retVal)
assetForm("condition").val
ue = parseStr(retVal)
End If
assetForm("chcondition").v
alue = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when user attempts to assign a new Status
'
Sub showStatusDlg()
Dim retVal
retVal = showModalDialog("lookupfie
lds/lookup
_status.as
p","","dia
logHeight:
250px; dialogWidth:350px; center:yes; help:no; status:no; resizable:yes; scrollbars:no;")
if Not IsNull(retVal) Then
If retVal = "::CLEAR::" Then ' User requests clear this field
assetForm("statusid").valu
e = 0
assetForm("status").value = ""
Else ' User has assigned a new Status
assetForm("statusid").valu
e = parseLng(retVal)
assetForm("status").value = parseStr(retVal)
End If
assetForm("chstatus").valu
e = 1 ' This field must be set to 1 to be saved
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when user attempts to save changes to a record
'
Sub onSaveRecord()
dim vali_date, valid_service
if (CStr(assetForm("mfgyear")
.value) = "") then
vali_date = 0
else
if not validate then
msgbox "You must enter a valid 4 digit Mfg. Year and resave"
vali_date = 1
end if
end if
if (CStr(assetForm("serviceda
te").value
) = "") then
valid_service = 0
else
if not validservice then
msgbox "You must enter the service date in the MM/DD/YYYY format and resave"
valid_service = 1
end if
end if
if not isvalid then
MsgBox "You must enter a valid ACCOUNT, FUND, RLT, PONUMBER, QUANTITY, UNITCOST, TOTALCOST and SERIAL NUMBER in order to save a record."
elseif vali_date = 1 then
vali_date = vali_date + 1
elseif valid_service = 1 then
valid_service = valid_service + 1
else
assetForm("action").value = "Save"
assetForm.submit()
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user attempts to delete an asset record
'
Sub onDeleteAsset()
' If we're in the middle of creating a new asset, don't delete anything!
If assetForm("action").value = "New" Then
MsgBox "No record to delete."
Exit Sub
End If
' Prompt the user to be certain about the deletion
If assetForm("assetid") <> "" Then
If vbYes = MsgBox("Are you sure you want to delete this record? You cannot get back what you delete!",vbYesNoCancel,"De
lete?") Then
assetForm("action").value = "Delete"
assetForm.submit
End If
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called when the user attempts to open an asset's history data dialog
'
Sub showHistory()
' If there's no asset selected, or we're in the middle of creating a new record
' don't show history.
If assetForm.action.value = "New" Then
MsgBox "Cannot show history while creating a record."
Else
Dim strURL
strURL = "history/history.asp?asset
id=" & assetForm("assetid").value
showModalDialog strURL,"","dialogHeight:40
0px; dialogWidth:610px; center:yes; help:no; status:no; resizable:yes;"
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Not implemented in phase 1
'
Sub showImage()
Dim sFeatures
sFeatures = "dialogHeight:400px; dialogWidth:375px; center:yes; help:no; status:no;"
showModalDialog "asset_image.asp","",sFeat
ures
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called to determine if the manufactured date has been properly entered.
'
' Returns False if the date entered is a character.
'
function validate()
dim i
i = Asc(assetForm("mfgyear").v
alue)
If ((i < 48) Or (i > 57)) Then
validate = false
else
validate = true
end if
if validate = true then
i = len(assetForm("mfgyear").v
alue)
if i < 4 then
validate = false
else
validate = true
end if
end if
end function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called to determine if the serviced date has been properly entered.
'
' Returns False if the date entered is a character.
'
function validservice()
dim i
i = Asc(assetForm("servicedate
").value)
If ((i < 48) Or (i > 57)) Then
validservice = false
else
validservice = true
end if
if validservice = true then
i = len(assetForm("servicedate
").value)
if i < 10 then
validservice = false
else
validservice = true
end if
end if
end function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' Called to determine if all required field of an asset record have been
' entered.
' It also checks if the manufactured date has been correctly entered
' Returns True if all required fields are entered, or False if not.
'
Function isValid()
If (CStr(assetForm("accountid
").value) <> "") and _
(CStr(assetForm("fundid").
value) <> "") and _
(CStr(assetForm("rlt").val
ue) <> "") and _
(CStr(assetForm("ponumber"
).value) <> "") and _
(CStr(assetForm("quantity"
).value) <> "") and _
(CStr(assetForm("totalcost
").value) <> "") and _
(CStr(assetForm("serial").
value) <> "") _
Then
isValid = true
Else
isValid = False
End If
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeRLT()
assetForm.chrlt.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeSublocation()
assetForm.chsublocation.va
lue = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeShopNo()
assetForm.chshopno.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeVendor()
assetForm.chvendor.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeManufacturer()
assetForm.chmanufacturer.v
alue = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeMfgYear()
assetForm.chmfgyear.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeModel()
assetForm.chmodel.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeSerial()
assetForm.chserial.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeRplCost()
assetForm.chrplcost.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeSublocation()
assetForm.chsublocation.va
lue = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeSlvgValue()
assetForm.chslvgvalue.valu
e = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeParentRLT()
assetForm.chparentrlt.valu
e = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeNotes()
assetForm.chnotes.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangePONumber()
assetForm.chponumber.value
= 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeInvoiceNo()
assetForm.chinvoiceno.valu
e = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeServiceDate()
assetForm.chservicedate.va
lue = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeQuantity()
assetForm.chquantity.value
= 1
assetForm.chcost.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' For each field that is changed, the corresponding CHfieldname field
' must be updated so the field is saved when the form is submitted.
'
Sub onChangeCost()
assetForm.chcost.value = 1
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' All of the popup dialogs on this page return a value that must be parsed.
' The value that is returned is a string in the form of "NUMBER1:STRING1:STRING2".
' This function reads the number and returns it as a Long.
'
Function parseLng( v )
Dim dPos, nLen
nLen = Len(v)
dPos = InStr(1,v,":")
parseLng = CLng(Left(v,dPos-1))
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' All of the popup dialogs on this page return a value that must be parsed.
' The value that is returned is a string in the form of "NUMBER1:STRING1:STRING2".
' This function reads the first String and returns it as a String.
'
Function parseStr( v )
Dim dPos1, dPos2, nLen
dPos1 = InStr(1,v,":")
dPos2 = InStr(dPos1+1,v,":")
nLen = dPos2 - dPos1
parseStr = Mid(v,dPos1+1,nLen-1)
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' All of the popup dialogs on this page return a value that must be parsed.
' The value that is returned is a string in the form of "NUMBER1:STRING1:STRING2".
' This function reads the second String and returns it as a String.
'
Function parseStr2( v )
Dim dPos1, dPos2, nLen
dPos1 = InStr(1,v,":")
dPos2 = InStr(dPos1+1,v,":")
nLen = Len(v) - dPos2
parseStr2 = Right(v,nLen)
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' When the asset_record.asp page is loaded, it may take a few moments
' to display because it is so large. There is a message on the page
' that says, "PLEASE WAIT" until the page is loaded. When the page is
' loaded, this message should be hidden. This Sub hides the message.
'
Sub initPage()
waitmsg.style.display = "none"
End Sub
'-->
</script>
<body bgcolor="#808080" topmargin="10" style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt" text ="#ffffff" onload="initPage">
<P id="waitmsg" align="center">-- PLEASE WAIT --</p>
<%
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' This function returns a new, unique 9 digit number used as the primary
' key for history records or transaction history records.
'
Function getNewID()
Randomize
Dim strNum
strNum = CStr(Round(CDbl(Rnd * 999999999)))
While Len(strNum) < 9
strNum = "0" & strNum
Wend
getNewID = strNum
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''
' Add a new record to the primary asset table
'
' This procedure constructs a SQL query which calls a stored procedure:
' sp_AddAsset(). This stored procedure creates a new asset record in
' the Asset table.
'
Private Sub SaveAsset()
Dim strQuery
strQuery = ""
strQuery = "begin sp_AddAsset(" & Request("assetid") & ","
If Request("assetid") = "" Then strQuery = strQuery & getNewID & "," Else strQuery = strQuery & Request("assetid") & "," End If
If Request("accountid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("accountid") & "," End If
If Request("fundid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("fundid") & "," End If
strQuery = strQuery & "1," 'If Request("quantity") = "" Then strQuery = strQuery & "1," Else strQuery = strQuery & Request("quantity") & "," End If
If CDbl(Request("totalcost"))
= CDbl(0.0) Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("totalcost") & "," End If
If Request("parent") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("parent") & "'," End If
strQuery = strQuery & "'AIIMS2000 User Interface',"
If Request("acqmethodid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("acqmethodid") & "," End If
If Request("dispmethodid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("dispmethodid") & "," End if
If Request("departmentid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("departmentid") & "," End If
If Request("divisionid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("divisionid") & "," End If
If Request("organizationid")=
"" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("organizationid") & "," End If
If Request("facilityid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("facilityid") & "," End If
If Request("locationid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("locationid") & "," End If
If Request("sublocation") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("sublocation") & "'," End If
If Request("conditionid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("conditionid") & "," End If
If Request("statusid") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("statusid") & "," End If
If Request("capital") = "" Then strQuery = strQuery & "0," Else strQuery = strQuery & Request("capital") & "," End If
Dim ReplCost
ReplCost = CInt(Request("rplcmntcost"
))
If Request("rplcmntcost") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & ReplCost & "," End If
If Request("salvagevalue") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("salvagevalue") & "," End If
If Request("rlt") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("rlt") & "'," End If
If Request("vendor") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("vendor") & "'," End If
If Request("manufacturer") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("manufacturer") & "'," End If
If Request("mfgyear") = "" Then
strQuery = strQuery & "null,"
Else
dim yearmfg
yearmfg = DatePart("yyyy", Request("mfgyear"))
if yearmfg <= "1905" then
yearmfg = Request("mfgyear")
else
yearmfg = yearmfg
end if
strQuery = strQuery & "'" & yearmfg & "',"
End If
If Request("warrantyexp") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & Request("warrantyexp") & "," End If
If Request("model") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("model") & "'," End If
If Request("shopno") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("shopno") & "'," End If
If Request("serial") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("serial") & "'," End If
If Request("invoiceno") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("invoiceno") & "'," End If
If Request("ponumber") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("ponumber") & "'," End If
strQuery = strQuery & "null,"
If Request("servicedate") = "" Then
strQuery = strQuery & "null,"
Else
dim dateserviced, monthserviced, dayserviced
dateserviced = DatePart("yyyy", Request("servicedate"))
monthserviced = DatePart("m", Request("servicedate"))
dayserviced = DatePart("d", Request("servicedate"))
if (dateserviced = "2000") then
dateserviced = monthserviced & "/" & dayserviced & "/" & "2000"
else
dateserviced = Request("servicedate")
End If
strQuery = strQuery & "'" & dateserviced & "',"
End If
strQuery = strQuery & "null,"
If Request("usage") = "" Then strQuery = strQuery & "null," Else strQuery = strQuery & "'" & Request("usage") & "'," End If
If Request("notes") = "" Then strQuery = strQuery & "null); end;" Else strQuery = strQuery & "'" & Request("notes") & "'); end;" End If
Dim x
x = Time
Response.Write("Before Database")
Response.Write(x)
Dim RecordSet, Divid, OraSession, OraDatabase, strQuery1
Dim retcode
retcode = OraDatabase.ExecuteSQL(str
Query)
If (1 = retcode) Then
strQuery = "begin sp_AddHistoryItem(" & getNewID & "," & Request("assetid") & ",'','','','Record created by user interface.'" & "); end;"
OraDatabase.ExecuteSQL strQuery
End If
x = Time
Response.Write("After SP")
Response.Write(x)
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''
' Delete the previously selected asset and blank out all the fields
'
Private Sub DeleteAsset()
Dim RecordSet, Divid, OraSession, OraDatabase, strQuery
Set OraSession = CreateObject("OracleInProc
Server.XOr
aSession")
session("user") = Request.From("user")
session("pass") = Request.Form("pass")
Set OraDatabase = OraSession.OpenDatabase("A
IIMS2K.Orl
ando", session("user") & "/" & session("pass"), 0)
strQuery = "begin sp_DeleteAsset(" & Request("assetid") & "); end;"
OraDatabase.ExecuteSQL strQuery
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
''''
' Save changes made to the current record and report any errors
'
Private Sub UpdateAsset()
Dim strQuery, nAssetID, strReason
Dim RecordSet, Divid, OraSession, OraDatabase
Set OraSession = CreateObject("OracleInProc
Server.XOr
aSession")
session("user") = Request.Form("user")
session("pass") = Request.Form("pass")
Set OraDatabase = OraSession.OpenDatabase("A
IIMS2K.Orl
ando", session("user") & "/" & session("pass"), 0)
nAssetID = Request("assetid")
strReason = "Updated by user interface."
If Request("chaccount") = 1 Then
strQuery = "begin sp_ChangeAccount(" & getNewID & "," & nAssetID & "," & Request("accountid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chfund") = 1 Then
strQuery = "begin sp_ChangeFund(" & getNewID & "," & nAssetID & "," & Request("fundid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chrlt") = 1 Then
strQuery = "begin sp_ChangeRLT(" & nAssetID & "," & Request("rlt") & "," & getNewID & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chrplcost") = 1 Then
Dim ReplCost
ReplCost = CInt(Request("rplcmntcost"
))
strQuery = "begin sp_ChangeReplacementCost("
& getNewID & "," & nAssetID & ",'" & ReplCost & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chslvgvalue") = 1 Then
strQuery = "begin sp_ChangeSalvageValue(" & nAssetID & ",'" & Request("salvagevalue") & "'," & getNewID & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chnotes") = 1 Then
strQuery = "begin sp_ChangeNotes(" & nAssetID & ",'" & Request("notes") & "'," & getNewID & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chdepartment") = 1 Then
strQuery = "begin sp_ChangeDepartMent(" & nAssetID & "," & getNewID & "," & Request("departmentid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chdivision") = 1 Then
strQuery = "begin sp_ChangeDivision(" & nAssetID & "," & getNewID & "," & Request("divisionid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chorganization") = 1 Then
strQuery = "begin sp_ChangeOrganization(" & getNewID & "," & nAssetID & "," & Request("organizationid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chfacility") = 1 Then
strQuery = "begin sp_ChangeFacility(" & getNewID & "," & nAssetID & "," & Request("facilityid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chlocation") = 1 Then
strQuery = "begin sp_ChangeLocation(" & getNewID & "," & nAssetID & ","
If Request("locationid") <> "" Then strQuery = strQuery & Request("locationid") Else strQuery = strQuery & "null" End If
strQuery = strQuery & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chsublocation") = 1 Then
strQuery = "begin sp_ChangeSublocation(" & getNewID & "," & nAssetID & ",'" & Request("sublocation") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chparentrlt") = 1 Then
strQuery = "begin sp_ChangeParentRLT(" & getNewID & "," & nAssetID & ",'" & Request("parentrlt") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chshopno") = 1 Then
strQuery = "begin sp_ChangeShopNumber(" & getNewID & "," & nAssetID & ",'" & Request("shopno") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chvendor") = 1 Then
strQuery = "begin sp_ChangeVendor(" & getNewID & "," & nAssetID & ",'" & Request("vendor") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chmanufacturer") = 1 Then
strQuery = "begin sp_ChangeManufacturer(" & getNewID & "," & nAssetID & ",'" & Request("manufacturer") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chmfgyear") = 1 Then
strQuery = "begin sp_ChangeMfgYear(" & getNewID & "," & nAssetID & ",'" & Request("mfgyear") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chmodel") = 1 Then
strQuery = "begin sp_ChangeModel(" & getNewID & "," & nAssetID & ",'" & Request("model") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chserial") = 1 Then
strQuery = "begin sp_ChangeSerialNumber(" & getNewID & "," & nAssetID & ",'" & Request("serial") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chcondition") = 1 Then
strQuery = "begin sp_ChangeCondition(" & getNewID & "," & nAssetID & "," & Request("conditionid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chstatus") = 1 Then
strQuery = "begin sp_ChangeStatus(" & getNewID & "," & nAssetID & "," & Request("statusid") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chponumber") = 1 Then
strQuery = "begin sp_ChangePONumber(" & getNewID & "," & nAssetID & ",'" & Request("ponumber") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chinvoiceno") = 1 Then
strQuery = "begin sp_ChangeInvoiceNo(" & getNewID & "," & nAssetID & ",'" & Request("invoiceno") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chcost") = 1 Then
strQuery = "begin sp_ChangeCost(" & getNewID & "," & nAssetID & ",'" & Request("totalcost") & "','" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
If Request("chquantity") = 1 Then
strQuery = "begin sp_ChangeQuantity(" & getNewID & "," & nAssetID & "," & Request("quantity") & ",'" & strReason & "'); end;"
OraDatabase.ExecuteSQL strQuery
End If
End Sub
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' This function was written to prevent a lot of duplicate code within
' the form in the body of this web page.
'
Function getFieldValue( name )
If Recordset(name) = "" Then ' There may not be an open recordset
getFieldValue = ""
Else ' There is an open recordset, if the specified field has a value, return it
getFieldValue = Recordset(name)
End If
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' When the user saves a record, he may be saving a new record or updating
' an existing record. If the record exists, it should be updated, if the
' record does not exist, it should be created.
'
' This function determines if the record submitted by the assetForm exists
' by querying the database for the record.
'
Function AssetExists( id )
Dim RecordSet, Divid, OraSession, OraDatabase, strQuery
Set OraSession = CreateObject("OracleInProc
Server.XOr
aSession")
session("user") = Request.Form("user")
Session("pass") = Request.From("pass")
Set OraDatabase = OraSession.OpenDatabase("A
IIMS2K.Orl
ando", session("user") & "/" & session("pass"), 0)
strQuery = "select count(*) assetCount from asset where assetid = " & id
Set Recordset = OraDatabase.DbCreateDynase
t(strQuery
,0)
If Recordset("assetCount") > 0 Then
AssetExists = True
Else
AssetExists = False
End If
End Function
''''''''''''''''''''''''''
''''''''''
''''''''''
''''''''''
''''''''''
'''''
' This block of code is always executed when this page is loaded. Therefore,
' it is not enclosed in a Sub block.
'
' The Action field in the assetform determines what function will be performed
' when the form is submitted. If the action is "save" the record will either
' be created or updated depending on whether the record exists in the database.
' If action is "Delete" then the record is deleted from the database.
'
Select Case Request("action")
Case "Save" ' Called to save a new asset in the database
If AssetExists(Request("asset
id")) Then
UpdateAsset
Else
SaveAsset
End If
Case "Delete" ' Called to delete an asset
DeleteAsset
Case Else
' If this is the beginning of a new asset, do nothing but
' leave the fields in the form blank.
End Select
Dim x
x = Time
Response.Write("Before Qry Db")
Response.Write(x)
Dim RecordSet, Divid, OraSession, OraDatabase, strQuery
Set OraSession = CreateObject("OracleInProc
Server.XOr
aSession")
'Session("user") = "system"
'Session("pass") = "manager"
Response.Write(session("us
er"))
Session("user") = Request.Form("user")
Session("pass") = Request.Form("pass")
Set OraDatabase = OraSession.OpenDatabase("A
IIMS2K.Orl
ando", session("user") & "/" & session("pass"), 0)
If Len(Request("assetid")) > 0 Then
strQuery = "select * from qry_assetview where assetid = " & Request("assetid")
Else
strQuery = "select * from qry_assetview where assetid = 0"
End If
Set Recordset = OraDatabase.DbCreateDynase
t( strQuery, 0)
x = Time
Response.Write("After Qry Db")
Response.Write(x)
%>
<form id=assetForm action="asset_record.asp" target="_self">
<%
x = Time
Response.Write("Before HTML")
Response.Write(x)
%>
<input type=hidden name=action value="<%=Request("Action"
)%>">
<input type=hidden name=assetid value="<%If Request("Action") = "New" Then Response.Write(getNewID) Else Response.Write(getFieldVal
ue("asseti
d"))%>">
<input type=hidden name=acqmethodid value="<%=getFieldValue("a
cquisition
methodid")
%>">
<input type=hidden name=dispmethodid value="<%=getFieldValue("d
isposalmet
hodid")%>"
>
<input type=hidden name=departmentid value="<%=getFieldValue("d
epartmenti
d")%>">
<input type=hidden name=divisionid value="<%=getFieldValue("d
ivisionid"
)%>">
<input type=hidden name=organizationid value="<%=getFieldValue("o
rganizatio
nid")%>">
<input type=hidden name=facilityid value="<%=getFieldValue("f
acilityid"
)%>">
<input type=hidden name=locationid value="<%=getFieldValue("l
ocationid"
)%>">
<input type=hidden name=statusid value="<%=getFieldValue("s
tatusid")%
>">
<input type=hidden name=conditionid value="<%=getFieldValue("c
onditionid
")%>">
<input type=hidden name=accountid value="<%=getFieldValue("a
ccountid")
%>">
<input type=hidden name=fundid value="<%=getFieldValue("f
undid")%>"
>
<input type=hidden name=unitcost value="<%=getFieldValue("u
nitcost")%
>">
<input type=hidden name=totalcost value="<%=getFieldValue("t
otalcost")
%>">
<input type=hidden name=chcost value="0">
<input type=hidden name=chrplcost value="0">
<input type=hidden name=chslvgvalue value="0">
<input type=hidden name=chacqmethod value="0">
<input type=hidden name=chdispmethod value="0">
<input type=hidden name=chdepartment value="0">
<input type=hidden name=chdivision value="0">
<input type=hidden name=chorganization value="0">
<input type=hidden name=chfacility value="0">
<input type=hidden name=chlocation value="0">
<input type=hidden name=chstatus value="0">
<input type=hidden name=chcondition value="0">
<input type=hidden name=chaccount value="0">
<input type=hidden name=chfund value="0">
<input type=hidden name=chtotalcost value="0">
<input type=hidden name=chunitcost value="0">
<input type=hidden name=chquantity value="0">
<input type=hidden name=chrlt value="0">
<input type=hidden name=chsublocation value="0">
<input type=hidden name=chparentrlt value="0">
<input type=hidden name=chshopno value="0">
<input type=hidden name=chvendor value="0">
<input type=hidden name=chmanufacturer value="0">
<input type=hidden name=chmfgyear value="0">
<input type=hidden name=chmodel value="0">
<input type=hidden name=chserial value="0">
<input type=hidden name=chponumber value="0">
<input type=hidden name=chinvoiceno value="0">
<input type=hidden name=chservicedate value="0">
<input type=hidden name=chnotes value="0">
<table border="0" width="100%" style="font-family: Verdana; font-size: 8pt" cellspacing="0" cellpadding="0">
<tr>
<td align="left" nowrap valign="top" width="10%">
<p align="right"><b>Account<f
ont color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input id="account" value="<%=getFieldValue("A
ccountNumb
er")%>" title="<%=getFieldValue("A
ccountNumb
er")%>"
style="font-family: Arial; font-size: 8pt; position: relative; width: 100%; border-style: solid; border-width: 1" tabindex="1" readOnly name="account" size="12"></td>
<td width="10%"><input onclick="showAccountSearch
" type=button value="..." tabindex="2" height="18" name="btnAccount"
style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border-style: solid; border-width: 1; margin-left: 1"></td>
</tr>
</table>
</td>
<td nowrap rowspan="2" valign="top" width="10%" align="right">
<p align="right"> Acct. Desc. </p
>
</td>
<td nowrap colspan="3" rowspan="2">
<TEXTAREA name=acctdescription readOnly rows=2 tabIndex=3 cols="20"
style="font-family: Arial; font-size: 8pt; position: relative; width: 100%; border: 1px solid #000000"><%=getFieldValue(
"AccountDe
scription"
)%></TEXTA
REA>
</td>
</tr>
<tr>
<td nowrap width="10%">
<p align="right"><b>Fund<font
color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input style="font-family: Arial; font-size: 8pt; position: relative; width: 100%; border: 1px solid #000000" tabindex="4" name="fund" value="<%=getFieldValue("F
undNumber"
)%>" size="12"></td>
<td width="10%"><input type=button name="btnFund" value="..." onclick="showFundDlg()" style="font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="5" height="18"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right"><b>RLT#<font
color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%">
<input name="rlt" maxlength="10" value="<%=getFieldValue("r
lt")%>" onkeypress="onChangeRLT" style="font-family: Arial; font-size: 8pt; position: relative; width: 100%; border-style: solid; border-width: 1px" title="<%=getFieldValue("r
lt")%>" tabindex="6" size="12" ></td>
<td width="10%"><input name="btnRLT" language="vbscript" onclick="setRLT" type=button value="..." style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="7" height="18"></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"> Servic
e Date </td>
<td nowrap width="15%">
<input name="servicedate" tabindex="16" size="25" maxlength="20" value="<%=getFieldValue("s
ervicedate
")%>" title="<%=getFieldValue("s
ervicedate
")%>" onkeypress="onChangeServic
eDate"
style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000">
</td>
<td nowrap width="10%" align="right"> Shop No. </td>
<td nowrap width="15%">
<input name="shopno" tabindex="30" maxlength="32" value="<%=getFieldValue("s
hopnumber"
)%>" title="<%=getFieldValue("s
hopnumber"
)%>" onkeypress="onChangeShopNo
"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%"></td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right"><b>PO Number<font color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap width="15%">
<input maxlength="32" name="ponumber" tabindex="8" size="16" value="<%=getFieldValue("p
onumber")%
>" title="<%=getFieldValue("p
onumber")%
>" onkeypress="onChangePONumb
er"
style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border-style: solid; border-width: 1px">
</td>
<td nowrap width="10%" align="right"> Depart
ment
</td
>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("d
epartment"
)%>" title="<%=getFieldValue("d
epartment"
)%>" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" tabindex="17" name="department" readOnly size="21"></td>
<td width="10%"><input type=button value="..." onclick="showDepartmentDlg
()" style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="18" height="18"></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"> Vendor
&nbs
p;</td>
<td nowrap width="15%"><input maxlength="32" value="<%=getFieldValue("v
endor")%>"
title="<%=getFieldValue("v
endor")%>"
onkeypress="onChangeVendor
" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" name="vendor" tabindex="31" ></td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right"> Invoic
e No. </p>
</td>
<td nowrap width="15%">
<input maxlength="32" value="<%=getFieldValue("i
nvoicenumb
er")%>" title="<%=getFieldValue("i
nvoicenumb
er")%>" onkeypress="onChangeInvoic
eNo" style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border-style: solid; border-width: 1px" name="invoiceno" tabindex="9" size="16">
</td>
<td nowrap width="10%" align="right"> Divisi
on &n
bsp;</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("d
ivision")%
>" title="<%=getFieldValue("d
ivision")%
>" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" tabindex="19" name="division" readonly size="21"></td>
<td width="10%"><input onclick="showDivisionDlg()
" type=button value="..." style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="20" height="18"></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"> Manufa
cturer&nbs
p; </
td>
<td nowrap width="15%"><input maxlength="32" value="<%=getFieldValue("m
anufacture
r")%>" title="<%=getFieldValue("m
anufacture
r")%>" onkeypress="onChangeManufa
cturer" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" name="manufacturer" tabindex="32" ></td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right">
<b>
Quantity<font color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap width="15%">
<p align="right"><input maxlength="9" value="<%=getFieldValue("q
uantity")%
>" title="<%=getFieldValue("q
uantity")%
>" onkeypress="onChangeQuanti
ty" style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border-style: solid; border-width: 1px" name="quantity" tabindex="10" onblur="blurQuantity" size="16" disabled></p>
</td>
<td nowrap width="10%" align="right"> Organi
zation&nbs
p; </
td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("o
rganizatio
n")%>" title="<%=getFieldValue("o
rganizatio
n")%>" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" tabindex="21" name="organization" readOnly size="21"></td>
<td width="10%"><input onclick="showOrganizationD
lg()" type=button value="..." style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="22" height="18"></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"> Mfg. Year </td>
<td nowrap width="15%"><input value="<%=getFieldValue("m
fgyear")%>
" title="<%=getFieldValue("m
fgyear")%>
" onkeypress="onChangeMfgYea
r" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" name="mfgyear" tabindex="33" ></td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right">
<b>
Unit Cost<font color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap width="15%">
<p align="right">
<input maxlength="15" value="<%=getFieldValue("u
nitcost")%
>" title="<%=getFieldValue("u
nitcost")%
>" onkeypress="onChangeCost" name="showunitcost" tabindex="11" maxlength="11" onblur="blurUnitCost" onfocus="focusCost"
style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border-style: solid; border-width: 1px" size="16"></p>
</td>
<td nowrap width="10%" align="right"> Facili
ty &n
bsp;</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("f
acility")%
>" title="<%=getFieldValue("f
acility")%
>" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" tabindex="23" name="facility" readOnly size="21"></td>
<td width="10%"><input onclick="showFacilityDlg()
" type=button value="..." style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="24" height="18"></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"> Model No. </td>
<td nowrap width="15%"><input maxlength="32" value="<%=getFieldValue("m
odel")%>" title="<%=getFieldValue("m
odel")%>" onkeypress="onChangeModel"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" name="model" tabindex="34" ></td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right"><b>Total Cost<font color="#ff0000">* &nb
sp;</font>
</b></p>
</td>
<td nowrap width="15%"><p align="right">
<input maxlength="15" name="showtotalcost" value="<%=getFieldValue("t
otalcost")
%>" title="<%=getFieldValue("t
otalcost")
%>" onkeypress="onChangeCost" onfocus="focusCost" onblur="blurTotalCost"
style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border-style: solid; border-width: 1px" tabindex="12" size="16"></p></td>
<td nowrap width="10%" align="right"> Locati
on &n
bsp;</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("l
ocation")%
>" title="<%=getFieldValue("l
ocation")%
>" name="txtlocation" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" readOnly tabindex="25" size="21" ></td>
<td width="10%"><input type=button value="..." onclick="showLocationDlg()
" style="font-family: ar; font-size: 8pt; height: 18px; position: relative; width: 18px; border: 1px solid #000000; margin-left: 1px" tabindex="26" height="18" name=btnLocation></td>
</tr>
</table>
</td>
<td nowrap width="10%" align="right"><b><font color="#ff0000"> </fo
nt>Ser./VI
N No.</b><font color="#ff0000"><b>*</b>&n
bsp;
</font></t
d>
<td nowrap width="15%"><input maxlength="32" value="<%=getFieldValue("s
erialnumbe
r")%>" title="<%=getFieldValue("s
erialnumbe
r")%>" onkeypress="onChangeSerial
" style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" name="serial" tabindex="35"></td>
</tr>
<tr>
<td nowrap width="10%">
<p align="right"> Rplcmn
t Cost </p>
</td>
<td nowrap width="15%"><input name="rplcmntcost" id="rplcmntcost" onblur="blurReplacementCos
t" value="<%=getFieldValue("r
eplacement
cost")%>" onkeypress="onChangeRplCos
t" style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; border: 1px solid #000000" size="16" tabindex="13"></td>
<td nowrap width="10%" align="right"> Sub-Lo
cation&nbs
p; </
td>
<td nowrap width="15%"><input maxlength="32" value="<%=getFieldValue("s
ublocation
")%>" title="<%=getFieldValue("s
ublocation
")%>" onkeypress="onChangeSubloc
ation" style="font-family: Arial; font-size: 8pt; position: relative; border: 1px solid #000000" name="sublocation" tabindex="27" size="25" ></td>
<td nowrap width="10%" align="right"> Condit
ion &
nbsp;</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("c
ondition")
%>" title="<%=getFieldValue("c
ondition")
%>" name="condition" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" readOnly tabindex="36" size="20" ></td>
<td width="10%"><input type=button value="..." onclick="showConditionDlg(
)" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: ar; FONT-SIZE: 8pt; HEIGHT: 18px; MARGIN-LEFT: 1px; POSITION: relative; WIDTH: 20px" tabindex="37" height="18" name=btnCondition></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" nowrap width="10%">
<p align="right"> Salvag
e Value </p>
</td>
<td nowrap width="15%">
<input disabled name="salvagevalue" tabindex="14" maxlength="15" size="16" onblur="blurSalvageValue" value="<%=getFieldValue("s
alvagevalu
e")%>" title="<%=getFieldValue("s
alvagevalu
e")%>" onkeypress="onChangeSlvgVa
lue"
style="font-family: Arial; font-size: 8pt; position: relative; text-align: right; width: 100%; background-color: #C0C0C0; border: 1px solid #000000"></td>
<td nowrap width="10%" align="right"> Parent
RLT </td>
<td nowrap width="15%"><input disabled value="<%=getFieldValue("p
arentrlt")
%>" title="<%=getFieldValue("p
arentrlt")
%>" onkeypress="onChangeParent
RLT" style="font-family: Arial; font-size: 8pt; position: relative; background-color: #C0C0C0; border: 1px solid #000000" tabindex="28" maxlength="10" name="parentrlt" size="25"></td>
<td nowrap width="10%" align="right"> Status
&nbs
p;</td>
<td nowrap>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><input value="<%=getFieldValue("s
tatus")%>"
title="<%=getFieldValue("s
tatus")%>"
name="status" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" readOnly tabindex="38" size="20" ></td>
<td width="10%"><input type=button value="..." onclick="showStatusDlg()" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: ar; FONT-SIZE: 8pt; HEIGHT: 18px; MARGIN-LEFT: 1px; POSITION: relative; WIDTH: 20px" tabindex="39" height="18" name=btnStatus></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" nowrap width="10%">
<p align="right"> Notes&
nbsp; 
;</p>
</td>
<td colspan="5" nowrap><TEXTAREA name=notes maxlength="2000" onkeypress="onChangeNotes"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-FAMILY: Arial; FONT-SIZE: 8pt; POSITION: relative; WIDTH: 100%" tabIndex=15 rows="2" cols="20"><%=getFieldValue
("Notes")%
></TEXTARE
A></td>
</tr>
</table>
</form>
</body>
</html>