<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />



<title><%=webname%>-分类编辑</title>
<%
call logquanxian("c1",1)
%>


<DIV>

<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 (!CheckIfid(form.ayshqq.value) || form.ayshqq.value.length > 12){
	alert ("商户QQ填写错误");return false;	}
   
}
</script>

<%
act=SafeRequest("act")

if act="edit" then
call lognamecode()
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")

sql="select * from aykafenlei where aykafenleiid="&clng(id)&"" 
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
if ayshurl<>"" then rs("aykafenleiurl")=ayshurl
if ayshqq<>"" then rs("aykafenleiqq")=ayshqq
rs.update
rs.close
call logadd(request.Cookies("aynameid"),"管理-分类信息修改成功"&mingcheng,0,0)
call PopErr2("分类信息修改成功","adminfenlei.asp")
end if

end if


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

%>

<DIV id=main1200> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<DIV class=right_titleadmin>&nbsp;&nbsp;分类编辑</DIV>
<DIV class=main><br>
	  <% 
	  sql="select * from aykafenlei where aykafenleiid="&clng(id)&"" 
	  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" cellspacing="0" cellpadding="0" class="table_style_a1">
    <tr>
      <td width="80" align="center">商品分类：</td>
      <td><input name="mingcheng" type="text" id="mingcheng" value="<%=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="<%=trim(rs("aykafenleishuoming"))%>" size="40" maxlength="40">
        (商品描述信息将显示在订单查询结果下方 不超过40汉字)</td>
    </tr>
    <tr>
      <td align="center">商户名称：</td>
      <td>
        (若为空，商品出售页面则显示商户信息中的站点名称 不超过40汉字)</td>
    </tr>
    <tr>
      <td align="center">商户网址：</td>
      <td><input name="ayshurl" type="text" id="ayshurl" value="<%=trim(rs("aykafenleiurl"))%>" size="40" maxlength="40">
        (若为空，商品出售页面则显示商户信息中的站点网址 不超过40字符)</td>
    </tr>
    <tr>
      <td align="center">商户QQ：</td>
      <td><input name="ayshqq" type="text" id="ayshqq" value="<%=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" value=" 确 认 修 改 "></td>
      </tr>
  </table>
</form>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


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

