Deal_pro.asp
Upload User: pengwei803
Upload Date: 2021-02-10
Package Size: 3311k
Code Size: 7k
Development Platform:

HTML/CSS

  1. <!--#include file="../Ku_inc/Ku_sql.asp"-->
  2. <!--#include file="../Ku_inc/Ku_config.asp"-->
  3. <!--#include file="Ku_conn.asp"-->
  4. <!--#include file="../Ku_inc/inc.asp"-->
  5. <!-- #include file="Session.asp"-->
  6. <%
  7. if request("action")="addpro" then
  8. title=request("title")
  9. gg=request("gg")
  10. tj=request("tj")
  11. pic1=request("pic1")
  12. BigClassName=request("BigClassName")
  13. SmallClassName=request("SmallClassName")
  14. content=request("content")
  15. set rs=server.createobject("adodb.recordset")
  16. sql="select * from ku_pro"
  17. rs.open sql,conn,1,3
  18. rs.addnew
  19. rs("title")=title
  20. rs("gg")=gg
  21. rs("content")=content
  22. rs("pic1")=Replace(pic1,left(pic1,3),"")
  23. rs("tj")=tj
  24. rs("bigclassname")=BigClassName
  25. rs("SmallClassName")=smallClassName
  26. rs.update
  27. rs.close
  28. set rs=nothing
  29. conn.close  
  30. set conn=nothing
  31. response.Write("<script>alert(""添加产品成功!"");location.href=""Pro_list.asp"";</script>")
  32. end if
  33. %>
  34. <%
  35. if request("action")="editprobig" then
  36. BigClassID=trim(Request("BigClassID"))
  37. NewBigClassName=trim(Request("NewBigClassName"))
  38. oldBigClassName=trim(Request("oldBigClassName"))
  39. if NewBigClassName="" then
  40.   Response.Write "<script>alert(""类别不能为空!"");location.href=""javascript:history.back()"";</script>"
  41. else
  42. Set rs=Server.CreateObject("Adodb.RecordSet")
  43. rs.Open "Select * from ku_bigclass where BigClassID="&BigClassID,conn,1,3
  44. rs("BigClassName")=NewBigClassName
  45.        rs.update
  46. rs.Close
  47.       set rs=Nothing
  48.       conn.execute "Update ku_SmallClass set BigClassName='" & NewBigClassName & "' where BigClassName='" & oldBigClassName & "'"
  49. conn.execute "Update ku_pro set BigClassName='" & NewBigClassName & "' where BigClassName='" & oldBigClassName & "'"
  50.             response.Write("<script>alert(""修改成功!"");location.href=""Ku_ProClass.asp"";</script>")
  51. end if
  52. end if
  53. %>
  54. <%
  55. if request("action")="editprosmall" then
  56. SmallClassID=trim(Request("SmallClassID"))
  57. BigClassName=trim(Request.form("BigClassName"))
  58. SmallClassName=trim(Request.form("SmallClassName"))
  59. oldSmallClassName=trim(request.form("oldSmallClassName"))
  60. if SmallClassName="" then
  61.   Response.Write "<script>alert(""类别不能为空!"");location.href=""javascript:history.back()"";</script>"
  62. else
  63. Set rs=Server.CreateObject("Adodb.RecordSet")
  64. rs.Open "Select * from ku_SmallClass where SmallClassID="&SmallClassID&"",conn,1,3
  65. rs("SmallClassName")=SmallClassName
  66.       rs.update
  67. rs.Close
  68.        set rs=Nothing
  69. conn.execute "Update news set ku_SmallClassName='" & SmallClassName & "' where SmallClassName='" & OldSmallClassName & "'"
  70.      response.write "<script language='javascript'>" & chr(13)
  71. response.write "alert('修改成功!');" & Chr(13)
  72. response.write "window.document.location.href='Ku_Proclass.asp';"&Chr(13)
  73. response.write "</script>" & Chr(13)
  74. Response.End
  75. end if
  76. end if
  77. %>
  78. <%
  79. if request("action")="delsmallclass" then
  80. SmallClassID=trim(Request("SmallClassID"))
  81. SmallClassName=trim(Request("SmallClassName"))
  82. if SmallClassID<>"" then
  83. sql="delete from ku_SmallClass where SmallClassID="&Cint(SmallClassID)&""
  84. conn.Execute sql
  85. sql="delete from ku_pro where SmallClassName='" & SmallClassName & "'"
  86. conn.Execute sql
  87. end if
  88. response.redirect "Ku_Proclass.asp"
  89. end if
  90. %>
  91. <%
  92. if Request("Action")="addsmall" then
  93. BigClassName=trim(request("BigClassName"))
  94. SmallClassName=trim(request("SmallClassName"))
  95. Set rs=Server.CreateObject("Adodb.RecordSet")
  96. rs.open "Select * From ku_smallclass Where BigClassName='" & BigClassName & "' AND SmallClassName='" & SmallClassName & "'",conn,1,3
  97. if (rs.eof and rs.bof) then
  98.       rs.addnew
  99. rs("BigClassName")=BigClassName
  100.        rs("SmallClassName")=SmallClassName
  101.       rs.update
  102.       rs.Close
  103.        set rs=Nothing
  104. response.Write("<script>alert(""添加成功!"");location.href=""Ku_ProClass.asp"";</script>")
  105. else
  106. Response.Write "<script>alert(""已经存在小类,请重新填写!"");location.href=""javascript:history.back()"";</script>"
  107. end if
  108. end if
  109. %>
  110. <%
  111. if Request("Action")="addbig" then
  112. BigClassName=trim(request("BigClassName"))
  113. Set rs=Server.CreateObject("Adodb.RecordSet")
  114.         rs.open "Select * From ku_BigClass Where BigClassName='" & BigClassName & "'",conn,1,3
  115. if (rs.eof and rs.bof) then
  116.       rs.addnew
  117.       rs("BigClassName")=BigClassName
  118.       rs.update
  119.       rs.Close
  120.        set rs=Nothing
  121. response.Write("<script>alert(""添加成功!"");location.href=""Ku_ProClass.asp"";</script>")
  122. else
  123. Response.Write "<script>alert(""已经存在大类,请重新填写!"");location.href=""javascript:history.back()"";</script>"
  124. end if
  125. end if
  126. %>
  127. <%
  128. if request("action")="delbigclass" then
  129. BigClassName=trim(Request("BigClassName"))
  130. if BigClassName<>"" then
  131. sql="delete from Ku_bigclass where BigClassName='" & BigClassName & "'"
  132. conn.Execute sql
  133. sql="delete from Ku_smallclass where BigClassName='" & BigClassName & "'"
  134. conn.Execute sql
  135. sql="delete from Ku_pro where BigClassName='" & BigClassName & "'"
  136. conn.Execute sql
  137. end if
  138.    
  139. response.redirect "Ku_proclass.asp"
  140. end if
  141. %>
  142. <%
  143. if request("action")="del" then
  144. if Trim(Request("ID"))="" then
  145. FoundErr=True
  146. Message=Message & "<li>请您选择要删除的信息!</li>"
  147. else
  148. call Del()
  149. end if
  150. if FoundErr<>True then
  151. Sub Del()
  152. '删除信息
  153. sql = "delete from ku_pro where ID in ("& Trim(Request("ID")) &")"
  154. conn.execute (sql)
  155. End Sub
  156. '成功提示    
  157. call performMsgpro("操作成功!","")
  158. end if
  159. if FoundErr=True then
  160. call ErrMsg(Message)
  161. end if
  162. end if
  163. %>
  164. <%
  165. if request("action")="tisheng" then
  166. if Trim(Request("ID"))="" then
  167. FoundErr=True
  168. Message=Message & "<li>请您选择要操作的信息!</li>"
  169. else
  170. call strPeak()
  171. end if
  172. if FoundErr<>True then
  173. Sub strPeak()
  174. adoSQL="update ku_pro set addtime=now() where ID=" & Trim(Request("ID")) & ""
  175. conn.execute(adoSQL)
  176. End Sub
  177. '成功提示    
  178. call performMsgpro("操作成功!","")
  179. end if
  180. if FoundErr=True then
  181. call ErrMsg(Message)
  182. end if
  183. end if
  184. %>
  185. <%
  186. if request("action")="add" then
  187. name=Checkin(trim(Request.form("mingcheng")))
  188.     If name="" Then
  189.     Response.Write "<script>alert(""分类名称不能为空!"");location.href=""javascript:history.back()"";</script>"
  190.     Response.end()
  191.     end if
  192.     set rs=server.createobject("adodb.recordset")
  193.     sql="select * from ku_newskind where name='"&name&"'"
  194.     rs.open sql,conn,1,3
  195.     if (rs.eof and rs.bof) then
  196.     rs.addnew
  197.     rs("name")=name
  198.     rs.update
  199.     rs.close
  200.     response.Write("<script>alert(""添加成功!"");location.href=""News_kind.asp"";</script>")
  201.     else
  202.     response.Write("<script>alert(""分类已存在!"");location.href=""News_kind.asp"";</script>")
  203.     end if
  204.     end if 
  205. %>
  206. <%
  207. if request("action")="edit" then
  208. name=Checkin(trim(Request.form("mingcheng")))
  209. id=request("id")
  210.     If name="" Then
  211.     Response.Write "<script>alert(""分类名称不能为空!"");location.href=""javascript:history.back()"";</script>"
  212.     Response.end()
  213.     end if
  214.     set rs=server.createobject("adodb.recordset")
  215.     sql="select * from ku_newskind where id="&id
  216.     rs.open sql,conn,1,3
  217.     
  218.     rs("name")=name
  219.     rs.update
  220.     rs.close
  221.     response.Write("<script>alert(""修改成功!"");location.href=""News_kind.asp"";</script>")
  222.     end if 
  223. %>