<!-- #include file="header.asp" -->
<!-- #include file="firewall.asp" -->
<!-- #include file="include/md5.asp" -->

<table width="680" border="0" align="center" cellpadding="0" cellspacing="0" class="bodybg">
  <tr>
	<td width="160" align="center" valign="top">&nbsp;	</td>
	<td width="1" bgcolor="#8A816B"></td>
    <td valign="top">	
	<%
	on error resume next
	dim caput_rs,face_rs,face_sql
	select case Request.QueryString("type")
		case "config"
		'站点配置开始///////////////////////////////////////////////////////////
			strconn = "select * from site_info"
			set rs = createobject("adodb.recordset")
			rs.open strconn, conn, 1, 3
			if request("action") = 1 then
				if not rs.eof then
					rs("fadmin") = trim(request("name"))
					if trim(request("oldpass")) <>"" then
						rs("fpass") = md5(trim(request("oldpass")),16)
					end if
					rs("furl") =  trim(request("ebookurl"))
					rs("ftitle") = trim(request("ebooktitle"))
					rs("fsitename") = trim(request("ebookname"))
					rs("faff") = trim(request("aff"))
					rs("fmax") = cint(trim(request("max")))
					rs("fpagesize") = cint(trim(request("pagesize")))
					rs("fdesc") = trim(request("desc"))
					rs("fauthor") = trim(request("author"))
					rs("fkey") = trim(request("key"))
					rs.update		
					if err.number=0 then
						rs.close
						set rs = nothing
						conn.close
						set conn = nothing
						session("imsg") = "7"				
						response.redirect ("msg.asp")
						response.end
					else
						session("imsg") = "8"
						response.redirect ("msg.asp")
						response.end
					end if
				else
					session("imsg") = "9"
					response.redirect ("msg.asp")
					response.end
				end if
			end if
	%>
	<table width="800" height="470" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <form method="post" name="myform" action="admin.asp?type=config&action=1">

          <tr align="center" bgcolor="#CEEEFF"> 
            <td height="20" colspan="3"><span style="color: #000000">站点配置</span></td>
          </tr>
          <tr> 
            <td width="202" rowspan="13" valign="top"><table width="80%" height="91" align="center" cellpadding="0" cellspacing="1" bgcolor="#8A816B">
              <tr>
                <td height="20" bgcolor="#8A816B" align="center"><span style="color: #ffffff;">设置菜单</span></td>
              </tr>
              <tr>
                <td height="25" align="center" bgcolor="#FFFFFF"><a href="index.asp"><span style="color: #4F493E;">回到首页</span></a></td>
              </tr>
              <tr>
                <td height="22" align="center" bgcolor="#FFFFFF"><a href="?type=config"><span style="color: #4F493E;">站点设置</span></a></td>
              </tr>
              <tr>
                <td height="17" align="center" bgcolor="#FFFFFF"><a href="msg.asp?action=2"><span style="color: #4F493E;">退出管理</span></a></td>
              </tr>
            </table></td>
            <td width="125">&nbsp;</td>
            <td width="606">&nbsp;</td>
          </tr>
          <tr> 
            <td align="left"><div align="right">用户名:</div></td>
            <td align="left">　
              <input name="name" type="text" value="<%= rs("fadmin") %>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">密码:</div></td>
            <td align="left">　
              <input name="oldpass" type="password" size="30"> &nbsp;不修改留空</td>
          </tr>
          <tr> 
            <td align="left"><div align="right">验证密码:</div></td>
            <td align="left">　
              <input name="newpass" type="password" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">留言本网址:</div></td>
            <td align="left">　
              <input name="ebookurl" type="text" value="<%=rs("furl") %>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">留言本标题:</div></td>
            <td align="left">　
              <input name="ebooktitle" type="text" value="<%=rs("ftitle") %>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">留言本名称:</div></td>
            <td align="left">　
              <input type="text" name="ebookname" value="<%=rs("fsitename")%>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">每页记录数:</div></td>
            <td align="left">　
              <input type="text" name="pagesize" value="<%=rs("fpagesize")%>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">最长留言:</div></td>
            <td align="left">　
              <input type="text" name="max" value="<%=rs("fmax")%>" size="30"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right"></div></td>
            <td align="left"></td>
          </tr>
          <tr> 
            <td align="left"><div align="right">Description:</div></td>
            <td align="left">　
              <input name="desc" type="text" value="<%=rs("fdesc")%>" size="30">
              &nbsp;Meta标签</td>
          </tr>
          <tr> 
            <td align="left"><div align="right">Author:</div></td>
            <td align="left">　
              <input name="author" type="text" value="<%=rs("fauthor")%>" size="30">
              &nbsp;Meta标签</td>
          </tr>
          <tr> 
            <td align="left"><div align="right">Keywords:</div></td>
            <td align="left">　
              <input name="key" type="text" value="<%=rs("fkey")%>" size="30">
              &nbsp;Meta标签</td>
          </tr>
          <tr> 
            <td colspan="3" align="center" height="40"><input type="submit" value="确定" class="submitinput">
              &nbsp;&nbsp;&nbsp;
              <input type="reset" value="重置" class="submitinput">
            </td>
          </tr>

        </form>
      </table>
<%
	'站点配置结束///////////////////////////////////////////////////////////







	case "face"
	'表情配置开始///////////////////////////////////////////////////////////
	if request("action") = "1" then
		if trim(request("faceimage_add")) <> "" and trim(request("facetext_add")) <> "" then
			faceupdate_sql = "insert into face(face_image,face_text) values('" & trim(request("faceimage_add")) & "','" & trim(request("facetext_add")) & "')"
			conn.execute(faceupdate_sql)
			response.redirect ("?type=face")
			response.end
		end if
		if request("face_del") <> Empty then
			conn.execute ("delete * from face where face_id=" & cint(request("face_del")))
			response.redirect ("?type=face")
			response.end
		end if
		if request("face_edit") <> Empty then
			conn.execute ("update face set face_image='" & trim(request("faceimage")) & "', face_text='" & trim(request("facetext")) & "' where face_id=" & cint(request("face_edit")))
			if err then
				response.write err.description
			else
				response.redirect ("?type=face")
				response.end
			end if			
		end if

	end if
	face_sql = "select * from face"
	set face_rs = conn.execute(face_sql)
%>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr><td>
<div style="overflow-y: scroll;overflow-x:hidden;height: 388px;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#AEA387 1px solid;">
        
          <tr align="center" bgcolor="#8A816B"> 
            <td height="20" colspan="5"><font color="#FFFFFF">表情配置</font></td>
          </tr>
	    <tr align="center" bgcolor="#F1EEE4"> 
            <td height="20"><span style="color:#4F493E;">删除</span></td>
			<td height="20"><span style="color:#4F493E;">文件</span></td>
			<td height="20"><span style="color:#4F493E;">代码</span></td>
			<td height="20"><span style="color:#4F493E;">图片</span></td>
			<td height="20"><span style="color:#4F493E;">编辑</span></td>
          </tr>
		  <%
		if face_rs.eof and face_rs.bof then
			response.write ("<tr bgcolor='#ffffff' height='25'><td align='center' colspan='5'>没有表情</td></tr>")
		else
			do while not face_rs.eof
		  		response.write ("<form method='post' action='?type=face&action=1&face_edit=" & face_rs("face_id") & "'><tr bgcolor='#ffffff' height='25'><td align='center'><input type='checkbox' name='face_del' value='" & face_rs("face_id") & "'></td><td align='center'><input name='faceimage' type='text' value='" & face_rs("face_image") & "'></td><td align='center'><input name='facetext' type='text' value='" & face_rs("face_text") & "'></td><td align='center'><img src='images/face/" & face_rs("face_image") & "'></td><td align='center'><input type='submit' value='编辑'  class='submitinput'></td></tr></form>")
				face_rs.movenext
			loop
		end if
		  %> 
		  </table></div>
		  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		  <form method="post" name="faceform" action="admin.asp?type=face&action=1">
		<tr bgcolor='#ffffff' height="25">
			<td width="47" align="center">添加:</td><td width="165" align="center"><input type="text" name="faceimage_add"></td><td width="178" align="center"><input type="text" name="facetext_add"></td><td colspan="2">&nbsp;</td>
		</tr>
          <tr bgcolor='#ffffff'> 
			<td height="40" colspan="5" align="center"><input type='submit' value='确定编辑' class="submitinput"></td>
          </tr>
        </form>
      </table>
	
<%
	'表情配置结束///////////////////////////////////////////////////////////////////////////////////////////////
	case "caput"
	'头像配置开始|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

		if request("action") = "1" then
			if trim(request("caputimage_add")) <> "" then
				conn.execute("insert into fcaput(ca_image) values('" & trim(request("caputimage_add")) & "')")
				response.redirect ("?type=caput")
				response.end
			end if
			if request("caput_del") <> Empty then
				conn.execute ("delete * from fcaput where ca_id=" & cint(request("caput_del")))
				response.redirect ("?type=caput")
				response.end
			end if
			if request("caput_edit") <> Empty then
				conn.execute ("update fcaput set ca_image='" & trim(request("caputimage")) & "' where ca_id=" & cint(request("caput_edit")))
				if err then
					response.write err.description
				else
					response.redirect ("?type=caput")
					response.end
				end if			
			end if
		end if

	set caput_rs = conn.execute("select * from fcaput")
%>

	<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
	<tr><td>
	<div style="overflow-y: scroll;overflow-x:hidden;height: 388px;">
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1"  bgcolor="#8A816B">
        
          <tr align="center" bgcolor="#8A816B"> 
            <td height="20" colspan="5"><font color="#FFFFFF">头像配置</font></td>
          </tr>
	    <tr align="center" bgcolor="#F1EEE4">
			<td height="20"><span style="color:#4F493E;">序号</span></td>
            <td height="20"><span style="color:#4F493E;">删除</span></td>
			<td height="20"><span style="color:#4F493E;">文件</span></td>
			<td height="20"><span style="color:#4F493E;">图片</span></td>
			<td height="20"><span style="color:#4F493E;">编辑</span></td>
          </tr>
		  
		  <%

		if caput_rs.eof and caput_rs.bof then
			response.write ("<tr bgcolor='#ffffff' height='25'><td align='center' colspan='5'>没有头像</td></tr>")
		else
			do while not caput_rs.eof
		  		response.write ("<form method='post' action='?type=caput&action=1&caput_edit=" & caput_rs("ca_id") & "'><tr bgcolor='#ffffff' height='25'><td align='center'>" & caput_rs("ca_id") & "</td><td align='center'><input type='checkbox' name='caput_del' value='" & caput_rs("ca_id") & "'></td><td align='center'><input name='caputimage' type='text' value='" & caput_rs("ca_image") & "'></td><td align='center'><img src='images/humen/" & caput_rs("ca_image") & "' height='75' width='75'></td><td align='center' valign='middle'><input type='submit' value='编辑' class='submitinput'></td></tr></form>")
				caput_rs.movenext
			loop
		end if
		if err then
			response.write err.description
		end if
		  %> 
		  </table></div>
		  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		  <form method="post" name="caputform" action="?type=caput&action=1">
		<tr bgcolor='#ffffff' height="25">
			<td width="45" align="center">添加:</td><td width="178" align="center"><input type="text" name="caputimage_add"></td><td colspan="2">&nbsp;</td>
		</tr>
          <tr bgcolor='#ffffff'> 
			<td height="25" colspan="5" align="center"><input type='submit' value='确定编辑' class="submitinput"></td>
          </tr>
        </form>
      </table>
<%
	'头像配置结束||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
	end select
	face_rs.close
	set face_rs = nothing
	caput_rs.close
	set caput_rs = nothing
	conn.close
	set conn = nothing
%>
   </td></tr></table> </td>
  </tr>
</table>
<!-- #include file="footer.asp" -->

