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

📄 index.asp

📁 后台管理 用户名 admin 密码 admin --------------------------------------------------- 功能说明 系统本着简洁实用
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
On Error Resume next
response.charset="GB2312"
session.codepage=936
call admintop()
%>
<title>56770 药品管理系统</title>
<SCRIPT LANGUAGE=javascript>
var tt='start';
var ii='start';
function turnit(ss,bb) {

  if (ss.style.display=="none") {
    if(tt!='start') tt.style.display="none";
    if(ii!='start') ii.src="";
    ss.style.display="";
    tt=ss;
    ii=bb;
    bb.src="";
  }
  else {
    ss.style.display="none"; 
    bb.src="";
  }
}
</SCRIPT>
<%
'if session("admin_name")<>"" then
'	adminflag()	
'else
dim action, s_id
s_id=request("s_id")
action=request("action")

select case action
'--------------------------------
case "update"
p_kucun=CLng(request.form("p_kucun"))
upkucun=CLng(request.form("upkucun"))
p_type=CLng(request.form("p_type"))
s_id=request("s_id")
if request.form("p_kucun")="" then 
response.write "<script>alert('没有输入要操作的库存数量');window.document.location.href='"&request.servervariables("HTTP_REFERER")&"';</script>"
response.End()
else
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from 56770_product where p_id="&s_id, conn, 1, 3
ykucun=cint(rs("p_kucun"))
rs.close:Set rs=Nothing 
If upkucun=0 Then 
if ykucun<p_kucun Then 
response.write "<script>alert('没有那么多库存!"&ykucun&"');window.document.location.href='"&request.servervariables("HTTP_REFERER")&"';</script>"
response.End()
End If 
End If 
If upkucun=0 Then 

Set rs=conn.execute("select * from [56770_product] where p_id="&s_id&"")
If p_type=0 Then 
       buy_price=rs("p_price")
Else
       buy_price=rs("p_pfprice")
End If 
day1=Now()
conn.execute("insert into [56770_pro_log](p_id,p_name,p_sort,p_price,p_cbprice,p_count,p_sj)values("&s_id&",'"&rs("p_name")&"','"&rs("p_sort")&"',"&rs("p_price")&","&rs("p_cbprice")&","&p_kucun&",'"&Replace(day1," 上午","")&"')")
sql= "update [56770_product] set p_kucun=p_kucun-"&p_kucun&" where p_id="&s_id&""

ElseIf upkucun=1 Then 
sql= "update [56770_product] set p_kucun=p_kucun+"&p_kucun&" where p_id="&s_id&""
ElseIf upkucun=2 Then 
sql= "update [56770_product] set p_kucun=p_kucun+"&p_kucun&",p_count=p_count+"&p_kucun&" where p_id="&s_id
Else
sql= "update [56770_product] set p_kucun=p_kucun-"&p_kucun&",p_count=p_count-"&p_kucun&" where p_id="&s_id
End If 
'response.write sql
response.write sql1
conn.execute (sql)
response.Redirect request.servervariables("HTTP_REFERER")
response.end
end If
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=15 class=classtop>56770 药品管理系统</td>
</tr>
<form name=form2 method=post action=index.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=index.asp>查看全部药品</option>
		  <option value=query.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>&nbsp;&nbsp;&nbsp;&nbsp;检索关键词:
<input name="gjc" size="25" class=form>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type=submit name=tiaojian value=" 查 询 " class=button>&nbsp;&nbsp;</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" width="15%"><img src=database/images/t1.gif>品名</td>
<td  height="15" align="center" width="10%">编码</td>
<td  height="15" align="center" width="10%">类别</td>
<td  height="15" align="center" width="5%">规格</td>
<td  height="15" align="center" width="5%">单位</td>
<td  height="15" align="center" width="6%">产地</td>
<td  height="15" align="center" width="6%">零售</td>
<td  height="15" align="center" width="6%">批发</td>
<td  height="15" align="center" width="6%">进价</td>
<td  height="15" align="center" width="5%">总数</td>
<td  height="15" align="center" width="5%">库存</td>
<td  height="15" align="center" width="10%"><img src=database/images/user.gif>供应商</td>
<td  height="15" align="center" width="15%">厂家</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='index.asp?action=update&s_id=<%=rs("p_id")%>'>
<td class="classtd" id=tag<%=rs("p_id")%> style='CURSOR: hand' onclick=turnit(Content<%=rs("p_id")%>,tag<%=rs("p_id")%>);  language=JScript>
<img src=database/images/+.gif>
<%=Replace(rs("p_name"),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd">
<%=Replace(rs("p_bianma"),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd" align="center" >
<%=rs("p_sort")%>
</td>
<td class="classtd" align="center">
<%=Replace(rs("p_guige"),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd" align="center" >
<%=rs("p_danwei")%>
</td>
<td class="classtd" align="center">
<%=Replace(rs("p_chandi"),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd" align="center">
<%=Replace(FormatNumber(rs("p_price"),2),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd" align="center">
<strong><%=FormatNumber(rs("p_pfprice"),2)%></strong>
</td>
<td class="classtd" align="center">
<%=FormatNumber(rs("p_cbprice"),2)%>
</td>
<td class="classtd" align="center">
<%=rs("p_count")%>
</td>
<td class="classtd" align="center">
<%=rs("p_kucun")%>
</td>
<td class="classtd" align="center">
<%=Replace(rs("p_jinhuoshang"),gjc,"<font color=red>"&gjc&"</font>")%>
</td>
<td class="classtd"> <%=rs("p_yaochang")%>
</td>

</tr>
<tr>
<td colspan="13" align="right" height="25" id=Content<%=rs("p_id")%> style='DISPLAY: none'>
<table>
<tr><td width="30%">库存总额:<%=formatnumber(rs("p_cbprice"),2)%>×<%=rs("p_kucun")%>(<%=rs("p_danwei")%>)=<%=formatnumber(rs("p_cbprice")*rs("p_kucun"),2)%></td>
<td width="70%" align="center">
销售类别:<input type=radio value=0 name=p_type checked>零售 <input type=radio value=1 name=p_type>批发
&nbsp;&nbsp;&nbsp;
库存操作:<input type="type" name="p_kucun" value="1" size="4" onkeyup="value=value.replace(/[^\d\.]/g,'');">
<input type=radio value=0 name=upkucun checked>减少 <input type=radio value=1 name=upkucun>补错增加 <input type=radio value=2 name=upkucun>增加 <input type=radio value=3 name=upkucun>补错减少
<input type="submit" name="Submit" value="确定" >
</td></tr>
</table>
</td>
</tr>
</form>
<%
rs.movenext
i=i+1                                                                     
if i>=rs.pagesize then exit do                                                           
loop
%>
<form action="index.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%>
          &nbsp; 直接到第 
          <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
%>
<tr><td align=center height=25 colspan=15>[<a href="admin/default.asp">系统管理</a>]</td></tr>
</table>
</td></tr>
</table>
<%'end if%>

⌨️ 快捷键说明

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