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

📄 selectstockproduct.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini"-->
<!--#include file="../commfunction.inc" -->
<%
if request("mod")="saveone" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from poapply",connq,2,3,1
		if request("poapplyqty"&request("seq"))<>0  then
			rsq.addnew
			rsq("productid")=request("productid"&request("seq"))
			rsq("poapplyqty")=request("poapplyqty"&request("seq"))			
			rsq("createdate")=now()
			rsq("creator")=session("loginid")
			rsq("status")="initial"
			rsq.Update
		end if	

	rsq.Close
	set rsq=nothing
	connq.Close 
	set connq=nothing 
response.write "<SCRIPT language=javascript>window.resizeTo(580,160);window.focus()</SCRIPT>"
response.write "<title>产品预定选择</title>"
response.write "<LINK href="&"../global.css"&" rel=stylesheet type=text/css>"
response.write "<br>"
response.write "<p align=center><font color=red size=2><b>"&"<img src=../images/smallprompt.jpg>&nbsp;预定申请成功!"&"</b></font><br>"
response.write "<font size=2>如发现有问题请到<产品预定申请>页面删除后重新预定!"&"</font></p>"
response.write "<p align=center><input type=button value="&"继续"&" onclick="&"javascript:saveok();"&"></p>"
response.write "<Script Language=JavaScript>"
response.write "function saveok(){"
response.write "window.opener.location.reload();"
response.write "window.close();}"
response.write "</script>"
response.end
%>
<%end if%>

<html>
<head>
<title>产品预定选择</title>
<Script Language=JavaScript>
function pickup2(i){
	var poapplyqty='poapplyqty'+i;
	if (isNaN(theForm.item(poapplyqty).value)||theForm.item(poapplyqty).value <= 0 || theForm.item(poapplyqty).value==''){
		alert('第'+i+'行输入的预定数量不正确!');
		theForm.item(poapplyqty).focus();
		return;
		}
	   theForm.mod.value="saveone";
	   theForm.seq.value=i;
	   theForm.submit();	
}

function bsubmit2(){
		if (theForm.StartWith.value==""){
			alert("搜索内容不能为空!")
			theForm.StartWith.focus();
			return;
		}
	   theForm.submit();	
}
</Script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../global.css" rel=stylesheet type=text/css>
</head>
<body leftmargin="10" rightmargin="10" topmargin="10">
<form name="theForm" method="Post" action="">
		<input type=hidden name=mod>
		<input type=hidden name=seq>
 <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="100%">
  <select name="Find" width="10">
    <option value=model <%if request("Find")="model" then Response.Write "selected"%>>型号</option>
    <option value=productcode <%if request("Find")="productcode" then Response.Write "selected"%>>产品货号</option>
  </select>
  <input type="Text" name="StartWith" size="16" value="<%=request("StartWith")%>">
   <input type="button" onclick="javascript:bsubmit2();" value="搜索" <%if request("lineid")<>"" or request("orderid")<>"" then response.write "disabled"%>>
  <input type="Hidden" name="theForm" value="<%=theForm%>"> <input type="Hidden" name="theName" value="<%=theName%>">&nbsp;&nbsp;&nbsp;</td></tr></table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr bgcolor="#FFFFFF"> 
      <td height="25"><strong><font size="2" class="title">产品预定选择</font></strong></td>
      <td align="right"><a href="javascript:window.close();"><img src="../images/button_close.gif" border=0></a></td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
  </table>
  <table width="100%" bgcolor=cdcdcd cellspacing=1>
	<tr bgcolor=efefef>
    <td align=center>型号</td>
    <td align=center width="12%">安全库存</td>
    <td align=center width="10%">库存量</td>
    <td align=center width="10%">保留量</td>
    <td align=center width="10%">预定量</td>
    <td align=center width="12%">市场价格</td>
    </tr>
    <%
	submit = Request.Form("theName")
	submit = trim(submit)

'if submit <>"" then
	dim sql
	dim i
	i=1
	Find = Request.Form("Find")
	StartWith = Request.Form("StartWith")

if Find <>"" then
		strwhere=" and " & Find & " like N'%" + trim(StartWith) + "%'"

	sql = "select top 20 productid,productcode,model,safetystock,qty_on_hand,qty_rsvd,retail_price from v_priceforquoteorder_prodcut where 1=1 "&strwhere
	set conn=server.CreateObject("adodb.connection")
	set rs=server.CreateObject("adodb.recordset")
	conn.Open connstring
	rs.Open sql,conn,1,1

	set productid=rs("productid")
	set productcode=rs("productcode")
	set model=rs("model")
	set safetystock=rs("safetystock")
	set qty_on_hand=rs("qty_on_hand")
	set qty_rsvd=rs("qty_rsvd")
	set retail_price=rs("retail_price")
	do while not rs.EOF
	%>
		<tr bgcolor=white>
				<input name=productid<%=i%> value="<%=productid%>" type="hidden">
		        <td align="center"><a href="javascript:pickup2('<%=i%>');"><%=model%><br><font color="#880000"><%=productcode%></font></a></td>
		        <td align="center"><%if safetystock<>"" then response.write safetystock else response.write "--"%></td>
		        <td align="center"><%if qty_on_hand<>"" then response.write qty_on_hand else response.write "--"%></td>
		        <td align="center"><%=qty_rsvd%></td>
		        <td align="center"><input type=text name=poapplyqty<%=i%> size=6></td>
		        <td align="center"><%=retail_price%></td>
		</tr>
	<%
	i=i+1
	rs.MoveNext
	loop
	rs.close
	Set rs = nothing
	conn.Close 
	set conn = nothing
end if
%>
  </table>
 </form>
</body>
</html>

⌨️ 快捷键说明

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