?? goodsadd.asp
字號(hào):
<%@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" -->
<%'初始流水號(hào)生成
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 = "供貨關(guān)系"
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','計(jì)量單位不能為空','hxinghao','#q','0','型號(hào)不能為空','hshangbiao','#q','0','商標(biāo)不能為空','hjiage','#q','0','價(jià)格不能為空','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">添加新貨品>></font></div></td>
</tr>
<tr>
<td width="12%"><div align="right">供貨客戶</div></td>
<td colspan="2"><select name="hgidcode">
<option value="">……請(qǐng)正確選擇供貨關(guān)系客戶……</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> 如果不在列表中,請(qǐng)先添加客戶</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">計(jì)量單位</div></td>
<td colspan="2"> <input name="hdanwei" type="text" size="60"> <font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td><div align="right">型號(hào)</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">等級(jí)</div></td>
<td colspan="2"><input name="hdenji" type="text" size="60"></td>
</tr>
<tr>
<td><div align="right">商標(biāo)</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">進(jìn)貨價(jià)格</div></td>
<td colspan="2"> <input name="hjiage" type="text" size="60"> <font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td><div align="right">產(chǎn)地</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> </td>
<td width="54%"><input type="submit" name="Submit" value="提交"></td>
<td width="34%"> </td>
</tr>
</table>
</form></td>
</tr>
</table>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing %>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -