<!-- #Include File="Include/AMH_onlogin.asp" -->
<!-- #Include File="../Include/Inc_UpRemote.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V2.0》，简称“AsaiMHV2”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

del_user_true=true
del_upload_true=true
Index_Url="Shop"
PageUrl = PageUrl&"ChannelIDs="&iChannelIDs&"&"
dim dim_tmp,img0,Web_Shop
Call Cls.Channel_Initialize(3)
Web_Shop=split(Cls.ChannelOption,"|")
Call AMH_Master(1,2)
Call AMH_Header(1)
Select Case AsaiMHMod
case "isgood"
  ntit="推荐"&tit_fir
  sql_add=" isgood=1"
case "sh"
  ntit="待审核"&tit_fir
  sql_add=" hidden=0"
case else
  ntit=tit_fir&"列表"
  sql_add=" hidden=1"
end select
%>
<script language = 'JavaScript'>
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)
}
function IsDigit(){
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function getprice(Price_Original){
  if(Price_Original==''|| isNaN(Price_Original)){Price_Original=0;}
  if(document.add_frm.ProductType[2].checked==true){document.add_frm.Price.value=Math.round(Price_Original*Math.abs(document.add_frm.Discount.value/100)*100)/100;}
  else{document.add_frm.Price.value=Price_Original;}
}
</script>
<tr><td align=center colspan=2 height=30>
    <table border=0>
  <tr>
  <td><a href='?ChannelIDs=<%=iChannelIDs%>'><%Response.Write tit_fir%>列表</a></td>
  <td width=10></td>
  <td><a href='?AsaiMHMod=isgood&ChannelIDs=<%=iChannelIDs%>'<%if AsaiMHMod="isgood" then Response.Write " class=red"%>>推荐<%Response.Write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?AsaiMHMod=sh&ChannelIDs=<%=iChannelIDs%>'<%if AsaiMHMod="sh" then Response.Write " class=red"%>>待审核<%Response.Write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?Action=Add&ChannelIDs=<%=iChannelIDs%>&ClassID=<%Response.Write ClassID%>'<%if action="add" then Response.Write " class=red"%>>添加<%Response.Write tit_fir%></a></td>
<%call AsaiMHIs_Nsort_Review()%>
  </tr>
  </table>
</td></tr>
<tr><td colspan=2 align=center>
  <table border=0 cellspacing=0 cellpadding=2>
  <form action='?' method=get>
  <input type=hidden name=ChannelIDs value='<%Response.Write iChannelIDs%>'>
  <input type=hidden name=AsaiMHMod value='<%Response.Write AsaiMHMod%>'>
  <input type=hidden name=ClassID value='<%Response.Write ClassID%>'>
  <tr>
  <td>搜索（<%Response.Write ntit%>） 关键字：</td>
  <td><input type=text name=keyword value='<%Response.Write trim(request.querystring("keyword"))%>' size=15 maxlength=20></td>
  <td><select name=sea_type size=1>
<option value='name'>按标题</option>
<!--
<option value='username'>按发布人</option>
-->
</select></td>
  <td><select name=sea_term sizs=1><option value='all'>满足所有条件</option><option value='only'>满足一个条件</option></seelct></td>
  <td><input type=submit value='搜索' class=btn></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
Call AMH_Table(1)
If Action="handle" Then call AsaiMHGo_Handle()
Select Case LCase(Action)
Case "clear"
  AsaiMHGo_Clear()
Case "add"
  AsaiMHChk_Add()
Case "edit"
  AsaiMHChk_Edit()
Case else
  AsaiMHChk_Main()
End Select
if isarray(dim_tmp) then erase dim_tmp
Call AMH_Ender(1)

sub AsaiMHChk_Edit()
  dim name,price,discount,is_emoney,emoney,tim,counter,buy_counter,isgood,istop,hidden,Pic,ispic,Isfocus,tcolor,Brief,word,oSpecialID
  dim tmp1,tmp2,Stocks,StocksName,con_integral,con_emoney,ProductType,Price_Original,Price_Market
  call AMH_td("编辑"&tit_fir)
  sql="select top 1 * from "&Data_Name&" where id="&id
  call Cls.exec(sql,-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    call AMH_msg(tit_fir&"ID（"&id&"）不存在！","?",1)
    exit sub
  end if
  if chk() then
     name=Cls.Code_Admin("name",1,100)
    price=Cls.Code_Admin("price",1,10)
    if not(isnumeric(price)) then price=0
    Price_Original=Cls.Code_Admin("Price_Original",1,10)
    if not(isnumeric(Price_Original)) then Price_Original=0
    Price_Market=Cls.Code_Admin("Price_Market",1,10)
    if not(isnumeric(Price_Market)) then Price_Market=0
    emoney=Cls.Code_Admin("emoney",1,10)
    if not(isnumeric(emoney)) then emoney=0
    Brief=Cls.Code_Admin("Brief",1,250)
    word=request.form("word")
  if Cls.Code_Remark("remote")="yes" then word=DoRemoteUpload(word,Cls.ChannelUpMax,Cls.ChannelUpFileType(4),Cls.ChannelUploadDir,Cls.Get_ChannelSetup(Cls.ChannelSetup,15))
    csid=trim(request.form("ClassID"))
    is_emoney=false
    if Cls.Code_Admin("is_emoney",1,10)="yes" then is_emoney=true
    if cs_nd(csid)=false then
      call AMH_error("请选择 "&tit_fir&"分类！<br />如有下级分类，请如实选择所属下级分类")
      exit sub
    end if
    if name="" or Brief="" or word="" then
      call AMH_error(tit_fir&"名称、"&tit_fir&"简单说明、"&tit_fir&"详细说明 等不能为空！")
      exit sub
    end if
    if instr(price,"-")>0 then
      call AMH_error(tit_fir&"的价格 不能为空，且要为大于0的数字！")
      exit sub
    end if
    if is_emoney=true and int(emoney)<=0 or instr(emoney,".")>0 then
      call AMH_error(tit_fir&"可用"&web_dim(8)&"时"&web_dim(8)&"不能为空，且要为大于0的整数！")
      exit sub
    end if
    discount=Cls.Code_Admin("discount",1,10)
    if not(isnumeric(discount)) then discount=0
    if int(discount)<1 or int(discount)>100 then discount=100
    tim=Cls.Code_Admin("tim",1,20)
    tim=Cls.time_type(tim,1)
    if tim="" then tim=Cls.now_time
	pic=Cls.Code_Admin("pic",1,100)
	ispic=true
    if pic="" then ispic=false
    counter=trim(request.form("counter"))
    if not isnumeric(counter) then counter=0
    buy_counter=trim(request.form("buy_counter"))
    if not isnumeric(buy_counter) then buy_counter=0
    Stocks=trim(request.form("Stocks"))
    if not isnumeric(Stocks) then Stocks=0
    StocksName=trim(request.form("StocksName"))
    con_integral=trim(request.form("con_integral"))
    if not isnumeric(con_integral) then con_integral=0
	con_emoney=trim(request.form("con_emoney"))
    if not isnumeric(con_emoney) then con_emoney=0
    isgood=false
    if Cls.Code_Form("isgood")="yes" then isgood=true
		istop=0
    if Cls.Code_Form("istop")="yes" then istop=1
	Isfocus=false
    if Cls.Code_Form("Isfocus")="yes" then Isfocus=true
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false
    ProductType=trim(request.form("ProductType"))
    oSpecialID=Cls.Code_Int("SpecialID",0)
    tcolor=Cls.Code_Form("tcolor")
    Call Chk_Cid()
    rs("ChannelIDs")=iChannelIDs
    rs("SpecialID")=oSpecialID
    rs("ClassID")=cid
    rs("cod")=1
    rs("name")=name
    rs("tcolor")=tcolor
    rs("serial")=Cls.Code_Admin("serial",1,20)
    rs("brand")=Cls.Code_Admin("brand",1,20)
    rs("stock")=Cls.Code_Admin("stock",1,5)
    rs("Stocks")=Stocks
    rs("StocksName")=StocksName
    rs("con_integral")=con_integral
    rs("con_emoney")=con_emoney
    rs("ProductType")=ProductType
    rs("Price_Original")=Price_Original
    rs("Price_Market")=Price_Market
    rs("Brief")=Brief
    rs("word")=word
    rs("Pic")=Pic
    rs("ispic")=ispic
    rs("counter")=counter
    rs("buy_counter")=buy_counter
    rs("isgood")=isgood
    rs("istop")=istop
    rs("Isfocus")=Isfocus
    rs("hidden")=hidden
    rs("tim")=tim
    rs("keyes")=Cls.Code_Admin("keyes",1,20)
    rs("price")=price
    rs("discount")=discount
    rs("is_emoney")=is_emoney
    rs("emoney")=emoney
    rs("isUpdate")=True
    rs.update
    rs.close
    call AMH_msg("已成功编辑了一个"&tit_fir&"！","?AsaiMHMod="&AsaiMHMod&"&ClassID="&cid&"&ChannelIDs="&iChannelIDs,0)
    exit sub
  end if
  call form_first()
  iChannelIDs=rs("ChannelIDs")
  oSpecialID=rs("SpecialID")
  cid=rs("ClassID")
  pic=rs("pic")
  if ispic="" then ispic=Cls.Rand_File(Index_Url)
%>
<form name=add_frm action='?AsaiMHMod=<%Response.Write AsaiMHMod%>&ChannelIDs=<%=iChannelIDs%>&ClassID=<%Response.Write ClassID%>&action=edit&id=<%Response.Write id%>' method=post  onSubmit="return checkPost(3);">
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<tr>
<td><%Response.Write tit_fir%>标题：</td>
<td><input type=text name=name value='<%Response.Write rs("name")%>' size=60 maxlength=40><%Response.Write redx%>&nbsp;&nbsp;<%= ShowColor("tcolor",rs("tcolor"))%></td>
</tr>
<%dim preset:preset=split(Cls.ChannelPreset,"|||")
  Response.Write ShowClassSel(iChannelIDs,CID,Cls.ClassDepth)
  Response.Write ShowSpecialSel(iChannelIDs,rs("SpecialID"))
  Response.Write ShowKeyWord(rs("keyes"),preset(0))
%>
<tr>
<td><%Response.Write tit_fir%>编号：</td>
<td><input type=text name=serial value='<%Response.Write rs("serial")%>' size=20 maxlength=20>&nbsp;&nbsp;<input type='checkbox' name='AutoGetNum' value='Yes' checked onclick='serial.disabled=this.checked'>自动编号&nbsp;&nbsp;&nbsp;&nbsp;品牌：<input type=text id=brand name=brand value='<%Response.Write rs("brand")%>' size=20 maxlength=20>
<select onChange="brandks(this.value);">
<option value='' selected>选择品牌</option>
<%
  dim_tmp=split(Web_Shop(2),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'>"&dim_tmp(i)&"</option>"
  next
%>
</select>
<!--
<select onChange="brandks(this.value);">
<option value='' selected>选择品牌</option>
<%
  'tmp1=rs("brand")
  'dim_tmp=split(Web_Shop(2),":")
  'for i=0 to ubound(dim_tmp)
    'Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'"
    'if tmp1=dim_tmp(i) then Response.Write " selected"
    'Response.Write ">"&dim_tmp(i)&"</option>"
  'next
%>
</select>
-->
<script language=javascript>
function brandks(kv){
var ov=document.getElementById("brand");
if (ov.value!=""){
ov.value+=","+kv;
}
else{
ov.value+=kv;
}
}
</script>&nbsp;</td></tr>
<tr>
	<td><%Response.Write tit_fir%>库存：</td><td>库存情况：<select name=stock>
<%
  tmp1=rs("stock")
  dim_tmp=split(Web_Shop(3),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'"
    if tmp1=dim_tmp(i) then Response.Write " selected"
    Response.Write ">"&dim_tmp(i)&"</option>"
  next
%></select>&nbsp;&nbsp;库存数量：<input name='Stocks' type='text' value='<%response.write rs("Stocks")%>' size='9' maxlength='10'><select name=StocksName>
<%
  tmp2=rs("StocksName")
  dim_tmp=split(Web_Shop(6),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'"
    if tmp2=dim_tmp(i) then Response.Write " selected"
    Response.Write ">"&dim_tmp(i)&"</option>"
  next
%></select><%response.write redx%>&nbsp;&nbsp;&nbsp;上架时间：<input type=text name=tim value='<%response.write rs("tim")%>' size=20 maxlength=20>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(tim);return false;" class=btn></td>
</tr>
<tr>
<td>购买相关：</td>
<td>可用&nbsp;<input type=checkbox name=is_emoney value='yes'<%if rs("is_emoney") then response.write " checked"%>>&nbsp;<%response.write web_dim(8)%>：<input type=text name=emoney value='<%response.write rs("emoney")%>' size=5 maxlength=5>&nbsp;购买&nbsp;&nbsp;购物增送<input name='con_integral' type='text' value='<%response.write rs("con_integral")%>' size='4' maxlength='4'>点积分&nbsp;&nbsp;<input name='con_emoney' type='text' value='<%response.write rs("con_emoney")%>' size='4' maxlength='4'>个<%response.write web_dim(8)%>&nbsp;&nbsp;购买：<input type=text name=buy_counter value='<%response.write rs("buy_counter")%>' size=5 maxlength=10>&nbsp;次</td>
</tr>
<tr valign=top>
<td><%response.write tit_fir%>销售类型：</td>
<td>
<input name='ProductType' type='radio' value='1' <%if rs("ProductType")=1 then response.write " checked"%> onclick='document.add_frm.Price.value=document.add_frm.Price_Original.value;document.add_frm.Price.disabled=false;'> 正常销售&nbsp;&nbsp;&nbsp;&nbsp;正常销售，没有打折的商品。<br />
<input name='ProductType' type='radio' value='2' <%if rs("ProductType")=2 then response.write " checked"%> onclick='document.add_frm.Price.disabled=false'><font color='green'> 涨价商品&nbsp;&nbsp;&nbsp;&nbsp;如内存条等一些可能涨价的商品</font><br />
<input name='ProductType' type='radio' value='3' <%if rs("ProductType")=3 then response.write " checked"%> onclick='getprice(document.add_frm.Price_Original.value);document.add_frm.Price.disabled=false;'><font color='red'> 降价处理&nbsp;&nbsp;&nbsp;&nbsp;折扣率：<input name='Discount' type='text' value='<%response.write rs("Discount")%>' size='4' maxlength='4' style='text-align: center;'> %
</td>
</tr>
<tr valign=top>
<td><%response.write tit_fir%>价格：<br /><br /><font color=red onclick="javascript:open_win('AMH_Shop_PriceHelp.asp','Help_Price',700,580,'yes');" style="cursor:hand;">查看计算公式</font></td>
<td>
<table border=0>
<tr class=tr>
<td><font color='red'>原始零售价：</font></td>
<td width='280'><input name='Price_Original' type='text' value='<%response.write rs("Price_Original")%>' size='10' maxlength='10' onchange='getprice(this.value)' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)&redx%></td><td><%Call AMH_Read("","原始零售价","正常销售时的价格。以及降价及促销时的参考价。")%></td>
</tr>
<tr class=tr>
<td><font color='blue'>当前零售价：</font></td>
<td><input name='Price' type='text' value='<%response.write rs("Price")%>' size='10' maxlength='10' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)%>&nbsp;
<input type='button' name='calculate' value='计算' onclick='getprice(document.add_frm.Price_Original.value);' class=btn></td>
<td><%Call AMH_Read("","当前零售价","系统会自动根据商品类型、原始零售价及折扣率计算当前零售价。<br />也可以手动输入当前零售价")%></td>
</tr>
<tr class=tr>
<td>市场参考价：</td>
<td><input name='Price_Market' type='text' value='<%response.write rs("Price_Market")%>' size='10' maxlength='10' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)%></td><td><%Call AMH_Read("","市场参考价","市场参考零售价，一般可以设高一些。如果不填或为0，前台不显示。")%></td>
</tr>
</table>
</td>
</tr>
<%
  Response.Write ShowEditor(iChannelIDs,3,"add_frm","word","内容","TempUploadFiles",Cls.code_word(rs("word")))
  Response.Write ShowBrief("Brief",Cls.code_word(rs("Brief")))
  Response.Write ShowPicUpload(iChannelIDs,pic,"pic")
  Response.Write ShowUploadList()
  Response.Write ShowPutInfo("s",rs("tim"))
  Response.Write ShowRelateInfo(rs("isgood"),rs("istop"),rs("Isfocus"),rs("hidden"),rs("counter"))
  Response.Write ShowMoreItem(0,0)
  call submit_edit()
  rs.close
end sub

sub AsaiMHChk_Add()
  dim name,price,discount,is_emoney,AsaiMHemoney,tim,counter,buy_counter,isgood,hidden,Pic,ispic,istop,Isfocus,tcolor,Brief,word,oSpecialID
  dim Stocks,StocksName,con_integral,con_emoney,ProductType,Price_Original,Price_Market
  call AMH_td("添加"&tit_fir)
  if chk() then
    name=Cls.Code_Admin("name",1,100)
    price=Cls.Code_Admin("price",1,10)
    if not(isnumeric(price)) then price=0
    Price_Original=Cls.Code_Admin("Price_Original",1,10)
    if not(isnumeric(Price_Original)) then Price_Original=0
    Price_Market=Cls.Code_Admin("Price_Market",1,10)
    if not(isnumeric(Price_Market)) then Price_Market=0
    AsaiMHemoney=Cls.Code_Admin("AsaiMHemoney",1,10)
    if not(isnumeric(AsaiMHemoney)) then AsaiMHemoney=0
    Brief=Cls.Code_Admin("Brief",1,250)
    word=request.form("word")
  if Cls.Code_Remark("remote")="yes" then word=DoRemoteUpload(word,Cls.ChannelUpMax,Cls.ChannelUpFileType(4),Cls.ChannelUploadDir,Cls.Get_ChannelSetup(Cls.ChannelSetup,15))
    csid=trim(request.form("ClassID"))
	tcolor=trim(request.form("tcolor"))
    if len(tcolor)<>6 then tcolor=""
    is_emoney=false
    if Cls.Code_Admin("is_emoney",1,10)="yes" then is_emoney=true
    if cs_nd(csid)=false then
      call AMH_error("请选择 "&tit_fir&"分类！<br />如有下级分类，请如实选择所属下级分类")
      exit sub
    end if
    if name="" or Brief="" or word="" then
      call AMH_error(tit_fir&"名称、"&tit_fir&"简单说明、"&tit_fir&"详细说明 等不能为空！")
      exit sub
    end if
    if instr(price,"-")>0 then
      call AMH_error(tit_fir&"的价格 不能为空，且要为大于0的数字！")
      exit sub
    end if
    if is_emoney=true and int(AsaiMHemoney)<=0 or instr(AsaiMHemoney,".")>0 then
      call AMH_error(tit_fir&"可用"&web_dim(8)&"时"&web_dim(8)&"不能为空，且要为大于0的整数！")
      exit sub
    end if
    discount=Cls.Code_Admin("discount",1,10)
    if not(isnumeric(discount)) then discount=0
    if int(discount)<1 or int(discount)>100 then discount=100
    tim=Cls.Code_Admin("tim",1,20)
    tim=Cls.time_type(tim,1)
    if tim="" then tim=Cls.now_time
	pic=Cls.Code_Admin("pic",1,100)
		ispic=true
   if pic="" then ispic=false
    counter=trim(request.form("counter"))
    if not isnumeric(counter) then counter=0
    buy_counter=trim(request.form("buy_counter"))
    if not isnumeric(buy_counter) then buy_counter=0
    Stocks=trim(request.form("Stocks"))
    if not isnumeric(Stocks) then Stocks=0
    StocksName=trim(request.form("StocksName"))
    con_integral=trim(request.form("con_integral"))
    if not isnumeric(con_integral) then con_integral=0
	con_emoney=trim(request.form("con_emoney"))
    if not isnumeric(con_emoney) then con_emoney=0
    isgood=false
    if Cls.Code_Form("isgood")="yes" then isgood=true
	 istop=0
    if Cls.Code_Form("istop")="yes" then istop=1
	Isfocus=false
    if Cls.Code_Form("Isfocus")="yes" then Isfocus=true
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false
	ProductType=trim(request.form("ProductType"))
	oSpecialID=Cls.Code_Int("SpecialID",0)
    tcolor=Cls.Code_Form("tcolor")
    Call Chk_Cid()
    sql="select * from "&Data_Name
    call Cls.exec("",-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("ChannelIDs")=iChannelIDs
    rs("SpecialID")=oSpecialID
    rs("name")=name
    rs("tcolor")=tcolor
    rs("ClassID")=cid
    rs("cod")=1
    rs("serial")=Cls.Code_Admin("serial",1,20)
    rs("brand")=Cls.Code_Admin("brand",1,20)
    rs("stock")=Cls.Code_Admin("stock",1,5)
    rs("Stocks")=Stocks
    rs("StocksName")=StocksName
    rs("con_integral")=con_integral
    rs("con_emoney")=con_emoney
    rs("ProductType")=ProductType
    rs("Price_Original")=Price_Original
    rs("Price_Market")=Price_Market
    rs("Brief")=Brief
    rs("word")=word
    rs("Pic")=Pic
    rs("ispic")=ispic
    rs("counter")=counter
    rs("buy_counter")=buy_counter
    rs("isgood")=isgood
    rs("istop")=istop
    rs("Isfocus")=Isfocus
    rs("hidden")=hidden
    rs("tim")=tim
    rs("keyes")=Cls.Code_Admin("keyes",1,20)
    rs("price")=price
    rs("discount")=discount
    rs("is_emoney")=is_emoney
    rs("emoney")=AsaiMHemoney
    rs("HtmlFileDate")=Cls.HtmlRndFileName()
    rs("isUpdate")=True
    rs.update
    rs.close
    Call Cls.Channel_Count(iChannelIDs)
    call AMH_msg("已成功添加了一个"&tit_fir&"！","?AsaiMHMod="&AsaiMHMod&"&ClassID="&cid&"&ChannelIDs="&iChannelIDs,0)
    exit sub
  end if
  call form_first()
    ispic=Cls.rand_file(Index_Url)
%>
<form name=add_frm action='<%Response.Write PageUrl%>Action=add' method=post onSubmit="return checkPost(3);">
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<tr>
<td><%Response.Write tit_fir%>标题：</td>
<td><input type=text name=name size=60 maxlength=100><%Response.Write redx%>&nbsp;&nbsp;<%= ShowColor("tcolor","")%></td>
</tr>
<%dim preset:preset=split(Cls.ChannelPreset,"|||")
  Response.Write ShowClassSel(iChannelIDs,ClassID,Cls.ClassDepth)
  Response.Write ShowSpecialSel(iChannelIDs,0)
  Response.Write ShowKeyWord("",preset(0))
%>
<tr>
<td><%Response.Write tit_fir%>编号：</td>
<td><input type=text name=serial value='<%=Cls.time_type(now(),11)&Cls.rand_num(4)%>' size=20 maxlength=20>&nbsp;&nbsp;<input type='checkbox' name='AutoGetNum' value='Yes' checked onclick='serial.disabled=this.checked'>自动编号&nbsp;&nbsp;&nbsp;&nbsp;品牌：<input type=text id=brand name=brand value='' size=20 maxlength=20>
<select onChange="brandks(this.value);">
<option value='' selected>选择品牌</option>
<%
  dim_tmp=split(Web_Shop(2),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'>"&dim_tmp(i)&"</option>"
  next
%></select>
<script language=javascript>
function brandks(kv){
var ov=document.getElementById("brand");
if (ov.value!=""){
ov.value+=","+kv;
}
else{
ov.value+=kv;
}
}
</script>&nbsp;</td></tr>
<tr>
	<td><%Response.Write tit_fir%>库存：</td><td>库存情况：<select name=stock>
<%
  dim_tmp=split(Web_Shop(3),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'>"&dim_tmp(i)&"</option>"
  next
%></select>&nbsp;&nbsp;库存数量：<input name='Stocks' type='text' value='' size='9' maxlength='10'><select name=StocksName>
<%
  dim_tmp=split(Web_Shop(6),":")
  for i=0 to ubound(dim_tmp)
    Response.Write vbcrlf&"<option value='"&dim_tmp(i)&"'>"&dim_tmp(i)&"</option>"
  next
%></select><%response.write redx%>&nbsp;&nbsp;上架时间：<input type=text name=tim value='<%response.write Cls.now_time%>' size=20 maxlength=20>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(tim);return false;" class=btn></td>
</tr>
<tr>
<td>购买相关：</td>
<td>可用&nbsp;<input type='checkbox' name='is_emoney' value='yes'>&nbsp;&nbsp;<%response.write web_dim(8)%>：<input type=text name=AsaiMHemoney value='' size=5 maxlength=5>&nbsp;购买&nbsp;&nbsp;购物增送<input name='con_integral' type='text' value='0' size='4' maxlength='4'>点积分&nbsp;&nbsp;<input name='con_emoney' type='text' value='0' size='4' maxlength='4'>个<%response.write web_dim(8)%>&nbsp;&nbsp;购买：<input type=text name=buy_counter value='0' size=5 maxlength=10>&nbsp;次</td>
</tr>
<tr valign=top>
<td><%response.write tit_fir%>销售类型：</td>
<td>
<input name='ProductType' type='radio' value='1' checked onclick='document.add_frm.Price.value=document.add_frm.Price_Original.value;document.add_frm.Price.disabled=false;'> 正常销售&nbsp;&nbsp;&nbsp;&nbsp;正常销售，没有打折的商品。<br />
<input name='ProductType' type='radio' value='2' onclick='document.add_frm.Price.disabled=false'><font color='green'> 涨价商品&nbsp;&nbsp;&nbsp;&nbsp;如内存条等一些可能涨价的商品</font><br />
<input name='ProductType' type='radio' value='3' onclick='getprice(document.add_frm.Price_Original.value);document.add_frm.Price.disabled=false;'><font color='red'> 降价处理&nbsp;&nbsp;&nbsp;&nbsp;折扣率：<input name='Discount' type='text' value='100' size='4' maxlength='4' style='text-align: center;'> %
</td>
</tr>
<tr valign=top>
<td><%response.write tit_fir%>价格：<br /><br /><font color=red onclick="javascript:open_win('AMH_Shop_PriceHelp.asp','Help_Price',700,580,'yes');" style="cursor:hand;">查看计算公式</font></td>
<td>
<table border=0>
<tr class=tr>
<td><font color='red'>原始零售价：</font></td><td width='280'><input name='Price_Original' type='text' value='' size='10' maxlength='10' onchange='getprice(this.value)' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)&redx%></td><td><%Call AMH_Read("","原始零售价","正常销售时的价格。以及降价及促销时的参考价。")%></td>
</tr>
<tr class=tr>
<td><font color='blue'>当前零售价：</font></td><td><input name='Price' type='text' value='' size='10' maxlength='10' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' name='calculate' value='计算' onclick='getprice(document.add_frm.Price_Original.value);' class=btn></td><td><%Call AMH_Read("","当前零售价","系统会自动根据商品类型、原始零售价及折扣率计算当前零售价。<br />也可以手动输入当前零售价")%></td>
</tr>
<tr class=tr>
<td>市场参考价：</td><td><input name='Price_Market' type='text' value='' size='10' maxlength='10' style='text-align: right;' onKeyPress= "return regInput(this,/^\d*\.?\d{0,2}$/,String.fromCharCode(event.keyCode))" onpaste= "return regInput(this,/^\d*\.?\d{0,2}$/,window.clipboardData.getData('Text'))" ondrop= "return regInput(this,    /^\d*\.?\d{0,2}$/,event.dataTransfer.getData('Text'))">&nbsp;<%response.write Web_Shop(1)%></td><td><%Call AMH_Read("","市场参考价","市场参考零售价，一般可以设高一些。如果不填或为0，前台不显示。")%></td>
</tr>
</table>
</td>
</tr>
<%
  Response.Write ShowEditor(iChannelIDs,3,"add_frm","word","内容","TempUploadFiles","")
  Response.Write ShowBrief("Brief","")
  Response.Write ShowPicUpload(iChannelIDs,"","pic")
  Response.Write ShowUploadList()
  Response.Write ShowPutInfo("s",Cls.Now_time)
  Response.Write ShowRelateInfo("",Istop,"",1,0)
  Response.Write ShowMoreItem(0,0)
  call submit_add()
end sub

sub AsaiMHChk_Main()
  dim name,pageurl2,isgood
  pageurl2=pageurl
	Call SQL_ClassID(sql_add)
	Call format_search("Name","Name",2,1)	
    Call AMH_Td(tit_fir&"列表")
%>
<tr valign=top align=center>
<td width='20%'>
  <table border=0 width='100%'>
  <tr><td height=5></td></tr>
  <tr><td class=htd><%Call Left_Channel_Class(pageurl2,iChannelIDs)%></td></tr>
  </table>
</td>
<td width='80%'>
  <table cellspacing=1 cellpadding=3 class=table0>
<form name=sel_form action='<%Response.Write PageUrl%>ClassID=<%Response.Write cid%>&Action=handle' method=post>
<tr align=center>
<td Class=td width='7%'>序号</td>
<td Class=td width='35%'><%response.write tit_fir%>标题及整理时间<%if keyword<>"" then response.write "（搜索结果："&keyword&"）"%></td>
<td Class=td width='13%'>价格/<%Response.Write Web_Shop(1)%></td>
<td Class=td width='12%'>销售类型</td>
<td Class=td width='28%'>相关属性</td>
<td Class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  dim obj_page
  set obj_page=new Cls_PageCute
  obj_page.pageurl=pageurl			
  obj_page.nummer=nummer							
  obj_page.page_unit="个"
  obj_page.page_tit=tit_fir
  obj_page.v_id="id"
  call obj_page.p_init("id,name,tim,ispic,Isfocus,istop,isgood,hidden,cod,ProductType,discount,price,is_emoney,emoney",Data_Name,sql_add,"id desc")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
  call obj_page.p_main("id,name,tim,ispic,Isfocus,istop,isgood,hidden,cod,ProductType,discount,price,is_emoney,emoney",Data_Name,sql_add,"id desc")
  for i=1 to obj_page.page_num
    id=rs("id")
    name=rs("name")
    isgood=0
    if rs("isgood")=true then isgood=1
%>
<tr align=center>
<td class=tims><a href='<%Response.Write Cls.Web_Dir%><%Response.Write Index_Url%>/View.asp?id=<%Response.Write id%>' target=_blank><%Response.Write obj_page.page_now+i%></a></td>
<td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr>
  <td><a href='<%Response.Write PageUrl%>Action=edit&id=<%Response.Write id%>' alt='<%Response.Write Cls.Code_Html(name,1,0)%>'><%Response.Write Cls.Code_Html(name,1,(18+tnum))%></a></td>
<%
    if rs("is_emoney") then
      Response.Write "  <td align=right><img src='../images/sys/emoney.gif' alt='"&web_dim(8)&"："&rs("emoney")&"' border=0></td>"
    end if
%>
  </tr>
  </table>
</td>
<td class=tims><font class=blue><%Response.Write rs("price")%></font><%Response.Write Web_Shop(1)%></td>
<td>
<%
    if int(rs("ProductType"))=1 then
      response.write "<font class=blue>[原始价格]</font> "
    elseif int(rs("ProductType"))=2 then
      response.write "<font class=rea>[涨价商品]</font> "
    elseif int(rs("ProductType"))=3 then
      response.write "<font class=red2>[打折]</font> "
	  response.write "<font class=tims>"&formatpercent(rs("discount")/100,0)&"</font>"
    end if
  %>
</td>
<td align=left><%Response.Write pro_edit(PageUrl&"Action=edit&id="&id,"编辑该"&tit_fir) &"&nbsp;"& pro_hidden(rs("hidden"),1) &"&nbsp;"& pro_cod(rs("cod")) &"&nbsp;"& pro_isgood(isgood)  &"&nbsp;"& pro_istop(rs("istop")) &"&nbsp;"& pro_Isfocus(rs("Isfocus")) &"&nbsp;"& pro_ispic(rs("ispic"))%></td>
<td><input type=checkbox name=sel_id value='<%Response.Write id%>'></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=4>
  <table border=0>
  <tr class=tr1>
  <td></td>
  <td><%Response.Write obj_page.page_var%></td>
  <td width=3></td>
  <td>分页：</td>
  <td><%Response.Write obj_page.page_cute%></td>
  </tr>
  </table>
</td>
<td colspan=2 align=center>
<select name=sel_type size=1>
<option value='推荐'>推荐</option>
<option value='取消推荐'>取消推荐</option>
<option value='焦点'>焦点</option>
<option value='取消焦点'>取消焦点</option>
<option value='固顶'>固顶</option>
<option value='取消固顶'>取消固顶</option>
<option value='审核'>审核</option>
<option value='待审核'>待审核</option>
<option value='删除'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);" class=btn>
</td>
</tr>
</form>
  </table>
</td>
</tr>
<%
end sub
%>
