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

📄 guestadd.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 guest  ORDER BY gidcode DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
If Recordset1.EOF And Recordset1.BOF Then 
gidcode = newid
else
pgidcode =(Recordset1.Fields.Item("gidcode").Value)
pgidcode = right(pgidcode,12)
dim ppgidcode,pnewid
ppgidcode =left(pgidcode,8)
pnewid = left(newid,8)

if pnewid - ppgidcode  = 0 then 
gidcode = pgidcode +1
else
gidcode = newid
end if
end if
Recordset1_numRows = 0
%>
<%
Dim MM_paramName 
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then 
  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<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 MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

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=='');
}

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

<body oncontextmenu="return false" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="images/icon-page.gif" width="16" height="15"><font color="#6AB5FF">添加新客户&gt;&gt;</font></td>
  </tr>
</table>
<table width="100%" cellpadding="0">
  <tr>
    <td><form action="guestsave.asp" method="post" name="form1" onSubmit="YY_checkform('form1','gname','#q','0','名称不能为空','gaddress','#q','0','地址不能为空','gperson','#q','0','联系人不能为空','gyoubian','#q','0','邮政编码为数字','gtel1','#q','0','电话1为数字','gmail','S','2','注意mail格式','xinyong','#0_999999999','1','请填写金额数','gselect','#q','1','关系请选择');return document.MM_returnValue">
        <table width="100%" cellpadding="0">
          <tr> 
            <td width="22%"><div align="right">客户名称:</div></td>
            <td colspan="2"> <input name="gname" type="text" id="gname" size="60"> 
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr> 
            <td height="16"><div align="right">客户地址:</div></td>
            <td colspan="2"> <input name="gaddress" type="text" id="gaddress" size="60"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td><div align="right">联系人:</div></td>
            <td colspan="2"> <input name="gperson" type="text" id="gperson" size="60"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td><div align="right">邮政编码:</div></td>
            <td colspan="2"> <input name="gyoubian" type="text" id="gyoubian" size="60"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td height="16"><div align="right">传真:</div></td>
            <td colspan="2"> <input name="gfax" type="text" id="gfax" size="60"></td>
          </tr>
          <tr> 
            <td height="17">
<div align="right">电话1:</div></td>
            <td colspan="2"><input name="gtel1" type="text" id="gtel1" size="60"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td><div align="right">电话2:</div></td>
            <td colspan="2"><input name="gtel2" type="text" id="gtel2" size="60"> 
              &nbsp;</tl
            ></td>
          </tr>
          <tr> 
            <td><div align="right">开户银行:</div></td>
            <td colspan="2"> <input name="gbank" type="text" id="gbank" size="60"></td>
          </tr>
          <tr> 
            <td><div align="right">开户帐号:</div></td>
            <td colspan="2"> <input name="gbankno" type="text" id="gbankno" size="60"></td>
          </tr>
          <tr> 
            <td height="16"><div align="right">公司网址:</div></td>
            <td colspan="2"> <input name="gweb" type="text" id="gweb" size="60"></td>
          </tr>
          <tr> 
            <td><div align="right">电子邮件:</div></td>
            <td colspan="2"> <input name="gmail" type="text" id="gmail" size="60"></td>
          </tr>
          <tr> 
            <td height="23">
<div align="right">关系:</div></td>
            <td colspan="2"><select name="gselect">
                <option>……请选择……</option>
                <option value="供货关系">供货关系</option>
                <option value="购货关系">购货关系</option>
              </select> <font color="#FF0000">*</font> </td>
          </tr>
          <tr>
            <td><div align="right">信用金额:</div></td>
            <td colspan="2"><input name="xinyong" type="text" value="0">
              元</td>
          </tr>
          <tr> 
            <td><div align="right">备注:</div></td>
            <td colspan="2"><textarea name="beizhu" cols="50">该客户主要产品有……</textarea></td>
          </tr>
          <tr> 
            <td rowspan="2">&nbsp;</td>
            <td width="67%"><font color="#000000">(注意:提交前请确定该用户未登记过,</font><font color="#FF0000"> <A HREF="javascript:" onClick="MM_openBrWindow('guestlisted.asp','','scrollbars=yes,width=500,height=400')"><font color = red>已登记客户列表</font></A> 
              <font color="#000000"></select> )</font></font></td>
            <td width="11%" rowspan="2">&nbsp;</td>
          </tr>
          <tr> 
            <td><input type="submit" name="Submit" value="提交"></td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>

</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

⌨️ 快捷键说明

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