56770_product.asp
上传用户:feitengda
上传日期:2022-07-20
资源大小:73k
文件大小:7k
- <!--#include file="conn.asp"-->
- <%
- on error resume next
- call admintop()
- if session("admin_name")="" then
- adminflag()
- else
- dim action, s_id
- s_id=request.QueryString("s_id")
- action=request("action")
- select case action
- '--------------------------------
- case "del"
- conn.execute "delete from 56770_product where p_id="&s_id
- if request("page")<>"" then
- response.Redirect "56770_product.asp?gjc="&gjc&"&s_name="&s_name&"&page="&request("page")&""
- else
- response.Redirect "56770_product.asp?gjc="&gjc&"&s_name="&s_name&""
- end if
- response.end
- end select
- %>
- <table border="0" cellspacing="1" cellpadding="0" height="0" align=center width="98%" bgcolor="#183789">
- <tr>
- <td>
- <table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="100%">
- <tr>
- <td height=15 align=center colspan=17 class=classtop>药品类别管理</td>
- </tr>
- <form name=form2 method=post action=56770_product.asp>
- <tr >
- <td class="classtd" align="center" colspan=2>库存总额:<strong><font color=red>
- <%Set rs=conn.execute("select p_cbprice,p_kucun from [56770_product]")
- If rs.eof Then
- sumprice="0"
- Else
- Do While Not rs.eof
- sumprice=sumprice+(rs("p_cbprice")*rs("p_kucun"))
- rs.movenext
- Loop
- End If
- rs.close:Set rs=Nothing
- response.write FormatNumber(sumprice,2)
- %> 元</font></strong>
- </td>
- <td class="classtd" align="center">
- <select name="anclassid" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
- <option selected>--快速跳转--</option>
- <option value=56770_product.asp>查看全部药品</option>
- <%set rs=conn.execute("select s_id,s_name from [56770_sort] order by s_paixu desc")
- if not rs.eof then
- do while not rs.eof
- %>
- <option value="?s_name=<%=server.urlencode(Trim(rs("s_name")))%>"><%=rs("s_name")%></option>
- <%rs.movenext
- loop
- end if
- rs.close:set rs=nothing
- %>
- </select></td>
- <td class="classtd" colspan="5" align=right>分类:
- <select name=s_name style="height:18px;">
- <option value="0">全部分类</option>
- <%set rs=conn.execute("select s_id,s_name from [56770_sort] order by s_paixu desc")
- if not rs.eof then
- do while not rs.eof
- %>
- <option value="<%=Trim(rs("s_name"))%>"><%=rs("s_name")%></option>
- <%rs.movenext
- loop
- end if
- rs.close:set rs=nothing
- %></select> 检索关键词:
- <input name="gjc" size="25" class=form>
-
- <input type=submit name=tiaojian value=" 查 询 " class=button> </td>
- </tr></form>
- </table>
- <table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="100%">
- <%
- s_name=replace(request("s_name"),"'","’")
- gjc=replace(request("gjc"),"'","’")
- set rs=server.CreateObject("adodb.recordset")
- sql="select * from 56770_product where p_name<>''"
- if s_name<>"0" and s_name<>"" then sql=sql&" and p_sort like '%"&s_name&"%'"
- 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&"%')"
- sql=sql&" order by p_id desc"
- 'response.write sql
- rs.open sql,conn, 1, 1
- %>
- <tr class=classtop1>
- <td height="15" align="center">分类</td>
- <td height="15" align="center">药品名</td>
- <td height="15" align="center">编码</td>
- <td height="15" align="center">零售价 </td>
- <td height="15" align="center">批发价 </td>
- <td height="15" align="center">进价</td>
- <td height="15" align="center">总数</td>
- <td height="15" align="center">库存</td>
- <td height="15" align="center">操作 </td>
- </tr>
- <%if rs.eof and rs.bof then
- response.write "还没有数据,请添加!"
- Else
- if not isempty(request("page")) then
- pagecount=cint(request("page"))
- else
- pagecount=1
- end if
- rs.pagesize=20
- rs.AbsolutePage=pagecount
- do while not rs.eof%>
- <tr>
- <form name="form1" method="post" action='56770_editproduct.asp?s_id=<%=rs("p_id")%>'>
- <td class="classtd" align="center" >
- <%=rs("p_sort")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_name")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_bianma")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_price")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_pfprice")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_cbprice")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_count")%>
- </td>
- <td class="classtd" align="center">
- <%=rs("p_kucun")%>
- </td>
- <td class="classtd">
- <div align="center">
- <input type="submit" name="Submit" value="修 改" >
- <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;}">
- </div>
- </td>
- </form>
- </tr>
- <%
- rs.movenext
- i=i+1
- if i>=rs.pagesize then exit do
- loop
- %>
- <form action="56770_product.asp?gjc=<%=gjc%>&s_name=<%=s_name%>" method="post">
- <tr class=classfooter><td height="25" align="center" colspan=15>
- <div align="center"> 共有数据 <b><%=rs.recordcount%></b> 条, 页次: <b><font color=red><%=pagecount%></font>/<%=rs.pagecount%></b>,
- 当前从第
- <%
- if pagecount<=1 then
- response.write "<font color=red>1</font>"
- else
- response.write "<font color=red>" & pagecount*rs.pagesize-rs.pagesize+1 & "</font>"
- end if
- %>
- 条开始。
- <% if pagecount=1 and rs.pagecount<>pagecount and rs.pagecount<>0 then%>
- <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount+1)%>">下一页</a>
- <% end if %>
- <% if rs.pagecount>1 and rs.pagecount=pagecount then %>
- <a href="?gjc=<%=gjc%>&s_name=<%=s_name%>&page=<%=cstr(pagecount-1)%>">上一页</a>
- <%end if%>
- <% if pagecount<>1 and rs.pagecount<>pagecount then%>
- <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>
- <% end if%>
- 直接到第
- <select name="page">
- <%for i=1 to rs.pagecount%>
- <option value="<%=i%>"><%=i%></option>
- <%next%>
- </select>页
- <input type="submit" name="go" value="跳转" class=button>
- </div>
- </td>
- </form>
- </tr>
- <%
- End If
- rs.close
- set rs=Nothing
- %>
- </table>
- </td>
- </tr>
- </table>
- <%end if%>