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

📄 goodsadd.asp

📁 本软件程序是一个基于WEB的进销存管理平台,代码十分完整,无错!
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% 
    
    Response.Buffer = True 
    
    Response.ExpiresAbsolute = Now() - 1 
    
    Response.Expires = 0 
    
    Response.CacheControl = "no-cache" 
    
    %>
          <%
Set ObjReference = Server.CreateObject("jxc1.check") 
ObjReference.myfilec()
%>
<!--#include file="../../Connections/jxc.asp" -->
<%'初始流水号生成 
dim today
today=date()
toyear=year(today)
toyear=toyear*10000
tomonth= month(today)
tomonth=tomonth*100
tonow=day(today)
newid = toyear + tomonth + tonow
newid = newid*10000+1
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_jxc_STRING
Recordset1.Source = "SELECT * FROM goods ORDER BY id DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
If Recordset1.EOF And Recordset1.BOF Then 
hidcode = newid
else
phidcode =(Recordset1.Fields.Item("hidcode").Value)
phidcode = right(phidcode,12)
if newid - phidcode <5000 then 
hidcode = phidcode +1
else
hidcode = newid
end if
end if
Recordset1_numRows = 0
%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "供货关系"
If (Request("MM_EmptyValue") <> "") Then 
  Recordset2__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_jxc_STRING
Recordset2.Source = "SELECT * FROM guest WHERE gselect = '" + Replace(Recordset2__MMColParam, "'", "''") + "' ORDER BY gname ASC"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<html>
<head>
<title>www.71base.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS.CSS" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function YY_checkform() { //v4.65
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(parseInt(myV))||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('警告!!\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}
//-->
</script>
</head oncontextmenu="return false" >

<body>
<table width="100%" cellpadding="0">
  <tr>
    <td><form action="goodssave.asp" method="post" name="form2" onSubmit="YY_checkform('form2','hgoodsname','#q','0','货品名称不能为空','hdanwei','#q','0','计量单位不能为空','hxinghao','#q','0','型号不能为空','hshangbiao','#q','0','商标不能为空','hjiage','#q','0','价格不能为空','hgidcode','#q','1','供货客户必须选择');return document.MM_returnValue">
        <table width="100%" cellpadding="0">
          <tr> 
            <td height="16" colspan="3"> <div align="left"><img src="images/icon-page.gif" width="16" height="15"><font color="#6AB5FF">添加新货品&gt;&gt;</font></div></td>
          </tr>
          <tr> 
            <td width="12%"><div align="right">供货客户</div></td>
            <td colspan="2"><select name="hgidcode">
                <option value="">……请正确选择供货关系客户……</option>
                <%
While (NOT Recordset2.EOF)
%>
                <option value="<%=(Recordset2.Fields.Item("gidcode").Value)%>"><%=(Recordset2.Fields.Item("gname").Value)%></option>
                <%
  Recordset2.MoveNext()
Wend
If (Recordset2.CursorType > 0) Then
  Recordset2.MoveFirst
Else
  Recordset2.Requery
End If
%>
              </select>
              <font color="#FF0000">*</font> 如果不在列表中,请先添加客户</td>
          </tr>
          <tr> 
            <td height="16"><div align="right">货品名称</div></td>
            <td colspan="2"> <input name="hgoodsname" type="text" size="60">
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr> 
            <td height="18"> <div align="right">计量单位</div></td>
            <td colspan="2"> <input name="hdanwei" type="text" size="60"> <font color="#FF0000">*</font> 
            </td>
          </tr>
          <tr> 
            <td><div align="right">型号</div></td>
            <td colspan="2"> <input name="hxinghao" type="text" size="60"> <font color="#FF0000">*</font> 
            </td>
          </tr>
          <tr> 
            <td height="16"><div align="right">尺寸</div></td>
            <td colspan="2"> <input name="hchicun" type="text"  size="60"></td>
          </tr>
          <tr> 
            <td height="17"> <div align="right">等级</div></td>
            <td colspan="2"><input name="hdenji" type="text" size="60"></td>
          </tr>
          <tr> 
            <td><div align="right">商标</div></td>
            <td colspan="2"><input name="hshangbiao" type="text" size="60"></tl
            >
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr> 
            <td height="17"><div align="right">进货价格</div></td>
            <td colspan="2"> <input name="hjiage" type="text"  size="60"> <font color="#FF0000">*</font> 
            </td>
          </tr>
          <tr> 
            <td><div align="right">产地</div></td>
            <td colspan="2"> <input name="hchandi" type="text" size="60"></td>
          </tr>
          <tr> 
            <td height="16"><div align="right">有效期</div></td>
            <td colspan="2"> <input name="hyouxiaoqi" type="text" size="60"></td>
          </tr>
          <tr> 
            <td><div align="right">备注</div></td>
            <td colspan="2"><textarea name="hother" cols="50" onChange="YY_checkform('form2','hgoodsname','#q','0','货品名称不能为空','hdanwei','#q','0','单位不能为空');return document.MM_returnValue"></textarea></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td width="54%"><input type="submit" name="Submit" value="提交"></td>
            <td width="34%">&nbsp;</td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>

<p>&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing %>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
 

⌨️ 快捷键说明

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