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

📄 ck_sys_admin.asp

📁 倉庫管理繫統源碼,具有添加,查看,搜索,删除等功能
💻 ASP
字号:
<!--#include file="conn.inc"-->
<%
if request.cookies("admin")="" then
	response.redirect("index.asp")
end if

dim rs1,sql1
set rs1=server.createobject("adodb.recordset")
sql1="select * from user_info where username='"&request.cookies("admin")&"'"
rs1.open sql1,conn,1,1
%>
<html>
<head>
<title>赛格网络-管理用户</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<br>
<table width="760" height="55" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006600">
  <tr> 
    <td height="25" bgcolor="#FFFFFF" class="12">  --&gt;&gt;&gt; 欢迎 <font color="#006600"><%=rs1("username")%></font> 
      登陆,部门:<font color="#006600"><%=rs1("department")%></font> 职务:<font color="#006600"><%=rs1("job")%></font>                [<a href="#" onclick="javascript:window.open('edit_password.asp','','width=450,height=150,top=300,left=300,scrollbars=yes')">修改登陆密码</a>] [<a href="logout.asp">退出系统</a>]</td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF" class="12"> 您可以:[<a href="ck_sys_admin.asp?action=add">添加库存信息</a>]</td>
  </tr>
</table>
<form action="search_admin.asp" method="post" name="search1" id="search1">
  <table width="461" height="30" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333" class="12">
    <tr> 
      <td bgcolor="#FFFFFF">  <img src="image/search.gif" width="15" height="15" align="bottom"> 请输入产品关键字: 
        <input name="txtkey" type="text" class="txt" id="txtkey" size="25">
          
        <input name="Submit" type="submit" class="button" value="搜索"></td>
    </tr>
  </table>
</form><br>
<%
if request("action")="edit" then
	call edit_data
elseif request("action")="add" then
	call add_data
elseif request("action")="addsave" then
	conn.execute("insert into ck(prod_name,prod_num,prod_price,prod_com) values ('"&trim(request.form("prod_name"))&"','"&request.form("prod_num")&"','"&request.form("prod_price")&"','"&request.form("prod_com")&"')")
	
elseif request("action")="editsave" then
	conn.execute("update ck set prod_name='"&trim(request.form("prod_name"))&"',prod_num='"&request.form("prod_num")&"',prod_price='"&request.form("prod_price")&"',prod_com='"&request.form("prod_com")&"',update_time='"&now()&"' where id="&request("id"))
elseif request("action")="del" then
	conn.execute("delete from ck where id="&request("id"))%>
	<script>
	alert("已经成功删除!请刷新库存。");
	</script>
<%end if%>
<br>
<table width="760" border="0" align="center">
  <tr>
    <td class="12"><div align="right">[<a href="ck_sys_admin.asp">刷新库存信息</a>]</div></td>
  </tr>
</table>

<table width="760" height="54" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF6600" class="12">
  <tr align="center" bgcolor="#FFFFFF"> 
    <td width="139" height="22" ><font color="#FF0000">产品名称</font></td>
    <td width="78"><font color="#FF0000">库存数量</font></td>
    <td width="83"><font color="#FF0000">单价</font></td>
    <td width="199"><font color="#FF0000">生产厂家</font></td>
    <td width="67"><font color="#FF0000">入库日期</font></td>
    <td width="116"><font color="#FF0000">最后更新时间</font></td>
    <td width="35">编辑</td>
    <td width="34">删除</td>
  </tr>
  <%dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from ck order by update_time desc"
rs.open sql,conn,1,1
dim total_record,currentpage
const MaxPerpage=20
total_record=rs.recordcount
currentpage=request("page")
	if currentpage<1 then
		currentpage=1
	end if
	if currentpage=1 then		
		show_content
		show_page total_record,Maxperpage
	else
		rs.move (currentpage-1)*Maxperpage
		dim bookmark
		bookmark=rs.bookmark		
		show_content
		show_page total_record,Maxperpage
	end if
	
%>
  <%sub show_content
	dim i
	i=0
	do while not rs.eof
%>
  <tr bgcolor="#FFFFFF"> 
    <td height="29" > <%=rs("prod_name")%></td>
    <td align="center"><%=rs("prod_num")%></td>
    <td align="center">¥<%=FormatNumber(rs("prod_price"),2)%></td>
    <td> <%=rs("prod_com")%></td>
    <td align="center"><%=rs("add_date")%> </td>
    <td align="center"><font color="#006600"><%=rs("update_time")%></font></td>
    <td align="center"><a href="ck_sys_admin.asp?action=edit&id=<%=rs("id")%>"><img src="image/edit.gif" width="16" height="16" border="0"></a></td>
    <td align="center"><a href="ck_sys_admin.asp?action=del&id=<%=rs("id")%>"><img src="image/del.gif" width="16" height="16" border="0"></a></td>
  </tr>
  <% 
i=i+1
if i>=Maxperpage then exit do
rs.movenext
loop
rs.close
%>
  <%end sub%>
</table>
<br>


<%sub show_page(total_record,Maxperpage)
 dim file_url'文件名
 file_url="ck_sys_admin.asp"
 dim total_page
 if total_record mod Maxperpage=0 then
 	total_page=total_record \ Maxperpage
	else
	total_page=total_record \ Maxperpage+1
end if

%>
<p></p>
<table width="439" height="36" border="0" align="center" class="12">
  <tr> 
    <td width="141"><table width="141" border="0" cellspacing="1" class="12">
        <tr> 
          <td class="12"> 
            <%if currentpage<2 then%>
            第一页 
            <%else%>
            <a href='<%=file_url%>?id=<%=id%>&page=1' class="link"><font color="#FF0000">第一页</font></a> 
            <%end if%>
          </td>
          <td> 
            <%if currentpage<2 then%>
            <span class="12">上一页 
            <%else%>
            <a href='<%=file_url%>?id=<%=id%>&page=<%=currentpage-1%>'><font color="#FF0000">上一页</font></a></span></td>
          <%end if%>
        </tr>
      </table></td>
    <td width="125"><div align="justify"><font color="#FF0000">  <span class="12">共</span></font><span class="12"><%=total_record%><font color="#FF0000">条</font> 
        <font color="#FF0000">共分</font><%=total_page%><font color="#FF0000">页</font> </span></div></td>
    <td width="159"><table width="159" border="0" cellpadding="0" cellspacing="1" class="12">
        <tr> 
          <td width="73"> 
            <%if total_page-currentpage<1 then%>
            <span class="12">下一页 
            <%else%>
            <a href='<%=file_url%>?id=<%=id%>&page=<%=currentpage+1%>' class="12"><font color="#FF0000">下一页</font></a> 
            <%end if%>
            </span></td>
          <td width="59"> 
            <%if total_page-currentpage<1 then%>
            <span class="12"> 最后一页 
            <%else%>
            <a href='<%=file_url%>?id=<%=id%>&page=<%=total_page%>' class="12"><font color="#FF0000">最后一页</font></a> 
            <%end if%>
            </span></td>
        </tr>
      </table></td>
  </tr>
</table>
<%end sub%>
<br><br>

<%sub edit_data
dim rs2,sql2
set rs2=server.createobject("adodb.recordset")
sql2="select * from ck where id="&request("id")
rs2.open sql2,conn,1,1
%>

<form name="form2" method="post" action="ck_sys_admin.asp?action=editsave&id=<%=rs2("id")%>">
  <table width="760" height="107" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF6600" class="12">
    <tr bgcolor="#FFFFFF"> 
      <td height="22" colspan="4" ><font color="#FF0000"> </font>∷<font color="#FF0000"> </font>编辑库存信息</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF"> 
      <td width="207" height="22" ><font color="#006600">产品名称</font></td>
      <td width="85"><font color="#006600">库存数量</font></td>
      <td width="97"><font color="#006600">单价</font></td>
      <td width="366"><font color="#006600">生产厂家</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="29" >   
        <input name="prod_name" type="text" class="txt" id="prod_name" value="<%=rs2("prod_name")%>" size="20"></td>
      <td align="center"> <input name="prod_num" type="text" class="txt" id="prod_num" value="<%=rs2("prod_num")%>" size="7"></td>
      <td align="center"> <input name="prod_price" type="text" class="txt" id="prod_price" value="<%=rs2("prod_price")%>" size="10"></td>
      <td>  
        <input name="prod_com" type="text" class="txt" id="prod_com" value="<%=rs2("prod_com")%>" size="40"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="29" colspan="4" ><div align="center"> 
          <input name="Submit2" type="submit" class="button" value="修 改">
        </div></td>
    </tr>
  </table>
</form>
<%rs2.close%>
<%end sub%>
<br>

<%sub add_data%>
<form name="form3" method="post" action="ck_sys_admin.asp?action=addsave">
  <table width="760" height="107" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF6600" class="12">
    <tr bgcolor="#FFFFFF"> 
      <td height="22" colspan="4" ><font color="#FF0000"> </font>∷<font color="#FF0000"> </font>添加库存信息</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF"> 
      <td width="207" height="22" ><font color="#FF0000">产品名称</font></td>
      <td width="85"><font color="#FF0000">入库数量</font></td>
      <td width="97"><font color="#FF0000">单价</font></td>
      <td width="366"><font color="#FF0000">生产厂家</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="29" >   
        <input name="prod_name" type="text" class="txt" id="prod_name" size="20"></td>
      <td align="center"> <input name="prod_num" type="text" class="txt" id="prod_num" size="7"></td>
      <td align="center"> <input name="prod_price" type="text" class="txt" id="prod_price" size="10"></td>
      <td>  
        <input name="prod_com" type="text" class="txt" id="prod_com" size="40"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="29" colspan="4" ><div align="center"> 
          <input name="Submit2" type="submit" class="button" value="添 加">
        </div></td>
    </tr>
  </table>
</form>
<%end sub%>

</body>
</html>
<script>
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}
</script>

⌨️ 快捷键说明

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