56770_product.asp
上传用户:feitengda
上传日期:2022-07-20
资源大小:73k
文件大小:7k
源码类别:

企业管理

开发平台:

ASP/ASPX

  1. <!--#include file="conn.asp"-->
  2. <%
  3. on error resume next
  4. call admintop()
  5. if session("admin_name")="" then
  6. adminflag()
  7. else
  8. dim action, s_id
  9. s_id=request.QueryString("s_id")
  10. action=request("action")
  11. select case action
  12. '--------------------------------
  13. case "del"
  14. conn.execute "delete from 56770_product where p_id="&s_id
  15. if request("page")<>"" then 
  16. response.Redirect "56770_product.asp?gjc="&gjc&"&s_name="&s_name&"&page="&request("page")&""
  17. else
  18. response.Redirect "56770_product.asp?gjc="&gjc&"&s_name="&s_name&""
  19. end if 
  20. response.end 
  21. end select
  22. %>
  23. <table border="0" cellspacing="1" cellpadding="0" height="0" align=center width="98%" bgcolor="#183789">
  24.   <tr>
  25.   <td>
  26.    <table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="100%">
  27.   <tr>
  28.  <td height=15  align=center colspan=17 class=classtop>药品类别管理</td>
  29. </tr>
  30. <form name=form2 method=post action=56770_product.asp>
  31. <tr >
  32. <td class="classtd" align="center" colspan=2>库存总额:<strong><font color=red>
  33. <%Set rs=conn.execute("select p_cbprice,p_kucun from [56770_product]")
  34.   If rs.eof Then 
  35.         sumprice="0"
  36.   Else
  37.         Do While Not rs.eof 
  38. sumprice=sumprice+(rs("p_cbprice")*rs("p_kucun"))
  39. rs.movenext
  40. Loop
  41. End If 
  42. rs.close:Set rs=Nothing 
  43. response.write FormatNumber(sumprice,2)
  44. %> 元</font></strong>
  45. </td>
  46. <td class="classtd" align="center">
  47. <select name="anclassid" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
  48.           <option selected>--快速跳转--</option>
  49.           <option value=56770_product.asp>查看全部药品</option>
  50.           <%set rs=conn.execute("select s_id,s_name from [56770_sort] order by s_paixu desc")
  51.            if not rs.eof then
  52.            do while not rs.eof 
  53.           %>
  54.           <option value="?s_name=<%=server.urlencode(Trim(rs("s_name")))%>"><%=rs("s_name")%></option>
  55.           <%rs.movenext
  56.             loop
  57.             end if 
  58.             rs.close:set rs=nothing
  59.          %>
  60.         </select></td>
  61. <td class="classtd" colspan="5" align=right>分类:  
  62. <select name=s_name style="height:18px;">
  63. <option value="0">全部分类</option>
  64. <%set rs=conn.execute("select s_id,s_name from [56770_sort] order by s_paixu desc")
  65.            if not rs.eof then
  66.            do while not rs.eof 
  67.           %>
  68.           <option value="<%=Trim(rs("s_name"))%>"><%=rs("s_name")%></option>
  69.           <%rs.movenext
  70.             loop
  71.             end if 
  72.             rs.close:set rs=nothing
  73.          %></select>&nbsp;&nbsp;&nbsp;&nbsp;检索关键词:
  74. <input name="gjc" size="25" class=form>
  75. &nbsp;&nbsp;&nbsp;&nbsp;
  76. <input type=submit name=tiaojian value=" 查 询 " class=button>&nbsp;&nbsp;</td>
  77. </tr></form>
  78. </table>
  79.    <table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="100%">
  80. <%
  81. s_name=replace(request("s_name"),"'","’")
  82. gjc=replace(request("gjc"),"'","’")
  83. set rs=server.CreateObject("adodb.recordset")
  84. sql="select * from 56770_product where p_name<>''"
  85. if s_name<>"0" and s_name<>"" then sql=sql&" and p_sort like '%"&s_name&"%'"
  86. If gjc<>"" Then sql=sql&" and (p_name like '%"&gjc&"%' or p_bianma like '%"&gjc&"%' or p_chandi like '%"&gjc&"%' or p_guige like '%"&gjc&"%' or p_price like '%"&gjc&"%' or p_yaochang like '%"&gjc&"%' or p_jinhuoshang like '%"&gjc&"%')"
  87. sql=sql&" order by p_id desc"
  88. 'response.write sql
  89. rs.open sql,conn, 1, 1
  90. %>
  91. <tr class=classtop1>
  92. <td  height="15" align="center">分类</td>
  93. <td  height="15" align="center">药品名</td>
  94. <td  height="15" align="center">编码</td>
  95. <td  height="15" align="center">零售价 </td>
  96. <td  height="15" align="center">批发价 </td>
  97. <td  height="15" align="center">进价</td>
  98. <td  height="15" align="center">总数</td>
  99. <td  height="15" align="center">库存</td>
  100. <td  height="15" align="center">操作 </td>
  101. </tr>
  102. <%if rs.eof and rs.bof then
  103. response.write "还没有数据,请添加!"
  104. Else
  105. if not isempty(request("page")) then   
  106. pagecount=cint(request("page"))   
  107. else   
  108. pagecount=1
  109. end if
  110. rs.pagesize=20
  111. rs.AbsolutePage=pagecount
  112.         do while not rs.eof%>
  113. <tr>
  114. <form name="form1" method="post" action='56770_editproduct.asp?s_id=<%=rs("p_id")%>'>
  115. <td class="classtd" align="center" >
  116. <%=rs("p_sort")%>
  117. </td>
  118. <td class="classtd" align="center">
  119. <%=rs("p_name")%>
  120. </td>
  121. <td class="classtd" align="center">
  122. <%=rs("p_bianma")%>
  123. </td>
  124. <td class="classtd" align="center">
  125. <%=rs("p_price")%>
  126. </td>
  127. <td class="classtd" align="center">
  128. <%=rs("p_pfprice")%>
  129. </td>
  130. <td class="classtd" align="center">
  131. <%=rs("p_cbprice")%>
  132. </td>
  133. <td class="classtd" align="center">
  134. <%=rs("p_count")%>
  135. </td>
  136. <td class="classtd" align="center">
  137. <%=rs("p_kucun")%>
  138. </td>
  139. <td class="classtd">
  140. <div align="center">
  141. <input type="submit" name="Submit" value="修 改" >
  142. <input type="button" name="Submit2" value="删 除" onclick="{if(confirm('确认删除么?')){location.href='56770_product.asp?action=del&s_id=<%=rs("p_id")%>&gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=request("page")%>';}return false;}">
  143. </div>
  144. </td>
  145. </form>
  146. </tr>
  147. <%
  148. rs.movenext
  149. i=i+1                                                                     
  150. if i>=rs.pagesize then exit do                                                           
  151. loop
  152. %>
  153. <form action="56770_product.asp?gjc=<%=gjc%>&s_name=<%=s_name%>" method="post">
  154. <tr class=classfooter><td height="25" align="center" colspan=15>
  155.         <div align="center"> 共有数据 <b><%=rs.recordcount%></b> 条, 页次: <b><font color=red><%=pagecount%></font>/<%=rs.pagecount%></b>, 
  156.           当前从第 
  157.           <%
  158.            if pagecount<=1 then
  159.            response.write "<font color=red>1</font>"
  160.            else
  161.            response.write "<font color=red>" & pagecount*rs.pagesize-rs.pagesize+1 & "</font>"
  162.            end if
  163.           %>
  164.           条开始。 
  165.           <% if pagecount=1 and rs.pagecount<>pagecount and rs.pagecount<>0 then%>
  166.           <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount+1)%>">下一页</a> 
  167.           <% end if %>
  168.           <% if rs.pagecount>1 and rs.pagecount=pagecount then %>
  169.           <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount-1)%>">上一页</a> 
  170.           <%end if%>
  171.           <% if pagecount<>1 and rs.pagecount<>pagecount then%>
  172.           <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount-1)%>">上一页</a> <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount+1)%>">下一页</a> 
  173.           <% end if%>
  174.           &nbsp; 直接到第 
  175.           <select name="page">
  176.           <%for i=1 to rs.pagecount%>
  177.           <option value="<%=i%>"><%=i%></option>
  178.           <%next%>
  179.           </select>页 
  180.           <input type="submit" name="go" value="跳转" class=button>
  181.         </div>
  182.       </td>
  183.     </form>
  184.   </tr>
  185. <%
  186. End If 
  187. rs.close
  188. set rs=Nothing
  189. %>
  190. </table>
  191. </td>
  192. </tr>
  193. </table>
  194. <%end if%>