<!--在此加入管理认证代码,否则任何人可以管理此系统-->
<%
AdminName=replace(session("AdminName"),"'","")
if AdminName="" then
Response.Write("<script language=javascript>alert('您没有管理权限！');this.top.location.href='javascript:history.go(-1)';</script>")
 response.end
end if
%>

<html>
<head>
<title>在线QQ管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Admin_Style.css" rel="stylesheet" type="text/css">
<body>
<%
Dim starttime: starttime = Timer()
Dim Jurl: Jurl = Left(request.ServerVariables("URL"), InStrRev(request.ServerVariables("URL"), "/") - 1)

Function leftshow(ByVal str, ByVal leftc)
  If Len(str) >= leftc Then
    leftshow = Left(str, leftc) & ".."
  Else
    leftshow = str
  End If
End Function

Function htmlencode(ByVal reString)
  Dim str
  str = reString
  str = Replace(str, "&", "&amp;")
  str = Replace(str, ">", "&gt;")
  str = Replace(str, "<", "&lt;")
  htmlencode = str
End Function

Sub client_alert(ByVal str, ByVal stype)
  response.Clear
  response.write "<html>" & vbCrLf
  response.write "<head>" & vbCrLf
  response.write "<meta http-equiv=""content-type"" content=""text/html; charset=gb2312"">" & vbCrLf
  response.write "<title>网站QQ在线咨询-提示信息</title>" & vbCrLf
  response.write "</head>" & vbCrLf
  response.write "<body>" & vbCrLf
  response.write "<script language=""javascript"">" & vbCrLf
  response.write "alert(""" & str & """)" & vbCrLf
  If IsNumeric(stype) Then
    response.write "history.go(" & stype & ")" & vbCrLf
  Else
    response.write "location.href=""" & stype & """" & vbCrLf
  End If
  response.write "</script>" & vbCrLf
  response.write "</body>" & vbCrLf
  response.write "</html>" & vbCrLf
  response.End
End Sub

Sub client_confirm(ByVal str, ByVal funy, ByVal funn)
  response.Clear
  response.write "<html>" & vbCrLf
  response.write "<head>" & vbCrLf
  response.write "<meta http-equiv=""content-type"" content=""text/html; charset=gb2312"">" & vbCrLf
  response.write "<title>网站QQ在线咨询-提示信息</title>" & vbCrLf
  response.write "</head>" & vbCrLf
  response.write "<body>" & vbCrLf
  response.write "<script language=""javascript"">" & vbCrLf
  response.write "if(confirm(""" & str & """))" & vbCrLf
  If IsNumeric(funy) Then
    response.write "history.go(" & funy & ")" & vbCrLf
  Else
    response.write "location.href=""" & funy & """" & vbCrLf
  End If
  response.write "else" & vbCrLf
  If IsNumeric(funn) Then
    response.write "history.go(" & funn & ")" & vbCrLf
  Else
    response.write "location.href=""" & funn & """" & vbCrLf
  End If
  response.write "</script>" & vbCrLf
  response.write "</body>" & vbCrLf
  response.write "</html>" & vbCrLf
  response.End
End Sub

Sub editsiteinfo()
  Dim infostrSourceFile, infoobjXML
  infostrSourceFile = Server.MapPath("xml/info.xml")
  Set infoobjXML = Server.CreateObject("Microsoft.XMLDOM")
  infoobjXML.Load (infostrSourceFile)
  Dim infoobjNodes
  Set infoobjNodes = infoobjXML.selectSingleNode("xml/qqinfo/qqset[siteid ='1']")
  If Not IsNull(infoobjNodes) Then
    infoobjNodes.childNodes(0).Text = htmlencode(request.Form("sitename"))
    infoobjNodes.childNodes(1).Text = htmlencode(request.Form("siteskin"))
    infoobjNodes.childNodes(2).Text = htmlencode(request.Form("siteshowx"))
    infoobjNodes.childNodes(3).Text = htmlencode(request.Form("siteshowy"))
    infoobjNodes.childNodes(4).Text = htmlencode(request.Form("sitearea"))
	infoobjNodes.childNodes(5).Text = htmlencode(request.Form("qqonline"))
	infoobjNodes.childNodes(7).Text = htmlencode(request.Form("leftwidth"))
	infoobjNodes.childNodes(8).Text = htmlencode(request.Form("middlewidth"))
	infoobjNodes.childNodes(9).Text = htmlencode(request.Form("rightwidth"))
    infoobjXML.save (infostrSourceFile)
    Set infoobjNodes = Nothing
    Set infoobjXML = Nothing
    Call client_alert("参数修改成功!", "?type=manage")
  Else
    Call client_alert("Xml文件 未成功打开!", -1)
  End If
End Sub

Sub addinfo()
  If Trim(request.Form("qq")) = "" Or Trim(request.Form("dis")) = "" Or Trim(request.Form("face")) = "" Then
    Call client_alert("您并没有填入必要的数据!", -1)
  End If
  Dim jtb_color
  If Trim(request.Form("color")) = "" Then
    jtb_color = "#000000"
  Else
    jtb_color = htmlencode(request.Form("color"))
  End If
  Dim strSourceFile, objXML, oListNode, oDetailsNode, AllNodesNum
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Dim objRootlist
  Set objRootlist = objXML.documentElement.selectSingleNode("qqlist")
  Dim id
  If objRootlist.hasChildNodes Then
    id = objRootlist.lastChild.lastChild.Text + 1
  Else
    id = 1
  End If
  Set objRootlist = Nothing
  Set oListNode = objXML.documentElement.selectSingleNode("qqlist").appendChild(objXML.createElement("qq"))
  Set oDetailsNode = oListNode.appendChild(objXML.createElement("qid"))
  oDetailsNode.Text = htmlencode(request.Form("qq"))
  Set oDetailsNode = oListNode.appendChild(objXML.createElement("dis"))
  oDetailsNode.Text = htmlencode(request.Form("dis"))
  Set oDetailsNode = oListNode.appendChild(objXML.createElement("face"))
  oDetailsNode.Text = htmlencode(request.Form("face"))
  Set oDetailsNode = oListNode.appendChild(objXML.createElement("color"))
  oDetailsNode.Text = jtb_color
  Set oDetailsNode = oListNode.appendChild(objXML.createElement("id"))
  oDetailsNode.Text = id
  objXML.save (strSourceFile)
  Set objRootlist = Nothing
  Set oListNode = Nothing
  Set oDetailsNode = Nothing
  Set objXML = Nothing
  Call client_alert("添加新的QQ号成功!", "?type=manage")
End Sub

Sub editinfo()
  Dim editid: editid = request.querystring("id")
  If Not IsNumeric(editid) Or editid = "" Then
    Call client_alert("ID号必须为数字!", -1)
  Else
    editid = CLng(editid)
  End If
  If Trim(request.Form("qq")) = "" Or Trim(request.Form("dis")) = "" Or Trim(request.Form("face")) = "" Then
    Call client_alert("没有添入必要的数据!", -1)
  End If
  Dim strSourceFile, objXML
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Dim objNodes
  Set objNodes = objXML.selectSingleNode("xml/qqlist/qq[id ='" & editid & "']")
  If Not IsNull(objNodes) Then
    objNodes.childNodes(0).Text = htmlencode(request.Form("qq"))
    objNodes.childNodes(1).Text = htmlencode(request.Form("dis"))
    objNodes.childNodes(2).Text = htmlencode(request.Form("face"))
    objNodes.childNodes(3).Text = htmlencode(request.Form("color"))
    objXML.save (strSourceFile)
    Set objNodes = Nothing
    Set objXML = Nothing
    Call client_alert("修改成功!", "?type=manage")
  Else
    Call client_alert("修改失败!", "?type=manage")
  End If
End Sub

Sub delinfo()
  Dim delid
  delid = request.querystring("id")
  If Not IsNumeric(delid) Or delid = "" Then
    Call client_alert("ID号必须为数字!", "?type=manage")
  Else
    delid = CLng(delid)
  End If
  Dim strSourceFile, objXML
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Dim objNodes
  Set objNodes = objXML.selectSingleNode("xml/qqlist/qq[id ='" & delid & "']")
  If Not IsNull(objNodes) Then
    If request.querystring("yn") = "" Then
      Call client_confirm("确认要删除[" & objNodes.childNodes(0).Text & "]的信息吗?", "?type=manage&act=delete&id=" & delid & "&yn=1", -1)
    Else
      objNodes.parentNode.removeChild (objNodes)
      objXML.save (strSourceFile)
      Call client_alert("删除成功!", "?type=manage")
    End If
  Else
  Call client_alert("没有找到指定的条目!", "?type=manage")
  End If
  Set objNodes = Nothing
  Set objXML = Nothing
  response.End
End Sub

Sub fso_write(ByVal fpath, ByVal ftext)
  On Error Resume Next
  Dim fso, fout
  Set fso = Server.CreateObject("Scripting.FileSystemObject")
  Set fout = fso.CreateTextFile(Server.MapPath(fpath))
  fout.write ftext
  fout.Close
  Set fout = Nothing
  Set fso = Nothing
  If Err Then
    Call client_alert("创建文件失败,可能是您的服务器不支持FSO权限而导致的!", "?type=manage")
  End If
End Sub

Sub create_js()
  Dim tmpstr
  tmpstr = ""
  tmpstr = tmpstr & "var online=new Array();" & vbCrLf
  tmpstr = tmpstr & "if (!document.layers)" & vbCrLf
  tmpstr = tmpstr & "document.write('<div id=divStayTopLeft style=position:absolute>');" & vbCrLf
  Call fso_write("top.js", tmpstr)
  Dim strSourceFile, objXML, objRootsite, AllNodesNum
  strSourceFile = Server.MapPath("xml/info.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Set objRootsite = objXML.documentElement.selectSingleNode("qqinfo")
  Dim Sitename, Siteskin
  Sitename = objRootsite.childNodes.Item(0).childNodes.Item(0).Text
  Siteskin = objRootsite.childNodes.Item(0).childNodes.Item(1).Text
  Dim startX, startY, sarea,qqonline
  startX = objRootsite.childNodes.Item(0).childNodes.Item(2).Text
  startY = objRootsite.childNodes.Item(0).childNodes.Item(3).Text
  sarea = objRootsite.childNodes.Item(0).childNodes.Item(4).Text
  qqonline = objRootsite.childNodes.Item(0).childNodes.Item(5).Text
  Dim TotalWidth,LeftWidth,MiddleWidth,RightWidth
  LeftWidth = objRootsite.childNodes.Item(0).childNodes.Item(7).Text
  MiddleWidth = objRootsite.childNodes.Item(0).childNodes.Item(8).Text
  RightWidth = objRootsite.childNodes.Item(0).childNodes.Item(9).Text
  TotalWidth = cint(LeftWidth)+cint(MiddleWidth)+cint(RightWidth)
  If sarea = "1" Then
    If IsNumeric(startX) Then
      startX = CInt(startX) + 135
      startX = "screen.width-" & CStr(startX)
    End If
  End If
  Set objRootsite = Nothing
  Set objXML = Nothing
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.FreeThreadedXMLDOM")
  objXML.Load (strSourceFile)
  Set objRootsite = objXML.documentElement.selectSingleNode("qqlist")
  AllNodesNum = objRootsite.childNodes.length - 1
  Dim iCount, iqCount, Qqnum
  For iqCount = 0 To AllNodesNum
    Qqnum = Qqnum & objRootsite.childNodes.Item(iqCount).childNodes.Item(0).Text & ":"
  Next  
  if qqonline = "1" Then
  tmpstr = ""
  tmpstr = tmpstr & "document.write('<script language=""javascript"" src=""" & Jurl & "/top.js""></script>');" & vbCrLf
  tmpstr = tmpstr & "document.write('<script language=""javascript"" src=""http://webpresence.qq.com/getonline?Type=1&" & Qqnum & """></script>');" & vbCrLf
  tmpstr = tmpstr & "document.write('<script language=""javascript"" src=""" & Jurl & "/bottom.js""></script>');" & vbCrLf
  else
  tmpstr = ""
  tmpstr = tmpstr & "document.write();" & vbCrLf
 end if
  Call fso_write("qq.js", tmpstr)
  tmpstr = ""
  tmpstr = tmpstr & "document.write('<table cellSpacing=""0"" cellPadding=""0"" width=""110"" border=""0"" id=""qqtab"">');" & vbCrLf
  tmpstr = tmpstr & "document.write('    <tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('      <td width=""110"" onclick=""if(document.all.qqtab.style.display==\'none\'){document.all.qqtab.style.display=\'\'} else {document.all.qqtab.style.display=\'none\'}""><img src=""" & Jurl & "/images/qq/skin/" & Siteskin & "/top.gif"" border=""0""></td>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    </tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    <tr id=""qqstab"">');" & vbCrLf
  tmpstr = tmpstr & "document.write('      <td valign=""middle"" align=""center"" background=""" & Jurl & "/images/qq/skin/" & Siteskin & "/middle.gif"">');" & vbCrLf
  tmpstr = tmpstr & "document.write('<table border=""0"" width=""" &TotalWidth& """ cellSpacing=""0"" cellPadding=""0"">');" & vbCrLf
  tmpstr = tmpstr & "document.write('  <tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    <td width=""" &TotalWidth& """ height=""5"" border=""0"" colspan=""2""></td>');" & vbCrLf
  tmpstr = tmpstr & "document.write('  </tr>');" & vbCrLf
  For iCount = 0 To AllNodesNum
    tmpstr = tmpstr & "document.write('  <tr>');" & vbCrLf
    tmpstr = tmpstr & "if (online[" & iCount & "]==0)" & vbCrLf
    tmpstr = tmpstr & "  {" & vbCrLf
    tmpstr = tmpstr & "    document.write('    <td width=""" &LeftWidth& """ height=""22"" valign=""middle"" align=""center"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('<img src=""" & Jurl & "/images/qqface/" & objRootsite.childNodes.Item(iCount).childNodes.Item(2).Text & "_f.gif"" border=""0"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    </td>');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    <td width=""" &MiddleWidth& """ height=""22"" valign=""middle"" align=""left"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('<a href=""http://wpa.qq.com/msgrd?V=1&amp;Uin=" & objRootsite.childNodes.Item(iCount).childNodes.Item(0).Text & "&amp;Site=" & Sitename & "&amp;Menu=yes"" target=""blank""><font style=""font-size:12px;TEXT-DECORATION:none;color:" & objRootsite.childNodes.Item(iCount).childNodes.Item(3).Text & ";"">" & objRootsite.childNodes.Item(iCount).childNodes.Item(1).Text & "</font></a><br>');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    </td>');" & vbCrLf
    tmpstr = tmpstr & "  }" & vbCrLf
    tmpstr = tmpstr & "else" & vbCrLf
    tmpstr = tmpstr & "  {" & vbCrLf
    tmpstr = tmpstr & "    document.write('    <td width=""" &LeftWidth& """ height=""22"" valign=""middle"" align=""center"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('<img src=""" & Jurl & "/images/qqface/" & objRootsite.childNodes.Item(iCount).childNodes.Item(2).Text & "_m.gif"" border=""0"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    </td>');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    <td width=""" &MiddleWidth& """ height=""22"" valign=""middle"" align=""left"">');" & vbCrLf
    tmpstr = tmpstr & "    document.write('<a href=""http://wpa.qq.com/msgrd?V=1&amp;Uin=" & objRootsite.childNodes.Item(iCount).childNodes.Item(0).Text & "&amp;Site=" & Sitename & "&amp;Menu=yes"" target=""blank""><font style=""font-size:12px;TEXT-DECORATION:none;color:" & objRootsite.childNodes.Item(iCount).childNodes.Item(3).Text & ";"">" & objRootsite.childNodes.Item(iCount).childNodes.Item(1).Text & "</font></a><br>');" & vbCrLf
    tmpstr = tmpstr & "    document.write('    </td>');" & vbCrLf
    tmpstr = tmpstr & "  }" & vbCrLf
    tmpstr = tmpstr & "document.write('  </tr>');" & vbCrLf
  Next
  Set objRootsite = Nothing
  Set objXML = Nothing
  tmpstr = tmpstr & "document.write('</table>');" & vbCrLf
  tmpstr = tmpstr & "document.write('</td>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    </tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    <tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('      <td width=""110"" onclick=""if(document.all.qqstab.style.display==\'none\'){document.all.qqstab.style.display=\'\'} else {document.all.qqstab.style.display=\'none\'}""><img src=""" & Jurl & "/images/qq/skin/" & Siteskin & "/bottom.gif"" border=""0""></td>');" & vbCrLf
  tmpstr = tmpstr & "document.write('    </tr>');" & vbCrLf
  tmpstr = tmpstr & "document.write('</table>');" & vbCrLf
  tmpstr = tmpstr & "var verticalpos=""frombottom""" & vbCrLf
  tmpstr = tmpstr & "if (!document.layers)" & vbCrLf
  tmpstr = tmpstr & "document.write('</div>')" & vbCrLf
  tmpstr = tmpstr & "function JSFX_FloatTopDiv()" & vbCrLf
  tmpstr = tmpstr & "{" & vbCrLf
  tmpstr = tmpstr & "  var jqq_startX = " & startX & ";" & vbCrLf
  tmpstr = tmpstr & "  var jqq_startY = " & startY & ";" & vbCrLf
  tmpstr = tmpstr & "  var jqq_ns = (navigator.appName.indexOf(""Netscape"") != -1);" & vbCrLf
  tmpstr = tmpstr & "  var jqq_d = document;" & vbCrLf
  tmpstr = tmpstr & "  function jqq_ml(id)" & vbCrLf
  tmpstr = tmpstr & "  {" & vbCrLf
  tmpstr = tmpstr & "    var jqq_el=jqq_d.getElementById?jqq_d.getElementById(id):jqq_d.all?jqq_d.all[id]:jqq_d.layers[id];" & vbCrLf
  tmpstr = tmpstr & "    if(jqq_d.layers)jqq_el.style=jqq_el;" & vbCrLf
  tmpstr = tmpstr & "    jqq_el.sP=function(x,y){this.style.left=x;this.style.top=y;};" & vbCrLf
  tmpstr = tmpstr & "    jqq_el.x = jqq_startX;" & vbCrLf
  tmpstr = tmpstr & "    if (verticalpos==""fromtop"")" & vbCrLf
  tmpstr = tmpstr & "      jqq_el.y = jqq_startY;" & vbCrLf
  tmpstr = tmpstr & "    else{" & vbCrLf
  tmpstr = tmpstr & "      jqq_el.y = jqq_ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;" & vbCrLf
  tmpstr = tmpstr & "      jqq_el.y -= jqq_startY;" & vbCrLf
  tmpstr = tmpstr & "    }" & vbCrLf
  tmpstr = tmpstr & "    return jqq_el;" & vbCrLf
  tmpstr = tmpstr & "  }" & vbCrLf
  tmpstr = tmpstr & "  window.stayTopLeft=function()" & vbCrLf
  tmpstr = tmpstr & "  {" & vbCrLf
  tmpstr = tmpstr & "    if (verticalpos==""fromtop""){" & vbCrLf
  tmpstr = tmpstr & "      var jqq_pY = jqq_ns ? pageYOffset : document.body.scrollTop;" & vbCrLf
  tmpstr = tmpstr & "      jqq_ftlObj.y += (jqq_pY + jqq_startY - jqq_ftlObj.y)/8;" & vbCrLf
  tmpstr = tmpstr & "    }" & vbCrLf
  tmpstr = tmpstr & "    else{" & vbCrLf
  tmpstr = tmpstr & "      var jqq_pY = jqq_ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;" & vbCrLf
  tmpstr = tmpstr & "      jqq_ftlObj.y += (jqq_pY - jqq_startY - jqq_ftlObj.y)/8;" & vbCrLf
  tmpstr = tmpstr & "    }" & vbCrLf
  tmpstr = tmpstr & "    jqq_ftlObj.sP(jqq_ftlObj.x, jqq_ftlObj.y);" & vbCrLf
  tmpstr = tmpstr & "    setTimeout(""stayTopLeft()"", 10);" & vbCrLf
  tmpstr = tmpstr & "  }" & vbCrLf
  tmpstr = tmpstr & "  jqq_ftlObj = jqq_ml(""divStayTopLeft"");" & vbCrLf
  tmpstr = tmpstr & "  stayTopLeft();" & vbCrLf
  tmpstr = tmpstr & "}" & vbCrLf
  tmpstr = tmpstr & "JSFX_FloatTopDiv();" & vbCrLf
  Call fso_write("bottom.js", tmpstr)
  Call client_alert("新的JS文件已经创建成功!", "?type=manage")
End Sub

Select Case request.querystring("act")
  Case "cjs"
    Call create_js
  Case "editsiteinfo"
    Call editsiteinfo
  Case "add"
    Call addinfo
  Case "edit"
    Call editinfo
  Case "delete"
    Call delinfo
End Select
%>



<%
Sub slist()
%>
<table cellpadding="2" cellspacing="1" border="0" width="90%" align="center" class="border">
  <tr>
    <td  class="topbg" height="25" align="center" ><strong>网站在线咨询管理</strong></td>
  </tr>
  <tr>
    <td align="center"><table width="100%" border="0" align="center"  cellpadding="0" cellspacing="0" class="a3">
      <tr>
        <td >
          <%
  Dim infostrSourceFile, infoobjXML
  infostrSourceFile = Server.MapPath("xml/info.xml")
  Set infoobjXML = Server.CreateObject("Microsoft.XMLDOM")
  infoobjXML.Load (infostrSourceFile)
  Dim infoobjNodes
  Set infoobjNodes = infoobjXML.selectSingleNode("xml/qqinfo/qqset[siteid ='1']")
  If Not IsNull(infoobjNodes) Then
    %>
          <form method="post" action="?type=manage&act=editsiteinfo">
            <table width="100%"  border="0" cellpadding="2" cellspacing="1" class="a3">
              <tr>
                <td  height="25" colspan="2"  class="Title">&nbsp;QQ在线咨询修改第一步：参数设置</td>
              </tr>
			                <tr>
                <td  height="25" colspan="2" class="tdbg" >&nbsp;状态：
                    
<input type="radio" name="qqonline" value="1"<%if infoobjNodes.childNodes(5).text="1" then response.write " checked"%>>
&nbsp;显示&nbsp;
<input type="radio" name="qqonline" value="0"<%if infoobjNodes.childNodes(5).text="0" then response.write " checked"%>>
&nbsp;隐藏（设置隐藏前台将不显示QQ在线咨询）</td>
              </tr>
			  
              <tr>
                <td  height="25" colspan="2" class="tdbg" >&nbsp;位置：
                    <input type="radio" name="sitearea" value="0"<%if infoobjNodes.childNodes(4).text="0" then response.write " checked"%>>
                  &nbsp;居左&nbsp;
                  <input type="radio" name="sitearea" value="1"<%if infoobjNodes.childNodes(4).text="1" then response.write " checked"%>>
                  &nbsp;居右</td>
              </tr>
              <tr>
                <td width="207"  height="12" class="tdbg" >&nbsp;网站名：
                  <input type="text" name="sitename" size="15" value="<%=infoobjNodes.childNodes(0).text%>"></td>
                <td rowspan="2" class="tdbg" >系统提供12种模板，您可以在此输入1--12的数字，修改后并<a href="?type=manage&act=cjs">生成新的JS文件</a>观看效果。模板位置：\admin\images\qq\skin</td>
              </tr>
              <tr>
                <td  height="12" class="tdbg" >&nbsp;使用皮肤：
                  <input type="text" name="siteskin" size="5" value="<%=infoobjNodes.childNodes(1).text%>"></td>
                </tr>
              <tr>
                <td  height="25" colspan="2" class="tdbg" >&nbsp;显示界面X坐标：
                    <input type="text" name="siteshowx" size="10" value="<%=infoobjNodes.childNodes(2).text%>">
                  &nbsp;Y坐标：
                  <input type="text" name="siteshowy" size="10" value="<%=infoobjNodes.childNodes(3).text%>">
                  &nbsp;
                  <input type="submit" name="submit2" value="参数修改"></td>
              </tr>
			  <tr>
                <td  height="25" colspan="2" class="tdbg" >&nbsp;宽度设置：
                    左<input type="text" name="leftwidth" size="8" value="<%=infoobjNodes.childNodes(7).text%>">
                  &nbsp;中：
                  <input type="text" name="middlewidth" size="8" value="<%=infoobjNodes.childNodes(8).text%>">
				  &nbsp;右：
                  <input type="text" name="rightwidth" size="8" value="<%=infoobjNodes.childNodes(9).text%>">
                  &nbsp;
                  <input type="submit" name="submit2" value="参数修改"></td>
              </tr>
            </table>
          </form>
          <%
    Set infoobjNodes = Nothing
    Set infoobjXML = Nothing
  Else
    Call client_alert("Xml文件 未成功打开!", "?type=manage")
  End If
%>
          <table width="100%"  border="0" cellpadding="2" cellspacing="1" class="a3">
            <tr>
              <td width="180" height="25" class="Title" >&nbsp;QQ号</td>
              <td width="180" height="25" class="Title" >&nbsp;描述</td>
              <td width="80" height="25" class="Title" >&nbsp;头像</td>
              <td width="30" height="25" align="center" class="Title" >编辑</td>
              <td width="30" height="25" align="center" class="Title" >删除</td>
            </tr>
            <%
  Dim strSourceFile, objXML, objRootsite, AllNodesNum
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Set objRootsite = objXML.documentElement.selectSingleNode("qqlist")
  AllNodesNum = objRootsite.childNodes.length - 1
  Dim iCount
  For iCount = 0 To AllNodesNum
    %>
            <tr>
              <td width="180" height="25" class="tdbg" >&nbsp;<%=objRootsite.childNodes.item(iCount).childNodes.item(0).text%></td>
              <td width="180" height="25" class="tdbg" >&nbsp;<%=objRootsite.childNodes.item(iCount).childNodes.item(1).text%></td>
              <td width="80" height="25" class="tdbg" >&nbsp;<img src="images/qqface/<%=objRootsite.childNodes.item(iCount).childNodes.item(2).text%>_m.gif" border="0"></td>
              <td width="30" height="25" align="center" class="tdbg" ><a href="?type=manage&mtype=edit&id=<%=objRootsite.childNodes.item(iCount).childNodes.item(4).text%>">编辑</a></td>
              <td width="30" height="25" align="center" class="tdbg" ><a href="?type=manage&act=delete&id=<%=objRootsite.childNodes.item(iCount).childNodes.item(4).text%>">删除</a></td>
            </tr>
            <%
  Next
  Set objRootsite = Nothing
  Set objXML = Nothing
%>
            <tr>
              <td height="25" colspan="5" align="right" class="tdbg" >QQ在线咨询修改第二步
                <input name="button" type="button" onClick="location.href='?type=manage&act=cjs'" value="生成新的JS文件">
                &nbsp;</td></tr>
          </table>
          <form method="post" action="?type=manage&act=add">
            <table width="100%"  border="0" cellpadding="2" cellspacing="1" class="a3">
              <tr>
                <td  height="10" ></td>
              </tr>
              <tr>
                <td  height="25" class="Title" >&nbsp;添加新的QQ号</td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;QQ号：
                  <input type="text" name="qq" size="20"></td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;描述：
                  <input type="text" name="dis" size="25"></td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;颜色：
                    <input name="color" type="text" value="#000000" size="25">
                  输入描述文字的颜色代码例如：<span style="color: #FF0000">#000000</span></td>
              </tr>
              <tr>
                <td width="480" height="25" class="tdbg" >&nbsp;头像：<br>
                    <%dim fcount:for fcount=1 to 100%>
                    <input type="radio" name="face" value="<%=fcount%>">
                  <img src="images/qqface/<%=fcount%>_m.gif" border="0">
                  <%next%>                </td>
              </tr>
              
              <tr>
                <td  height="25" class="tdbg" >&nbsp;
                    <input type="submit" name="submit2" value="确定添加">
                  &nbsp;
                  <input type="reset" name="reset2" value="取消重置"></td>
              </tr>
            </table>
          </form>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<%
End Sub

Sub neditinfo()
%>
<table cellpadding="2" cellspacing="1" border="0" width="90%" align="center" class="border">
  <tr>
    <td class="topbg" height="25" align="center"><strong>编辑QQ信息</strong></td>
  </tr>
  <tr>
    <td align="center"><table width="100%" border="0" align="center"  cellpadding="0" cellspacing="0" class="a3">
      <tr>
        <td >
          <%
  Dim neditid: neditid = request.querystring("id")
  If Not IsNumeric(neditid) Or neditid = "" Then
    Call client_alert("ID号必须是数字!", -1)
  Else
    neditid = CLng(neditid)
  End If
  Dim strSourceFile, objXML
  strSourceFile = Server.MapPath("xml/qq.xml")
  Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  objXML.Load (strSourceFile)
  Dim objNodes
  Set objNodes = objXML.selectSingleNode("xml/qqlist/qq[id ='" & neditid & "']")
  If Not IsNull(objNodes) Then
    %>
          <form method="post" action="?type=manage&act=edit&id=<%=neditid%>">
            <table width="100%"  border="0" cellpadding="2" cellspacing="1" class="a3">
              
              <tr>
                <td  height="25" class="Title" >&nbsp;修改指定的QQ信息</td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;QQ号：
                  <input type="text" name="qq" size="20" value="<%=objNodes.childNodes(0).text%>"></td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;描述：
                  <input type="text" name="dis" size="25" value="<%=objNodes.childNodes(1).text%>">                </td>
              </tr>
              <tr>
                <td  height="25" class="tdbg" >&nbsp;颜色：
                    <input type="text" name="color" size="25" value="<%=objNodes.childNodes(3).text%>">
                  输入描述文字的颜色代码例如：<span style="color: #FF0000">#000000</span></td>
              </tr>
              <tr>
                <td width="480" height="25" class="tdbg" >&nbsp;头像：<br>
                    <%dim fcount:for fcount=1 to 100%>
                    <input type="radio" name="face" value="<%=fcount%>"<%if objNodes.childNodes(2).text=cstr(fcount) then response.write" checked"%>>
                  <img src="images/qqface/<%=fcount%>_m.gif" border="0">
                  <%next%></td>
              </tr>
              
              <tr>
                <td  height="25" class="tdbg" >&nbsp;
                    <input type="submit" name="submit" value="确定修改">
                  &nbsp;
                  <input type="reset" name="reset" value="取消重置"></td>
              </tr>
            </table>
          </form>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<%
    Set objNodes = Nothing
    Set objXML = Nothing
  Else
    Call client_alert("发生错误!", -1)
  End If
End Sub
  %>
<%
If request.querystring("type") = "manage" Then
  Select Case request.querystring("mtype")
    Case "edit"
      Call neditinfo
    Case Else
      Call slist
  End Select
Else
  Call slist
End If
  Dim enddtime: enddtime = Timer()
  %>
</body>
</html>