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

📄 productsort.asp

📁 生成html的ASP企业站点,可以进行二次开发的
💻 ASP
📖 第 1 页 / 共 2 页
字号:
    </tr>
    <tr>
      <td class="forumRow">英文:
        <input name="SortNameEN" type="text" id="SortNameEN" size="28">
        显示:
        <input name="ViewFlagEN" type="radio" value="1" />
        <input name="ViewFlagEN" type="radio" value="0" />
        
	分类图:<input name="Sortpic" type="text" style="width: 250;" value="<%=Sortpic%>" maxlength="250">
        <input type="button" value="上传图片" onClick="setpic();">
		
		<input name="submitSave" type="submit" id="保存" value="保存">
        <font color="red">*</font></td>
    </tr>
	
  </form>
</table>
<%
End Function
Function TextPath(ID)
  Dim rs,sql,SortTextPath
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ID="&ID
  rs.open sql,conn,1,1
  SortTextPath=rs("SortNameCH")&"&nbsp;→&nbsp;"
  if rs("ParentID")<>0 then TextPath rs("ParentID")
  response.write(SortTextPath)
End Function
Function saveFolder
  if len(trim(request.Form("SortNameCH")))=0 then
      response.write ("<script language='javascript'>alert('请填写中文类别名称!');history.back(-1);</script>")
      response.end
  end if
  if request.Form("ViewFlagEn")=1 then
    if len(trim(request.Form("SortNameEn")))=0 then
      response.write ("<script language=javascript> alert('您已经选择了""英文""显示,因此英文类别名必填!');history.back(-1);</script>")
      response.end
    end if
  end if
  Dim From,Action,rs,sql,SortTextPath
  From=request.QueryString("From")
  Set rs=server.CreateObject("adodb.recordset")
  if From="Add" then 
    sql="Select * From LiangJingCMS_ProductSort"
    rs.open sql,conn,1,3
    rs.addnew
	Action="添加产品类别"
    rs("SortPath")=request.Form("ParentPath") & rs("ID") &","
  else
    sql="Select * From LiangJingCMS_ProductSort where ID="&request.QueryString("ID")
    rs.open sql,conn,1,3
	Action="修改产品类别"
    rs("SortPath")=request.Form("SortPath")
  end if
  rs("SortNameCh")=request.Form("SortNameCh")
  rs("ViewFlagCh")=request.Form("ViewFlagCh")
  rs("SortNameEn")=request.Form("SortNameEn")
  rs("ViewFlagEn")=request.Form("ViewFlagEn")
  rs("ParentID")=request.Form("ParentID")
  rs("Sortpic")=request.Form("Sortpic")
  rs.update 
  response.write ("<script language='javascript'>alert('"&Action&"成功!');location.replace('ProductSort.asp');</script>")
End Function 

Function editFolder()
  Dim ID
  ID=request.QueryString("ID")
  editFolderForm ID
end function

Function editFolderForm(ID)
  Dim SortNameCH,ViewFlagCH,ParentID,SortPath,rs,sql,Sortpic
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ID="&ID
  rs.open sql,conn,1,1
  SortNameCh=rs("SortNameCh")
  ViewFlagCh=rs("ViewFlagCh")
  SortNameEn=rs("SortNameEn")
  ViewFlagEn=rs("ViewFlagEn")
  ParentID=rs("ParentID")
  SortPath=rs("SortPath")
  Sortpic=rs("Sortpic")
%>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  <form name="FolderForm" method="post" action="ProductSort.asp?Action=Save&From=Edit&ID=<%=ID%>">
    <tr>
      <th height="22">【修改产品类别】</th>
    </tr>
    <tr>
      <td class="forumRow">| 根类 → 
        <% if ParentID<>0 then TextPath(ParentID)%></td>
    </tr>
    <tr>
      <td class="forumRow">中文:
        <input name="SortNameCH" type="text" id="SortNameCH" size="28" value="<%=SortNameCH%>">
        发布:
        <input name="ViewFlagCH" type="radio" value="1" <%if ViewFlagCH then response.write ("checked=checked")%> />
        <input name="ViewFlagCH" type="radio" value="0" <%if not ViewFlagCH then response.write ("checked=checked")%>/>
        否 父类ID:
        <input readonly name="ParentID" type="text" id="ParentID" size="6" value="<%=ParentID %>">
        父类数字路径:
        <input readonly name="SortPath" type="text" id="SortPath" size="18" value="<%=SortPath%>"></td>
    </tr>
    <tr>
      <td class="forumRow">英文:
        <input name="SortNameEN" type="text" id="SortNameEN" size="28" value="<%=SortNameEN%>">
        发布:
        <input name="ViewFlagEN" type="radio" value="1" <%if ViewFlagEN then response.write ("checked=checked")%> />
        <input name="ViewFlagEN" type="radio" value="0" <%if not ViewFlagEN then response.write ("checked=checked")%>/>
		分类图:<input name="Sortpic" type="text" style="width: 250;" value="<%=Sortpic%>" maxlength="250">
        <input type="button" value="上传图片" onClick="setpic();">
        <input name="submitSave" type="submit" id="保存" value="保存"></td>
    </tr>
  </form>
</table>
<%
End Function

Function moveFolderForm()
  Dim ID,ParentID,SortNameCH,SortPath
  ID=request.QueryString("ID")
  ParentID=request.QueryString("ParentID")
  SortNameCH=request.QueryString("SortNameCH")
  SortPath=request.QueryString("SortPath")
%>
<br>    
<table id="SortFromTo" class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="MoveForm" method="post" action="ProductSort.asp?Action=MoveSave">
    <tr>
      <th height="22">【移动产品类别】</th>
    </tr>
    <tr>
      <td class="forumrow">→
      <% response.write (SortNameCH) %></td>
    </tr>
    <tr>
      <td class="forumrow">移动类ID:
        <input readonly name="ID" type="text" id="ID" size="8" value="<%=ID%>">
        移动类父ID:
        <input readonly name="ParentID" type="text" id="ParentID" size="8" value="<%=ParentID%>">
        移动类数字路径:
        <input readonly name="SortPath" type="text" id="SortPath" size="28" value="<%=SortPath%>">
        </th>
    </tr>
    <tr>
      <td align="center" class="forumrow"><strong>目标位置:通过点击"至"选择将要放置到的类别。</strong></td>
    </tr>
    <tr>
      <td class="forumrow">目标类ID:
        <input readonly name="toID" type="text" id="toID" size="8" value="">
        目标类父ID:
        <input readonly name="toParentID" type="text" id="toParentID" size="8" value="">
        目标类数字路径:
      <input readonly name="toSortPath" type="text" id="toSortPath" size="28" value=""></td>
    </tr>
    <tr>
      <td align="center" class="forumrow"><input name="submitMove" type="submit" id="转移" value="转移">
        </th>
    </tr>
  </form>
</table>
<%
End Function

Function saveMoveFolder()
  Dim rs,sql,fromID,fromParentID,fromSortPath,toID,toParentID,toSortPath,fromParentSortPath
  fromID=request.Form("ID")
  fromParentID=request.Form("ParentID")
  fromSortPath=request.Form("SortPath")
  toID=request.Form("toID")
  toParentID=request.Form("toParentID")
  toSortPath=request.Form("toSortPath")
  if toID="" or toParentID="" or toSortPath="" then
    response.write ("<script language='javascript'>alert('请选择移动的目标位置!');history.back(-1);</script>")
    response.end
  end if
  if fromParentID=0 then
    response.write ("<script language='javascript'>alert('一级分类无法被移动!');history.back(-1);</script>")
    response.end
  end if
  if fromSortPath=toSortPath then
    response.write ("<script language='javascript'>alert('当前选择的移动类别和目标位置相同,操作无效!');history.back(-1);</script>")
    response.end
  end if
  if Instr(toSortPath,fromSortPath)>0 or fromParentID=toID then
    response.write ("<script language='javascript'>alert('不能将类别移动到本类或下属类里,操作无效!');history.back(-1);</script>")
    response.end
  end if
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ID="&fromParentID
  rs.open sql,conn,0,1
  fromParentSortPath=rs("SortPath")
  conn.execute("update LiangJingCMS_ProductSort set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0")
  conn.execute("update LiangJingCMS_ProductSort set ParentID='"&toID&"' where ID="&fromID)
  conn.execute("update LiangJingCMS_Products set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0")
  response.write ("<script language='javascript'>alert('产品类别移动成功!');location.replace('ProductSort.asp');</script>")
End Function
%>
</BODY>
</HTML>

⌨️ 快捷键说明

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