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

📄 newexpense.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")

if request("id")<>"" then
	objcheck.CheckUserFunction "expense","edit"
else
	objcheck.CheckUserFunction "expense","add"
end if
set objcheck=nothing

'取参数
dim connpara
set connpara=server.CreateObject("adodb.connection")
connpara.Open connstring
set rspara=connpara.Execute("select * from parameter where type='expense'")

if request("id")<>"" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from expense where expenseid="&request("id"),connq,2,3,1
	strexpenseno=rsq("expenseno")
	strsubject=rsq("subject")
	strcurrency=rsq("currency")
	strcurrencyname=getfieldvalue("userdefine","id",rsq("currency"),"name")
	strstatus=rsq("status")
	strowner=rsq("owner")
	strownername=getfieldvalue("usertable","loginid",rsq("owner"),"username")
	strexpenseDate=rsq("expenseDate")
	strTotalAmount=rsq("TotalAmount")
	strdescription=rsq("description")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else
    strexpenseno="自动生成"
	strcontact=-1
	straccount=-1
	strowner=session("loginid")
	strownername=session("username")
	strexpenseDate=date()
	if Request.QueryString("accountid")<>"" then
		straccount=Request.QueryString("accountid")
		straccountname=Request.QueryString("accountname")
	end if
end if

if request("subject")<>"" then
	Dim objexpense
	Set objexpense=Server.CreateObject("SmartSales.Expense")
	objexpense.SaveExpense
	set objexpense=nothing
%>
<script language=javascript>
	window.opener.location.reload();
	window.close();
</script>
<%
end if
%>
<HTML><HEAD><TITLE>费用</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript src="../tools/newcalendar.js"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
</head>
<script language="JavaScript">
function window_onload()
{
window.moveTo(-2,-2);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
<script language="javascript">
function save(){
	if (form1.subject.value==''){
		alert('请选择费用名称!');
		form1.sunject.focus();
		return;
	}
	if (form1.currency.value==-1){
		alert('请选择货币代码!');
		form1.currency.focus();
		return;
	}

	for(x=1;x<=form1.linecount.value;x++){
		//alert(form1.linecount.value);
		var ExpenseType='ExpenseType'+x;
		var amount="amount"+x;
		if(form1.item(ExpenseType).value!=''){
			if(form1.item(amount).value==''){
				alert('请输入金额');
				form1.item(amount).focus();
				return;
			}
			if (isNaN(form1.item(amount).value)){
				alert('请输入数字');
				form1.item(amount).focus();
				return;
			}
		}
	}
form1.submit();
}
</script>
<body bgcolor="#ffffff" onload="window_onload()">
 <form name=form1  method="post"  id=form1>
 <input type = hidden name=clicksource>
 <input type = hidden name=clickresult >
  <table width="100%" height="48" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="35%" height="25"><strong><font size="2" class=title><b> 
        <%if request("id")="" then%>
        新建费用 
        <%else%>
        编辑费用 
        <%end if%>
        </b></font></strong></td>
      <td width="65%">
<div align="left" style="cursor:hand"> <a onclick="save();"><img src="../images/button_save.gif"></a>&nbsp;&nbsp; 
              <a onClick="window.close();"><img src="../images/button_cancel.gif"></a>
        </div></td>
  </tr>
    <tr > 
      <td height="19" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
 </table>
  <table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE"> <div align="center">费用编号</div></td>
      <td width="15%" bgcolor="EFEFEF" ><input name=expenseno type=text value="<%=strexpenseno%>" size="18" readonly></td>
      <td width="10%" bgcolor="DEDFDE" > <div align="center"><font color=red>*&nbsp;</font>费用名称</div></td>
      <td width="15%" bgcolor="EFEFEF" > <select name=subject>
          <%if strsubject<>"" then%>
          <option value="<%=strsubject%>"><%=strsubject%></option>
          <%else%>
          <option value="">--请选择费用名称--</option>
          <%end if%>
          <option value="费用报销">费用报销</option>
          <option value="现金预支">现金预支</option>
        </select> </td>
      <td width="10%" bgcolor="DEDFDE"><div align="center"><font color=red>*&nbsp;</font>货币代码</div></td>
      <td width="15%" bgcolor="EFEFEF"><select name=currency><option value="-1"></option><%getdefine "货币",strcurrency%></select></td> 
      <td width="10%" bgcolor="DEDFDE"> <div align="center">用户</div></td>
      <td width="15%" bgcolor="EFEFEF"> <input name="owner" type="hidden" size="8" value="<%=strowner%>"> 
        <input name="ownername" type="text" size="8" value="<%=strownername%>" readonly> 
        <input type="button" name="bnowner" onClick="JavaScript:opensubwin2('form1','owner')"    value=... class=black></td>
    </tr>
    <tr  bgcolor="white"> 
      <td rowspan="2" bgcolor="DEDFDE" ><div align="center">描述</div></td>
      <td colspan="5" rowspan="2" bgcolor="EFEFEF" > <textarea name="description" cols="45" rows="4"><%=strdescription%></textarea> 
      </td>
      <td width="10%" bgcolor="DEDFDE"> <div align="center">金额</div></td>
      <td width="15%" bgcolor="EFEFEF"><%=strTotalAmount%></td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE">&nbsp;</td>
      <td width="15%" bgcolor="EFEFEF"></td>
    </tr>
  </table>
    <BR>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="80" height="22"><strong><font size="2"><b><font class=title>费用明细</font></b></font></strong></td>
      <td width="62" height="22" align="center" valign="middle">
	    <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
            <td height="19" background="../images/button_bg.gif"> 
              <div align="center" style="cursor:hand"><a onClick="addexpenseline();"><font color="#000000">新增</font><font color="#ff0000"><%=rspara("step")%></font><font color="#000000">行</font></a></div></td>
	  </tr></table></td>
      <td height="22"></td>
    </tr>
    <tr> 
      <td height=2 colspan="6" bgcolor="#4A699C"></td>
    </tr>
	</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DECFAD">
  <tr valign="middle" bgcolor="efefef"> 
    <td width="5%" height="15" align=center>序号</td> 
      <td width="15%" height="15" align=center>费用类型</td>
      <td width="15%" height="15" align=center>日期</td>
      <td width="10%" height="15" align=center>金额</td>
      <td width="10%" height="15" align=center>付款类型</td>
      <td width="20%" height="15" align=center>客户</td>
      <td width="15%" height="15" align=center>联系人</td>

⌨️ 快捷键说明

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