<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权管理网站设置！');history.go(-1);</script>"
response.End
end if
%>
<%


dim action
action=trim(request.form("action"))
if action="save" then
if Not isNumeric(request.form("watermarksize")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('字体大小必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("watermarkX")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('坐标位置X必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("watermarkY")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('坐标位置Y必须是数字！');history.go(-1);</script>"
response.End
end if

set rs=server.CreateObject("adodb.recordset")
rs.Open "select *  from sdx_watermark ",conn,1,3
rs("watermarkon")=trim(request.form("watermarkon"))
rs("Thumbok")=trim(request.form("Thumbok"))
rs("watermarkObject")=trim(request.form("watermarkObject"))
rs("watermarkheight")=trim(request.form("watermarkheight"))
rs("watermarkwidth")=trim(request.form("watermarkwidth"))
rs("watermarkimg")=trim(request.form("watermarkimg"))
rs("watermarktxt")=trim(request.form("watermarktxt"))
rs("watermarkBond")=trim(request.form("watermarkBond"))
rs("watermarkFont")=trim(request.form("watermarkFont"))
rs("watermarksize")=trim(request.form("watermarksize"))
rs("watermarkclr")="&H"&right(request.form("watermarkclr"),6)
rs("watermarkshowclr")="&H"&right(request.form("watermarkshowclr"),6)
rs("watermarkX")=trim(request.form("watermarkX"))
rs("watermarkY")=trim(request.form("watermarkY"))
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('网站高级信息设置成功！');history.go(-1);</script>"
end if%>
<script language="javascript">
function ChangeColor(n){
 var clr = window.showModalDialog('Color.htm',"ColorWin",'dialogWidth:508px;dialogHeight:412px;status:no');
   if(clr==null)return;
   if(n==null)return;
   if(n==1){form1.watermarkclr.value=clr;}
   if(n==2){form1.watermarkshowclr.value=clr;}
   if(n==3){form1.bgclr3.value=clr;}
   if(n==4){form1.bgclr4.value=clr;}
   if(n==5){form1.bgclr5.value=clr;}
   if(n==6){form1.bgclr6.value=clr;}
   if(n==7){form1.bgclr7.value=clr;}
   if(n==8){form1.bgclr8.value=clr;}
 //变量名自己改myColor 等号后面的就是调用语句.

 }
</script>
<title>网站水印设置</title>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="16"> <div align="center"><font color="#FFFFFF">
        网站水印设置</font></div></td>
  </tr>
  <tr> 
    <td height="107" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#F1F1F1">
        <form name="form1" method="post" action="admin_watermark.asp">
          <%set rs=server.CreateObject("adodb.recordset")
            rs.Open "select *  from sdx_watermark",conn,1,1%>
          <tr bgcolor="#FFFFFF"> 
            <td COLSPAN="3"><DIV ALIGN="CENTER"><strong><font size="2">网站水印设置</font></strong></DIV></td>
          </tr>
           <tr bgcolor="#FFFFFF"> 
            <td height="20">是否加水印：</td>
            <td COLSPAN="2">
            <select class=shopinput1 name="watermarkon" id="watermarkon">
		<option value="0" <% if rs("watermarkon")="0" Then Response.write("Selected") %>>不加</option>
		<option value="1" <% if rs("watermarkon")="1" Then Response.write("Selected") %>>加水印</option>
              </select>
			</td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
            <td height="20">是否生成缩略图：</td>
            <td COLSPAN="2">
            <select class=shopinput1 name="Thumbok" id="Thumbok">
		<option value="0" <% if rs("Thumbok")="0" Then Response.write("Selected") %>>不生成</option>
		<option value="1" <% if rs("Thumbok")="1" Then Response.write("Selected") %>>生成</option>
              </select>
			</td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
            <td height="20">水印组件：</td>
            <td COLSPAN="2">
            <select class=shopinput1 name="watermarkObject" id="watermarkObject">
		<option value="0" <% if rs("watermarkObject")="0" Then Response.write("Selected") %>>无</option>
		<option value="1" <% if rs("watermarkObject")="1" Then Response.write("Selected") %>>AspJpeg组件</option>
              </select>
			</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="16%" height="20">水印文字：</td>
            <td COLSPAN="2"><input class=shopinput1 NAME="watermarktxt" TYPE="text" ID="watermarktxt" SIZE="28" VALUE="<% = rs("watermarktxt") %>"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="20">水印字体：</td>
            <td COLSPAN="2">
      <select class=shopinput1 name="watermarkFont" id="watermarkFont">
	<option value="宋体" <% if rs("watermarkFont")="宋体" Then Response.write("Selected") %>>宋体</option>
	<option value="楷体_GB2312" <% if rs("watermarkFont")="楷体_GB2312" Then Response.write("Selected") %>>楷体</option>
        <option value="仿宋_GB2312" <% if rs("watermarkFont")="仿宋_GB2312" Then Response.write("Selected") %>>新宋体</option>
        <option value="黑体" <% if rs("watermarkFont")="黑体" Then Response.write("Selected") %>>黑体</option>
        <option value="隶书" <% if rs("watermarkFont")="隶书" Then Response.write("Selected") %>>隶书</option>
         <option value="幼圆" <% if rs("watermarkFont")="幼圆" Then Response.write("Selected") %>>幼圆</option>
         <option value="Andale Mono" <% if rs("watermarkFont")="Andale Mono" Then Response.write("Selected") %>>Andale Mono</option>
         <option value="Arial" <% if rs("watermarkFont")="Arial" Then Response.write("Selected") %>>Arial</option>
          <option value="Arial Black" <% if rs("watermarkFont")="Arial Black" Then Response.write("Selected") %>>Arial Black</option>
          <option value="Book Antiqua" <% if rs("watermarkFont")="Book Antiqua" Then Response.write("Selected") %>>Book Antiqua</option>
          <option value="Century Gothic" <% if rs("watermarkFont")="Century Gothic" Then Response.write("Selected") %>>Century Gothic</option>
           <option value="Comic Sans MS" <% if rs("watermarkFont")="Comic Sans MS" Then Response.write("Selected") %>>Comic Sans MS</option>
           <option value="Courier New" <% if rs("watermarkFont")="Courier New" Then Response.write("Selected") %>>Courier New</option>
          <option value="Georgia" <% if rs("watermarkFont")="Georgia" Then Response.write("Selected") %>>Georgia</option>
          <option value="Impact" <% if rs("watermarkFont")="Impact" Then Response.write("Selected") %>>Impact</option>
           <option value="Tahoma" <% if rs("watermarkFont")="Tahoma" Then Response.write("Selected") %>>Tahoma</option>
            <option value="Times New Roman" <% if rs("watermarkFont")="Times New Roman" Then Response.write("Selected") %>>Times New Roman</option>
            <option value="Trebuchet MS" <% if rs("watermarkFont")="Trebuchet MS" Then Response.write("Selected") %>>Trebuchet MS</option>
             <option value="Script MT Bold" <% if rs("watermarkFont")="Script MT Bold" Then Response.write("Selected") %>>Script MT Bold</option>
            <option value="Stencil" <% if rs("watermarkFont")="Stencil" Then Response.write("Selected") %>>Stencil</option>
            <option value="Verdana" <% if rs("watermarkFont")="Verdana" Then Response.write("Selected") %>>Verdana</option>
            <option value="Lucida Console" <% if rs("watermarkFont")="Lucida Console" Then Response.write("Selected") %>>Lucida Console</option>
              </select></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="16%" height="20">文字大小：</td>
            <td COLSPAN="2"><input class=shopinput1 NAME="watermarksize" TYPE="text" ID="watermarksize" SIZE="28" VALUE="<% = rs("watermarksize") %>"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="20">文字颜色：</td>
            <td COLSPAN="2"><input class=shopinput1 NAME="watermarkclr" TYPE="text" ID="watermarkclr" SIZE="28" VALUE="#<% = right(rs("watermarkclr"),6) %>"> <A HREF="#" onClick="ChangeColor(1)"><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
           <tr bgcolor="#FFFFFF"> 
            <td height="20">阴影颜色：</td>
            <td COLSPAN="2"><input class=shopinput1 NAME="watermarkshowclr" TYPE="text" ID="watermarkshowclr" SIZE="28" VALUE="#<% = right(rs("watermarkshowclr"),6) %>"> <A HREF="#" onClick="ChangeColor(2)"><IMG SRC=../images/cgcolor.gif ALT="调色板" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="22">是否粗体：</td>
            <td height="22" colspan="2">
              <select class=shopinput1 name="watermarkBond" id="watermarkBond">
		<option value="0" <% if rs("watermarkBond")="0" Then Response.write("Selected") %>>否</option>
		<option value="1" <% if rs("watermarkBond")="1" Then Response.write("Selected") %>>是</option>
              </select></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="20">坐标位置：</td>
            <td COLSPAN="2">X：<input class=shopinput1 NAME="watermarkX" TYPE="text" ID="watermarkX" SIZE="8" VALUE="<% = rs("watermarkX") %>">Y：<input class=shopinput1 NAME="watermarkY" TYPE="text" ID="watermarkY" SIZE="8" VALUE="<% = rs("watermarkY") %>"></td>
          </tr>
          
          <tr bgcolor="#FFFFFF"> 
            <td height="22" colspan="3"> <div align="center"> 
                <input class=shopinput1 type="submit" name="Submit" value="提 交">
                <input class=shopinput1 name="action" type="hidden" value="save">
                &nbsp;&nbsp; 
                <input class=shopinput1 type="reset" name="Submit2" value="恢 复">
              </div></td>
          </tr>
        </form>
      </table>
      <%rs.Close
          set rs=nothing
		  conn.close
		  set conn = Nothing %>
    </td>
  </tr>
</table>
<!--#include file="footer.asp"--> 
</body>
</html>
<script>
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
</script>
