<% if (isNull(request.cookies("cookieUserID"))) or (request.cookies("cookieUserID")="") then response.redirect "index.asp" end if %> <!--#include file="title.htm"--> - Client Division Detail <% %>
<% 'print_r(request.QueryString) 'Events..step 1 if len(request.querystring("btnSave")) > 0 then StaffID = request.QueryString("SID") strStaff = unquote(request.QueryString("strStaff")) blnActive = (request.QueryString("chkActive")) s = "SELECT COUNT(StaffID) as intCount FROM tblStaff WHERE strStaff = '" & strStaff & "' AND NOT StaffID = " & StaffID & ";" 'response.write s rst = cn.execute(s) if rst("intCount") > 0 then alert(rst("intCount") & " : Staff '" & strStaff & "' already exists") js("history.back();") response.end else if len(blnActive) > 0 then blnActive = "1" else blnActive = "0" end if if StaffID > 0 then s = "UPDATE tblStaff SET strStaff = '" & strStaff & _ "', blnActive = '" & blnActive &_ "' WHERE StaffID = " & StaffID & ";" 'response.write s 'response.end cn.execute(s) else s = "INSERT INTO tblStaff(strStaff, blnActive)" & _ " VALUES('" & strStaff & "', '" & blnActive & "');" 'response.write s 'response.end cn.execute(s) end if response.redirect "admin_staff.asp" end if end if 'Pageload.. StaffID = request.QueryString("SID") response.Write "" dim strStaff if StaffID > 0 then x = swapIt(x) s = "SELECT * FROM tblStaff WHERE StaffID = " & StaffID & ";" ' response.write s set rst = cn.execute(s) if not rst.eof then if len(rst("blnActive")) > 0 then if rst("blnActive") = "1" then strChecked = " Checked " else strChecked = "" end if else strChecked = "" end if strStaff = rst("strStaff") end if rst.close else strChecked = " Checked " strDisabled = "disabled" end if %>
<% if UserID > 0 then s = "SELECT * FROM tblUser WHERE UserID = " & UserID & " ORDER BY strUserName;" 'response.write s set rst = cn.execute(s) rst.close end if %>
Staff Details
Staff Name:
Active: