home *** CD-ROM | disk | FTP | other *** search
- <%
-
- dim quote,isAdmin,disabletextstart,disableintstart,disabletextend
-
- quote=chr(34)
-
- if Session("FONTSIZE") = "LARGE" then
- disabletextstart= "<TABLE BORDER=1 BORDERCOLORLIGHT=" & quote & "#000000" & quote & " BORDERCOLORMEDIUM=" & quote & "#000000" & quote & " BORDERCOLORDARK=" & quote & "Gray" & quote & "><TR><TD BGCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLORLIGHT=" & quote & "#C0C0C0" & quote & " BORDERCOLORMEDIUM=" & quote & "#C0C0C0" & quote & " BORDERCOLORDARK=" & quote & "#C0C0C0" & quote & "WIDTH=300>"
- disableintstart= "<TABLE BORDER=1 BORDERCOLORLIGHT=" & quote & "#000000" & quote & " BORDERCOLORMEDIUM=" & quote & "#000000" & quote & " BORDERCOLORDARK=" & quote & "Gray" & quote & "><TR><TD BGCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLORLIGHT=" & quote & "#C0C0C0" & quote & " BORDERCOLORMEDIUM=" & quote & "#C0C0C0" & quote & " BORDERCOLORDARK=" & quote & "#C0C0C0" & quote & "WIDTH=75>"
- else
- disabletextstart= "<TABLE BORDER=1 BORDERCOLORLIGHT=" & quote & "#000000" & quote & " BORDERCOLORMEDIUM=" & quote & "#000000" & quote & " BORDERCOLORDARK=" & quote & "Gray" & quote & "><TR><TD BGCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLORLIGHT=" & quote & "#C0C0C0" & quote & " BORDERCOLORMEDIUM=" & quote & "#C0C0C0" & quote & " BORDERCOLORDARK=" & quote & "#C0C0C0" & quote & "WIDTH=275>"
- disableintstart= "<TABLE BORDER=1 BORDERCOLORLIGHT=" & quote & "#000000" & quote & " BORDERCOLORMEDIUM=" & quote & "#000000" & quote & " BORDERCOLORDARK=" & quote & "Gray" & quote & "><TR><TD BGCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLOR=" & quote & "#C0C0C0" & quote & " BORDERCOLORLIGHT=" & quote & "#C0C0C0" & quote & " BORDERCOLORMEDIUM=" & quote & "#C0C0C0" & quote & " BORDERCOLORDARK=" & quote & "#C0C0C0" & quote & "WIDTH=50>"
- end if
- disabletextend="</TD></TR></TABLE>"
-
- isAdmin=Session("isAdmin")
-
- function checkbox(fieldname, onclickproc, adminonly)
- On Error Resume Next
- Dim val
-
- if mid(fieldname,1,1)="!" then
- fieldname=mid(fieldname,2)
- val=not currentobj.Get(fieldname)
- else
- val=currentobj.Get(fieldname)
- end if
-
- checkbox = checkboxVal(err,val,"chk" & fieldname,onclickproc,adminonly)
-
- end function
-
- function checkboxVal(err, val, fieldname, onclickproc, adminonly)
- On Error Resume Next
- Dim output
- if err <> 0 then
- checkbox="<INPUT NAME='" & fieldname & "' TYPE='CHECKBOX'>"
- alertuser fieldname
- else
- if (not adminonly) or isAdmin then
- if val then
- output="<INPUT NAME='" & fieldname & "' TYPE='CHECKBOX' CHECKED"
- else
- output="<INPUT NAME='" & fieldname & "' TYPE='CHECKBOX' "
- end if
-
- output = output & " OnClick=" & quote & "top.title.Global.updated=true;"
-
- if onclickproc <> "" then
- checkboxVal=output & onclickproc & quote & ">"
- else
- checkboxVal=output & quote & ">"
- end if
-
-
- else
- if Session("Browser") = "IE4" then
- if val then
- checkboxVal="<INPUT NAME='" & fieldname & "' TYPE='CHECKBOX' CHECKED DISABLED>"
- else
- checkboxVal="<INPUT NAME='" & fieldname & "' TYPE='CHECKBOX' CHECKED DISABLED>"
- end if
- else
-
- if val then
- checkboxVal="<IMG ALIGN=middle SRC=" & quote & "images/checkon.gif" & quote & ">"
- else
- checkboxVal="<IMG ALIGN=middle SRC=" & quote & "images/checkoff.gif" & quote & ">"
- end if
- end if
- end if
- end if
- end function
-
-
- function printoption(selected, text, adminonly)
- 'On Error Resume Next
- if selected then
- printoption="<OPTION SELECTED>" & text
- else
- if (isadmin or not adminonly) then
- printoption="<OPTION>" & text
- end if
- end if
-
- end function
-
-
-
- function getoption(fieldname,value, adminonly)
- 'On Error Resume Next
- Dim val
- val=currentobj.Get(fieldname)
- if err <> 0 then
- val = False
- alertuser fieldname
- end if
- getoption = printoption((value=val),value,adminonly)
- end function
-
-
- function radio(fieldname,value, onclickproc, adminonly)
- On Error Resume Next
- Dim val
- val=currentobj.Get(fieldname)
- if err <> 0 then
- radio=(printradio(fieldname, False,onclickproc,adminonly))
- alertuser "rdo" & fieldname
- else
- if (typename(val)="Boolean") then
- output=printradio(fieldname, (val=value),onclickproc,adminonly)
- else
- if mid(value,1,1)="!" then
- output=printradio(fieldname, (val <> mid(value,2)),onclickproc,adminonly)
- else
- output=printradio(fieldname, (val=value),onclickproc,adminonly)
- end if
- end if
- radio=output
- end if
- end function
-
- function printradio(fieldname, checked, onclickproc,adminonly)
- Dim output, chkstr
-
- if checked then
- chkstr="CHECKED"
- else
- chkstr=""
- end if
-
- if ((not adminonly) or isAdmin) then
- output="<INPUT NAME=" & quote & "rdo" & fieldname & quote & " TYPE=" & quote & "RADIO" & quote & " " & chkstr
- output=output & " OnClick=" & quote & "top.title.Global.updated=true;"
- if onclickproc <> "" then
- printradio=output & onclickproc & quote & ">"
- else
- printradio=output & quote & ">"
- end if
- else
- if checked then
- printradio="<IMG SRC=" & quote & "images/radioon.gif" & quote & ">"
- else
- printradio="<IMG SRC=" & quote & "images/radiooff.gif" & quote & ">"
- end if
- end if
-
- end function
-
- function text(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
- On Error Resume Next
- Dim val
- val=currentobj.Get(fieldname)
- text=inputbox(err,"text",fieldname,val,fieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,false)
- end function
-
- function pword(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
- On Error Resume Next
- Dim val
- val=currentobj.Get(fieldname)
- if ((not adminonly) or isAdmin) then
- pword=inputbox(err,"password",fieldname,val,fieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,false)
- else
- pword=disabletextstart & "*******" & disabletextend
- end if
-
- end function
-
- function inputbox(err,fieldtype,fieldname,val,fieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
- inputbox = writeinputbox(err,fieldtype,fieldname,val,fieldsize,"",onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
- end function
-
- function inputboxfixed(err,fieldtype,fieldname,val,fieldsize,maxfieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
- inputboxfixed = writeinputbox(err,fieldtype,fieldname,val,fieldsize,maxfieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
- end function
-
- function writeinputbox(err,fieldtype,fieldname,val,fieldsize,maxfieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
- On Error Resume Next
- Dim textstr
- if err <> 0 then
- textstr="<INPUT TYPE=" & quote & fieldtype & quote & " NAME=" & quote & fieldname & quote & " SIZE=" & fieldsize & ">"
- alertuser fieldname
- else
- if ((not adminonly) or isAdmin) then
- textstr="<INPUT TYPE=" & quote & fieldtype & quote
- textstr=textstr & " NAME=" & quote & fieldname & quote
- if fieldsize <> "" then
- textstr=textstr & " SIZE=" & fieldsize
- else
- end if
- if maxfieldsize <> "" then
- textstr=textstr & " MAXLENGTH=" & maxfieldsize
- else
- end if
- textstr=textstr & " VALUE=" & quote & val & quote
- textstr=textstr & " OnChange=" & quote & "top.title.Global.updated=true;"
- if onchangeproc <> "" then
- textstr=textstr & onchangeproc & quote
- else
- textstr=textstr & quote
- end if
- if onfocusproc <> "" then
- textstr=textstr & " OnFocus=" & quote & onfocusproc & quote
- end if
- if onblurproc <> "" then
- textstr=textstr & " OnBlur=" & quote & onblurproc & quote
- end if
- if readonly then
- textstr=textstr & " READONLY"
- end if
- textstr=textstr & ">"
-
- if hidden then
- textstr=textstr & " <INPUT TYPE=" & quote & "hidden" & quote & " NAME=" & quote & "hdn" & fieldname & quote & " VALUE=" & quote & val & quote & ">"
- end if
- else
-
- if Session("Browser") = "IE4" then
- textstr="<INPUT TYPE=" & quote & fieldtype & quote & " NAME=" & quote & fieldname & quote & " SIZE=" & fieldsize & " VALUE='" & val & "' DISABLED>"
- else
- if val = "" then
- val = " "
- else
- if len(val) > 50 then
- val = Left(val,50) & "..."
- end if
- end if
- if fieldsize < 15 then
- textstr=disableintstart & "<FONT FACE=HELV SIZE=1>" & val & "</FONT>" & disabletextend
- else
- textstr=disabletextstart & "<FONT FACE=HELV SIZE=1>" & val & "</FONT>" & disabletextend
- end if
- end if
- end if
- end if
- writeinputbox=textstr
-
- end function
-
-
- Sub alertuser(fieldname)
- 'Response.Write "<SCRIPT>alert(" & quote & "Could not retrieve a value for " & fieldname & ". (" & err & ":" & err.description & ")" & quote & ");</SCRIPT>"
- Response.Write "<FONT COLOR=red><B>*</B></FONT>"
- End Sub
-
- %>
-