<!--#include virtual="/show/userhead.asp"-->
<!--#include file="subleft.asp"-->

<script>document.getElementById('o_2').setAttribute("class", "ed"); document.getElementById("t_2").style.display="";document.getElementById('s_2_1').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-分类编辑</title>
		
<script language=javascript>
function CheckIfEnglish( String )<!--检验表单必须是字母或数字-->
{ 
    var Letters = "abcdefghijklmnopqrstuvwxyz0123456789-";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}
function CheckIfid( String )<!--检验表单必须是数字-->
{ 
    var Letters = "1234567890";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}
function Checkjinid( String )<!--检验表单必须是数字-->
{ 
    var Letters = "1234567890.";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}
function ischinese(s)<!--检验表单必须是中文-->
{
var ret=true;
for(var i=0;i<s.length;i++)
ret=ret && (s.charCodeAt(i)>=10000);
return ret;
}
</script>
<script language=javascript>
function check_add()
{
  
   if(form.shunxu.value=="" || !CheckIfid(form.shunxu.value))
   {alert("分类顺序填写错误");return false}
   
   if(form.mingcheng.value=="" || form.mingcheng.value.length > 25)
   {alert("分类名称填写错误");return false}
   
    if (form.ayshmiaoshu.value.length > 60){
	alert ("商户描述字符不能超过60");return false;	}

  	if (form.ayshurl.value.length > 60){
	alert ("商户网址字符不能超过60");return false;	}
	
	if(form.ayshqq.value!=""){
  	if (!CheckIfid(form.ayshqq.value) || form.ayshqq.value.length < 5){
	alert ("商户QQ填写错误");return false;	}
	if (!CheckIfid(form.ayshqq.value) || form.ayshqq.value.length > 12){
	alert ("商户QQ填写错误");return false;	}
	}
   
}
</script>

<%
act=SafeRequest("act")

if act="edit" then

sql="select ayisguolv,ayguolvcon from ayquanju" 
rs.open sql,conn,1,1
ayisguolv=rs("ayisguolv")
ayguolvcon=trim(rs("ayguolvcon"))
rs.close

id=SafeRequestform("id")
mingcheng=SafeRequestform("mingcheng")
if mingcheng="" then call PopErr("分类名称未填写")
shunxu=SafeRequestform("shunxu")
if shunxu="" then call PopErr("分类顺序未填写")
ayshmiaoshu=SafeRequestform("ayshmiaoshu")
ayshurl=SafeRequestform("ayshurl")
ayshqq=SafeRequestform("ayshqq")

if ayisguolv=1 then
if guolvRequestform("mingcheng",ayguolvcon)=false then 
call logadd(request.Cookies("aynameid"),"修改分类含有敏感文字"&mingcheng,0,1) 
call PopErr("表单含有禁止使用的敏感文字")
end if
if guolvRequestform("ayshmiaoshu",ayguolvcon)=false then 
call logadd(request.Cookies("aynameid"),"修改分类描述含有敏感文字"&ayshmiaoshu,0,1) 
call PopErr("表单含有禁止使用的敏感文字")
end if

if guolvRequestform("ayshurl",ayguolvcon)=false then 
call logadd(request.Cookies("aynameid"),"修改分类商户url含有敏感文字"&ayshurl,0,1) 
call PopErr("表单含有禁止使用的敏感文字")
end if
end if

if instr(1,trim(mingcheng),"|")<>0 then call PopErr("分类名称,字符 | 不可以使用哦，请重新填写！")
if instr(1,trim(ayshmiaoshu),"|")<>0 then call PopErr("分类描述,字符 | 不可以使用哦，请重新填写！")
if instr(1,trim(ayshurl),"|")<>0 then call PopErr("分类网址,字符 | 不可以使用哦，请重新填写！")

sql="select * from aykafenlei where aykafenleiid="&clng(id)&" and aykanamesuoyou="&request.Cookies("aynameid")&"" 
rs.open sql,conn,1,3
if rs.bof and rs.eof then 
call PopErr("获取分类信息错误")
else

rs("aykafenleiname")=mingcheng
rs("aykafenleisx")=clng(shunxu)

if ayshmiaoshu<>"" then 
rs("aykafenleishuoming")=ayshmiaoshu
else
rs("aykafenleishuoming")=" "
end if

if ayshurl<>"" then 
rs("aykafenleiurl")=ayshurl
else
rs("aykafenleiurl")=" "
end if 

if ayshqq<>"" then 
rs("aykafenleiqq")=ayshqq
else
rs("aykafenleiqq")=0
end if
rs.update
rs.close
call logadd(request.Cookies("aynameid"),"分类修改成功"&left(mingcheng,20),5,0)
call PopErr2("分类信息修改成功","fenlei")
end if

end if


id=SafeRequest("id")
if id="" then call PopErr("获取参数错误")

%>
<br>
<DIV id=main2> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>

<H2><SPAN>分类编辑</SPAN></H2>
<DIV class=main3>
	  <% 
	  sql="select * from aykafenlei where aykafenleiid="&clng(id)&" and aykanamesuoyou="&request.Cookies("aynameid")&"" 
	  rs.open sql,conn,1,1
	  if rs.bof and rs.eof then 
	  call PopErr("获取分类数据错误")
	  end if
	  %>
	  <form action="?act=edit" method="post" name="form" id="form" onSubmit="return check_add()">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
    <tr>
      <td width="80" height="45" align="center">商品分类：</td>
      <td><input name="mingcheng" type="text" id="mingcheng" value="<%=server.HTMLEncode(trim(rs("aykafenleiname")))%>" maxlength="30">	        </td>
    </tr>

    <tr>
      <td align="center">分类排序：</td>
      <td><input name="shunxu" type="text" id="shunxu" value="<%=rs("aykafenleisx")%>" maxlength="4">
        数字越小越靠前</td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;&nbsp;<strong>商品分类额外信息</strong></td>
      </tr>
    <tr>
      <td align="center">分类描述：</td>
	  
      <td><input name="ayshmiaoshu" type="text" id="ayshmiaoshu" value="<%if isnull(trim(rs("aykafenleishuoming")))=true or trim(rs("aykafenleishuoming"))="" then response.Write" ":else:response.Write server.HTMLEncode(trim(rs("aykafenleishuoming"))):end if%>" size="40" maxlength="40">
        (商品描述信息将显示在订单查询结果上方 不超过40汉字)</td>
    </tr>
    <tr>
      <td align="center">分类网址：</td>
      <td><input name="ayshurl" type="text" id="ayshurl" value="<%if isnull(trim(rs("aykafenleiurl")))=true or trim(rs("aykafenleiurl"))="" then response.Write" ":else:response.Write server.HTMLEncode(trim(rs("aykafenleiurl"))):end if%>" size="40" maxlength="40">
        完整地址 如 http://ikpay.cn (若为空，商品出售页面则显示商户信息中的站点网址)</td>
    </tr>
    <tr>
      <td align="center">分类QQ：</td>
      <td><input name="ayshqq" type="text" id="ayshqq" value="<%if trim(rs("aykafenleiqq"))<>0 then response.Write trim(rs("aykafenleiqq"))%>" maxlength="12">
        (若为空，商品出售页面则显示商户信息中的联系QQ)</td>
    </tr>
    <tr>
      <td colspan="2" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input name="id" type="hidden" id="id" value="<%=id%>">        
        &nbsp;&nbsp;
        <input type="submit" name="Submit" style="cursor:pointer"  class="butbaocun" value=" 确 认 修 改 "></td>
      </tr>
  </table>
</form>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>


<br>

	<!--#include virtual="/show/foot.asp"-->


