<% lvl=validate(1) userid=request("userid") if userid="" or not(isnumeric(userid)) then userid=0 set conn=server.createobject("ADODB.Connection") conn.open connection '/// receive data /// name=request("name") email=request("email") alias=request("alias") usr=request("usr") pwd=request("pwd") ulevel=request("ulevel") simultaneous=request("simultaneous") if simultaneous="" or not(isnumeric(simultaneous)) then simultaneous=1 additional=request("additional") depts=replace(request("depts")," ","") mywelcomemsg=request("mywelcomemsg")&"" if request("button")<>"" then if name<>"" and usr<>"" and pwd<>"" and alias<>"" then if userid>0 then condition=" and userid<>"&userid psql="select * from xlaALSusers where usr='"&usr&"'" & condition set rs=conn.execute(psql) if not(rs.eof) then errormsg="Username already taken" rs.close set rs=nothing else errormsg="You must provide at least a name, a username a password and a screen alias
" end if '/// Save user's Info /// if errormsg="" then psql="select * from xlaALSusers where userid="&userid Set rs = Server.CreateObject("ADODB.Recordset") rs.open psql,conn,1,2 if rs.eof then rs.addnew rs("attending")=0 end if rs("name")=name rs("email")=email rs("usr")=usr rs("pwd")=pwd rs("alias")=alias rs("ulevel")=ulevel rs("simultaneous")=simultaneous rs("additional")=additional rs("internalhits")=0 rs("mywelcomemsg")=mywelcomemsg rs.Update userid=rs("userid") rs.close set rs=nothing '/// Save user assigned departments /// psql="delete from xlaALSiUsersDepts where userid="&userid conn.execute(psql) tdepts=split(depts,",") for x=0 to ubound(tdepts) conn.execute("insert into xlaALSiUsersDepts (deptid,userid) values ("&tdepts(x)&","&userid&")") next conn.close set conn=nothing response.redirect "viewuser.asp?userid="&userid end if elseif userid>0 then psql="select * from xlaALSusers where userid="&userid set rs=conn.execute(psql) name=rs("name") email=rs("email") usr=rs("usr") pwd=rs("pwd") ulevel=rs("ulevel") simultaneous=rs("simultaneous") alias=rs("alias") additional=rs("additional") mywelcomemsg=rs("mywelcomemsg") rs.close set rs=nothing '/// depts //// psql="select * from xlaALSiUsersDepts where userid="&userid set rs=conn.execute(psql) depts="," do until rs.eof depts=depts &rs("deptid")&"," rs.movenext loop rs.close set rs=nothing end if %> <%=title%>
<%if errormsg<>"" then%> <%end if%>
Edit Representative
Search / View Representatives <%if userid>0 then%> Delete user <%end if%>
Error - The representative could not be saved :
Name :
E-mail :
Username :
Password :
Alias (Screen Name) :
Simultaneous Requests :
Max. Number of simultaneous request that this representative should be able to handle.
Type 0 (Zero) for unlimited (Not Recommended)
Level :
Welcome Message :
Select a message to begin your chat sessions and welcome your customer
Assigned Departments :
Additional Info :