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

📄 newexpense.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
📖 第 1 页 / 共 2 页
字号:
      <td width="10%" height="15" align=center>备注</td>
  </table>
  
	<table  width=100% cellpadding="0" cellspacing="0">
	<tr><td id=expenseline>
	<%
	if request("id")="" then
		for k=1 to rspara("linenum")
	%>
        <table  cellpadding=2 cellspacing=1 bgcolor=#FFFFFF width=100%>
          <tr bgcolor=white>
			<td width=5% align=center bgcolor="#CEDfDE"><%=k%></td>
			<td width=15% bgcolor="DEDFDE">
              <select name=ExpenseType<%=k%>><option value=""></option><%getdefine "费用类型",""%></select>
            </td>
			<td width=15% bgcolor="DEDFDE">
                <input type="text" name="linedate<%=k%>" size="12" language=javascript id="dupdatetime<%=k%>" value="<%=date()%>" readonly>
                <% call AddImg("date"&k)%>
                </td>
			<td width=10% bgcolor="DEDFDE"> 
              <input type=text name=amount<%=k%> size=10>
            </td>
			<td width="10%" bgcolor="DEDFDE">
            <select name=PaymentType<%=k%>><option value="-1"></option><%getdefine "付款类型",""%></select></td>
			<td width="20%" bgcolor="DEDFDE">
			  <input name="account<%=k%>" type="hidden" size="8" value="-1"> 
              <input name="account<%=k%>name" type="text" size="15" value="" readonly> 
              <input type="button" name="bnaccount<%=k%>" onClick="JavaScript:form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='',opensubwin2('form1','account<%=k%>')"  value=... class=black> 
			  <input type=button name=cancelaccount onClick="javascript:form1.account<%=k%>.value=-1;form1.account<%=k%>name.value='',form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='';" value="C"  class=black>
        	</td>
	    	 <td width="15%" bgcolor="EFEFEF"> <input name="contact<%=k%>" type="hidden" size="8" value="-1"> 
    	    <input name="contact<%=k%>name" type="text" size="8" value="" readonly> 
			<input type="button" name="bncontact" onClick="JavaScript:if(form1.account<%=k%>.value!='-1'){opensubwinwithsearch('../contact/SelectAccountContact.asp','form1','contact<%=k%>','accountid',form1.account<%=k%>.value)}else{alert('请先选择客户!')}"    value=...  class=black>
			<input type=button name=cancelcontact onClick="javascript:form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='';" value="C"  class=black></td>			
			 <td width="10%" bgcolor="DEDFDE"> 
              <input name=description<%=k%> type=text size="10">
            </td>
		</tr>
	</table>
	<%
		next
		k=k-1
	else
		dim connline
		dim rsline
		set connline=server.CreateObject("adodb.connection")
		set rsline=server.CreateObject("adodb.recordset")
		connline.Open connstring
		rsline.Open "select * from expenseline where expenseid="&request("id"),connline,1,1
			if not rsline.EOF then
			dim j
			j=1
			do while not rsline.EOF 
	%>
			
        <table  cellpadding=2 cellspacing=1 bgcolor=FFFFFF width=100%>
          <tr bgcolor=white>
            <td width=5% align=center bgcolor="#CEDfDE"><%=j%></td>
            <td width=15% bgcolor="DEDFDE"> 
              <select name=ExpenseType<%=j%>><option value=""></option><%getdefine "费用类型",rsline("expensetype")%></select>
            </td>
            <td width=15% bgcolor="DEDFDE"> 
                <input type="text" name="linedate<%=j%>" size="12" language=javascript id="dupdatetime<%=j%>" value="<%=rsline("linedate")%>" readonly>
                <% call AddImg("date"&j)%>
              
              </td>
            <td width=10% bgcolor="DEDFDE"> 
              <input type=text name=amount<%=j%> size=10  value=<%=rsline("amount")%>>
            </td>
			<td width="10%" bgcolor="DEDFDE">
			 <select name=PaymentType<%=j%> ><option value="-1"></option><%getdefine "付款类型",rsline("PaymentTypeId")%></select></td>
			<td width="20%" bgcolor="DEDFDE">
			<input name="account<%=j%>" type="hidden" size="8" value="<%=rsline("accountid")%>"> 
            <input name="account<%=j%>name" type="text" size="15" value="<%=getfieldvalue("account","accountid",rsline("accountid"),"account")%>" readonly> 
            <input type="button" name="bnaccount<%=j%>" onClick="JavaScript:form1.contact<%=j%>.value=-1;form1.contact<%=j%>name.value='',opensubwin2('form1','account<%=j%>')"  value=... class=black> 
			<input type=button name=cancelaccount onClick="javascript:form1.account<%=j%>.value=-1;form1.account<%=j%>name.value='',form1.contact<%=j%>.value=-1;form1.contact<%=j%>name.value='';" value="C"  class=black>
			</td>
	    	 <td width="15%" bgcolor="EFEFEF">
			 <input name="contact<%=j%>" type="hidden" size="8" value="<%=rsline("contactid")%>"> 
    	    <input name="contact<%=j%>name" type="text" size="8" value="<%=getfieldvalue("contact","contactid",rsline("contactid"),"contact")%>" readonly> 
			<input type="button" name="bncontact" onClick="JavaScript:if(form1.account<%=j%>.value!='-1'){opensubwinwithsearch('../contact/SelectAccountContact.asp','form1','contact<%=j%>','accountid',form1.account<%=j%>.value)}else{alert('请先选择客户!')}"    value=...  class=black>
			<input type=button name=cancelcontact onClick="javascript:form1.contact<%=j%>.value=-1;form1.contact<%=j%>name.value='';" value="C"  class=black></td>
            <td width="10%" bgcolor="DEDFDE"> 
              <input name=description<%=j%> type=text  value="<%=rsline("description")%>" size="10">
            </td>
				</tr>
			</table>
		<%	
			j=j+1
			rsline.MoveNext
			loop
			j=j-1	
			else
				j=rspara("linenum")
				for k=1 to rspara("linenum")
			%>
			
        <table  cellpadding=2 cellspacing=1 bgcolor=FFFFFF width=100%>
          <tr bgcolor=white>
            <td width=5% align=center bgcolor="#CEDfDE"><%=k%></td>
            <td width=15% bgcolor="DEDFDE"> 
              <select name=ExpenseType<%=k%>><option value=""></option><%getdefine "费用类型",""%></select>
            </td>
            <td width=15% bgcolor="DEDFDE"> 
                <input type="text" name="linedate<%=k%>" size="12" language=javascript id="dupdatetime<%=k%>" value="<%=date()%>" readonly>
                <% call AddImg("date"&k)%>
              
              </td>
            <td width=10% bgcolor="DEDFDE"> 
              <input type=text name=amount<%=k%> size=10>
            </td>
			<td width="10%" bgcolor="DEDFDE">
			 <select name=PaymentType<%=k%> ><option value="-1"></option><%getdefine "付款类型",""%></select></td>
			<td width="20%" bgcolor="DEDFDE">
			  <input name="account<%=k%>" type="hidden" size="8" value="-1"> 
              <input name="account<%=k%>name" type="text" size="15" value="" readonly> 
              <input type="button" name="bnaccount<%=k%>" onClick="JavaScript:form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='',opensubwin2('form1','account<%=k%>')"  value=... class=black> 
			  <input type=button name=cancelaccount onClick="javascript:form1.account<%=k%>.value=-1;form1.account<%=k%>name.value='',form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='';" value="C"  class=black>
        	</td>
	    	 <td width="15%" bgcolor="EFEFEF"> <input name="contact<%=k%>" type="hidden" size="8" value="-1"> 
    	    <input name="contact<%=k%>name" type="text" size="8" value="" readonly> 
			<input type="button" name="bncontact" onClick="JavaScript:if(form1.account<%=k%>.value!='-1'){opensubwinwithsearch('../contact/SelectAccountContact.asp','form1','contact<%=k%>','accountid',form1.account<%=k%>.value)}else{alert('请先选择客户!')}"    value=...  class=black>
			<input type=button name=cancelcontact onClick="javascript:form1.contact<%=k%>.value=-1;form1.contact<%=k%>name.value='';" value="C"  class=black></td>			
            <td width="10%" bgcolor="DEDFDE"> 
              <input name=description<%=k%> type=text size="10">
            </td>
				</tr>
			</table>
			<%
				next
			end if
		rsline.Close
		set rsline=nothing
		connline.Close
		set connline=nothing
	end if
			%>
	</td></tr>
  </table>
  <input type=hidden id=linecount name=linecount value=<%if request("id")="" then Response.Write k else Response.Write j%>>
  <input type=hidden id=maxlinenum name=maxlinenum value=<%=rspara("maxlinenum")%>>
</form>
<script language=javascript>
	function addexpenseline(){
		if (parseInt(form1.linecount.value)>parseInt(form1.maxlinenum.value)){
			alert("已经到了最大行数,确实需要增加行数,请联系管理员重新设定最大行数!")
			return false;
		}
	
		for(x=1;x<=<%=rspara("step")%>;x++){
			
			form1.linecount.value=parseInt(form1.linecount.value)+1;
			i=form1.linecount.value;
			var tempstr=window.expenseline.innerHTML;
			window.expenseline.innerHTML='';
			tempstr=tempstr+"<table  cellpadding=2 cellspacing=1 bgcolor=#ffffff width=100%><tr bgcolor=white>";
			tempstr=tempstr+"<td align=center width=5% bgcolor=#CEDfDE>"+i+"</td>";
			tempstr=tempstr+"<td width=15% bgcolor=#DEDFDE><select name=ExpenseType"+i+"><option value=''></option><%getdefine "费用类型",""%></select></td>";
			tempstr=tempstr+"<td width=15% bgcolor=#DEDFDE><input type=text name=linedate"+i+" size=12 language=javascript id=dupdatetime"+i+" value='"+"<%=date()%>"+"' readonly> <input  type=hidden  id=date"+i+"> <img width=16 height=16 src='../Images/show-calendar.gif' onClick="+"opencalendar_C('"+"date"+i+"')>";

			//tempstr=tempstr+"<td width=15% bgcolor=#DEDFDE><input type=text name=linedate"+i+" size=12 value='<%=date()%>'><a href="+"javascript:show_calendar('form1.linedate"+i+"');nd();"+"><img src=../images/show-calendar.gif border=0></td>";
			tempstr=tempstr+"<td width=10% bgcolor=#DEDFDE><input type=text name=amount"+i+" size=10></td>";
			tempstr=tempstr+"<td width=10% bgcolor=#DEDFDE><select name=PaymentType"+i+"><option value=-1></option><%getdefine "付款类型",""%></select></td>";
			tempstr=tempstr+"<td width=20% bgcolor=#DEDFDE><input type=hidden name=account"+i+" size=8 value=-1>";
			tempstr=tempstr+"<input type=text name=account"+i+"name size=15 value='' readonly> ";
			tempstr=tempstr+"<input type=button name=bnaccount"+i+" onclick="+"javascript:form1.contact"+i+".value='';opensubwin2('form1','account"+i+"')"+" value=... class=black> ";
			tempstr=tempstr+"<input type=button name=cancelaccount onclick="+"javascript:form1.account"+i+".value=-1;form1.account"+i+"name.value='';form1.contact"+i+".value=-1;form1.contact"+i+"name.value='';"+" value=C class=black></td>";
			tempstr=tempstr+"<td width=15% bgcolor=#DEDFDE><input type=hidden name=contact"+i+" size=8 value=-1>";
			tempstr=tempstr+"<input type=text name=contact"+i+"name size=8 value='' readonly> ";
			//tempstr=tempstr+"<input type=button name=bncontact"+i+" onclick="+"javascript:if (form1.account"+i+".value!=-1){ opensubwinwithsearch('../contact/SelectAccountContact.asp','form1','contact"+i+"','accountid',form1.account"+i+".value)} else { alert('请选择客户!')}"+"  value=... class=black>";
			tempstr=tempstr+"<input type=button name=bncontact"+i+" onclick="+"javascript:won("+i+")"+" value=... class=black> ";
			tempstr=tempstr+"<input type=button name=cancelcontact onclick="+"javascript:form1.contact"+i+".value=-1;form1.contact"+i+"name.value='';"+" value=C class=black></td>";
			tempstr=tempstr+"<td width=10% bgcolor=#DEDFDE><input type=text name=description"+i+" size=10></td>";
			tempstr=tempstr+"</tr></table>";
			//alert(tempstr);
			window.expenseline.innerHTML=tempstr;
		}
	}
function won(i){
var account='account'+i;
var contact='contact'+i;
	if(document.all(account).value!=-1){
		opensubwinwithsearch('../contact/SelectAccountContact.asp','form1',contact,'accountid',document.all(account).value);
	 }
	else
	{
		alert('请选择客户!');
		return false;
	 }
}
</script>
</body>
</html>

⌨️ 快捷键说明

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