56770_sort.asp
上传用户:feitengda
上传日期:2022-07-20
资源大小:73k
文件大小:3k
- <!--#include file="conn.asp"-->
- <%
- call admintop()
- if session("admin_name")="" then
- adminflag()
- else
- dim action, s_id,s_paixu
- s_id=request.QueryString("s_id")
- action=request("action")
- s_paixu=cint(request("s_paixu"))
- select case action
- case "add"
- if trim(request("s_name"))<>"" then
- set rs=server.CreateObject("adodb.recordset")
- rs.Open "select * from 56770_sort", conn, 1, 3
- rs.AddNew
- rs("s_name")=trim(request("s_name"))
- rs("s_paixu")=trim(request("s_paixu"))
- rs.Update
- rs.Close
- set rs=nothing
- response.Redirect "56770_sort.asp"
- response.end
- end if
- '----------------------------------------
- case "edit"
- set rs=server.CreateObject("adodb.recordset")
- rs.open "select * from 56770_sort where s_id=" &s_id, conn, 1, 3
- rs("s_name")=request("s_name")
- rs("s_paixu")=cint(request("s_paixu"))
- rs.update
- rs.close
- response.Redirect "56770_sort.asp"
- response.end
- set rs=nothing
- '--------------------------------
- case "del"
- conn.execute "delete from 56770_sort where s_id="&s_id
- response.Redirect "56770_sort.asp"
- response
- 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>
- <%set rs=server.CreateObject("adodb.recordset")
- rs.open "select * from 56770_sort order by s_paixu desc", conn, 1, 1
- dim i
- i=rs.recordcount%>
- <tr class=classtop1>
- <td height="15" align="center">药品类别名</td>
- <td height="15" align="center">药品类别排序(<font color=red>决定显示位置</font>)</td>
- <td height="15" align="center">操作</td>
- </tr>
- <%if rs.eof and rs.bof then
- response.write "还没有数据,请添加!"
- else
- do while not rs.eof%>
- <tr>
- <form name="form1" method="post" action="56770_sort.asp?action=edit&s_id=<%=rs("s_id")%>">
- <td class="classtd">
- <div align="center">
- <input name="s_name" type="text" id="s_name" value="<%=trim(rs("s_name"))%>" size="25">
- </div>
- </td>
- <td class="classtd">
- <div align="center">
- <input name="s_paixu" type="text" id="s_paixu" value=<%=rs("s_paixu")%> onkeyup="value=value.replace(/[^d.]/g,'');" size="3">
- </div>
- </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_sort.asp?action=del&s_id=<%=rs("s_id")%>';}return false;}">
- </div>
- </td>
- </form>
- </tr>
- <%rs.movenext
- loop
- end if
- rs.close
- set rs=nothing%>
- <form name="form2" method="post" action="56770_sort.asp?action=add">
- <tr>
- <td height="15" class="classtd">
- <div align="center">
- <input name="s_name" type="text" id="s_name" size="25">
- </div>
- </td>
- <td class="classtd">
- <div align="center">
- <input name="s_paixu" type="text" id="s_paixu" value=0 onkeyup="value=value.replace(/[^d.]/g,'');" size="3">
- </div>
- </td>
- <td class="classtd">
- <div align="center">
- <input type="submit" name="Submit2" value="添 加">
- </div>
- </td>
- </form>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <%end if%>