⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_shop_product.asp

📁 ..不怎么明白。不知道这个市什么只想下个服务端
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!-- #include file="../admin/inc/admin_onlogin.asp" -->
<!-- #include file="../include/common_shop.asp" -->
<%
'****************************************************
' Web: http://www.aouoo.com , http://www.aouoo.net
' Copyright (C) 2007 Aouoo.com All Rights Reserved.
'****************************************************

dim dim_tmp,img0
index_url="shop"
call admin_master(1,0)
call admin_cid_sid()
call admin_header(0,0)
select case jk_mod
case "istop"
  ntit="推荐"&tit_fir
  sql_add=" where isgood=1"
case "sh"
  ntit="待审核"&tit_fir
  sql_add=" where hidden=0"
case else
  jk_mod=""
  ntit=tit_fir&"列表"
  sql_add=" where hidden=1"
end select
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%response.write tit_fir%>列表</a></td>
  <td width=10></td>
  <td><a href='?jk_mod=istop'>推荐<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?jk_mod=sh'>待审核<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=add'>添加<%response.write tit_fir%></a></td>
<%call joekoe_is_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=jk_mod value='<%response.write jk_mod%>'>
  <input type=hidden name=c_id value='<%response.write cid%>'>
  <input type=hidden name=s_id value='<%response.write sid%>'>
  <tr>
  <td>搜索(<%response.write ntit%>) 关键字:</td>
  <td><input type=text name=keyremark_2 value='<%response.write trim(request.querystring("keyremark_2"))%>' 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='搜索'></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
call admin_table(1,1)

select case action
case "handle"
  call joekoe_chk_handle()
case "clear"
  call joekoe_go_clear()
case "add"
  call joekoe_chk_add()
case "edit"
  call joekoe_chk_edit()
case else
  call joekoe_chk_main()
end select

if isarray(dim_tmp) then erase dim_tmp
call admin_ender(1)

sub joekoe_chk_handle()
  dim sel_type,seltype,sel_id,hdim,hnum,hid,hi,htype,hintegral
  htype=1
  sel_type=trim(request.form("sel_type"))
  select case sel_type
  case "推荐","取消推荐"
    seltype="isgood"
    if sel_type="取消推荐" then htype=0
  case "取消隐藏","隐藏"
    seltype="hidden"
    if sel_type="待审核" or sel_type="隐藏" then htype=0
  case "删除"
    seltype="delete"
  case else
    sel_type=""
    seltype=""
  end select
  if joekoe_cms.post_chk()=false or seltype="" then
    call admin_msg("提交表单出错!","?",1)
    exit sub
  end if
  hintegral=mp_integral()
  sel_id=trim(request.form("sel_id"))
  sel_id=replace(sel_id," ","")
  hdim=split(sel_id,",")
  hnum=ubound(hdim)
  select case seltype
  case "isgood","hidden"
    for hi=0 to hnum
      hid=hdim(hi)
      if isnumeric(hid) then
        sql="update "&data_name&" set "&seltype&"="&htype&" where id="&hid
        call joekoe_cms.exec(sql,0)
      end if
    next
  case "delete"
    for hi=0 to hnum
      hid=hdim(hi)
      if isnumeric(hid) then
        call upload_del(index_url,hid)
        call joekoe_cms.exec("delete from "&data_name&" where id="&hid,0)
      end if
    next
  end select
  erase hdim
  action=""
  call admin_event(sel_type&" "&(hnum+1)&"条("&tit_fir&")记录",0,0)
  call admin_msg("已成功("&sel_type&")操作了"&(hnum+1)&"条("&tit_fir&")记录!","?",1)
end sub

sub joekoe_chk_edit()
  dim name,price,discount,is_emoney,emoney,tim,counter,buy_counter,isgood,hidden,smallimg,bigimg,img,remark_1,remark_2,tmp1
  call admin_td("编辑"&tit_fir)
  sql="select top 1 * from "&data_name&" where id="&id
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    call admin_msg(tit_fir&"ID("&id&")不存在!","?",1)
    exit sub
  end if
  if chk() then
    name=code_admin("name",1,50)
    price=code_admin("price",1,10)
    emoney=code_admin("emoney",1,10)
    if not(isnumeric(emoney)) then emoney=0
    remark_2=request.form("remark_2")
    csid=trim(request.form("c_id"))
    is_emoney=false
    if code_admin("is_emoney",1,10)="yes" then is_emoney=true
    if cs_nd(csid)=false then
      call admin_error("请选择 "&tit_fir&"类型 !")
      exit sub
    end if
    if name="" or remark_2="" then
      call admin_error(tit_fir&"名称、"&tit_fir&"简单说明、"&tit_fir&"详细说明 等不能为空!")
      exit sub
    end if
    if instr(price,"-")>0 then
      call admin_error(tit_fir&"的价格 不能为空,且要为大于0的数字!")
      exit sub
    end if
    if is_emoney=true and int(emoney)<=0 or instr(emoney,".")>0 then
      call admin_error(tit_fir&"可用"&web_dim(9)&"时"&web_dim(9)&"不能为空,且要为大于0的整数!")
      exit sub
    end if
    
    discount=code_admin("discount",1,10)
    if not(isnumeric(discount)) then discount=0
    if int(discount)<1 or int(discount)>100 then discount=100
    tim=code_admin("tim",1,20)
    tim=joekoe_cms.time_type(tim,1)
    if tim="" then tim=joekoe_cms.now_time
    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
    isgood=false
    if trim(request.form("isgood"))="yes" then isgood=true
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false
    call chk_cid_sid()
    
    rs("c_id")=cid
    rs("s_id")=sid
    rs("cod")=cod_type()
    rs("name")=name
    rs("serial")=code_admin("serial",1,20)
    rs("brand")=code_admin("brand",1,20)
    rs("stock")=code_admin("stock",1,5)
    rs("remark_2")=remark_2
    rs("smallimg")=code_admin("smallpic",1,100)
    rs("bigimg")=code_admin("bigpic",1,100)
    rs("counter")=counter
    rs("buy_counter")=buy_counter
    rs("isgood")=isgood
    rs("hidden")=hidden
    rs("tim")=tim
    rs("keyes")=code_admin("keyes",1,20)
    rs("price")=price
    rs("discount")=discount
    rs("is_emoney")=is_emoney
    rs("emoney")=emoney
    rs.update
    rs.close
    call upload_note(index_url,id)
    call admin_msg("已成功编辑了一个"&tit_fir&"!","?jk_mod="&jk_mod&"&c_id="&cid&"&s_id="&sid,0)
    exit sub
  end if
  call form_first()
  cid=rs("c_id")
  sid=rs("s_id")
%>
<form name=add_frm action='?jk_mod=<%response.write jk_mod%>&action=edit&id=<%response.write id%>' method=post>
<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=50><%response.write redx%></td>
</tr>
<tr>
<td><%response.write tit_fir%>分类:</td>
<td><%call chk_csid(nsort,cid,sid)%></td>
</tr>
<tr>
<td><%response.write tit_fir%>编号:</td>
<td><input type=text name=serial value='<%response.write rs("serial")%>' size=20 maxlength=20>&nbsp;&nbsp;推荐:<select name=brand><%
  tmp1=rs("brand")
  dim_tmp=split(val_brand,":")
  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;库存:<select name=stock><%
  tmp1=rs("stock")
  dim_tmp=split(val_stock,":")
  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></td>
</tr>
<tr>
<td><%response.write tit_fir%>价格:</td>
<td><input type=text name=price value='<%response.write rs("price")%>' size=15 maxlength=10>&nbsp;<%response.write val_unit&redx%>&nbsp;当前折扣:<input type=text name=discount value='<%response.write rs("discount")%>' size=4 maxlength=5>%&nbsp;&nbsp;&nbsp;&nbsp;可用&nbsp;<input type=checkbox name=is_emoney value='yes'<%if rs("is_emoney") then response.write " checked"%>>&nbsp;<%response.write web_dim(9)%>:<input type=text name=emoney value='<%response.write rs("emoney")%>' size=5 maxlength=5>&nbsp;购买</td>
</tr>
<tr>
<td><%response.write tit_fir%>关键字:</td>
<td><%call frm_keyes(rs("keyes"))%></td>
</tr>
<tr>
<td>发布时间:</td>
<td><input type=text name=tim value='<%response.write rs("tim")%>' size=20 maxlength=20>&nbsp;&nbsp;浏览&nbsp;<input type=text name=counter value='<%response.write rs("counter")%>' size=5 maxlength=10>&nbsp;次&nbsp;&nbsp;购买&nbsp;<input type=text name=buy_counter value='<%response.write rs("buy_counter")%>' size=5 maxlength=10>&nbsp;次</td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>详细说明:</td>
<td><textarea name=remark_2 rows=10 cols=65><%response.write joekoe_cms.code_word(rs("remark_2"))%></textarea></td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -