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

📄 pay_add.asp

📁 泡泡堂单机版(含ASL游戏引擎源码)
💻 ASP
字号:
<!--#include file="Conn.asp"-->
<!--#include file="Check.asp"-->
<!--#include file ="Inc/Date.asp"-->
<%
Dim isInOut
isInOut = Request("InOut")
%>
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="Image/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="Image/js.js"></SCRIPT>
</head>
<%
If Request.QueryString("action")="add" Then
   Call PaySave
Else
%>

<script language="JavaScript">
<!--
function change(obj,i) {
he=parseInt(obj.style.height);
if (he>=80&&he<=400)
   obj.style.height=he+i+'px';
else 
   obj.style.height='80px';
}

function chk(theForm){
if (theForm.listid.value == ""){
                alert("请输入单号!");
                theForm.listid.focus();
                return (false);
        } 
if (theForm.adddate.value == ""){
                alert("请输入日期!");
                theForm.adddate.focus();
                return (false);
        } 
if (theForm.money.value == ""){
                alert("请输入金额!");
                theForm.money.focus();
                return (false);
        } 
if (theForm.pjna.value == ""){
                alert("请输入项目名称!");
                theForm.pjna.focus();
                return (false);
        } 
if (theForm.message.value == ""){
                alert("请输入说明!");
                theForm.message.focus();
                return (false);
        } 
}

function CheckNum(){
   if((event.keyCode<48||event.keyCode>57)&&event.keyCode!=46) event.returnValue=false; 
   }
//-->
</script>
<body text="#000000">
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
  <form action="?id=<%=isInOut%>&action=add" method=post id=form1 name=form1 onSubmit="return chk(this)">
    <tr bgcolor=ffffff> 
      <th height=25 colspan=5 align="center">
<%If isInOut=1 Then
Response.Write "增加收入"
Else
Response.Write "增加支出"
End if
%>     </th>
    </tr>
    <tr bgcolor=ffffff> 
      <td width="28%" class=forumrow><div align="right">单号:</div></td>
      <td width="7%" class=forumrow>
	  <input name="listid" onkeypress="javascript:CheckNum();" type="text" id="listid" size="10" maxlength="10"></td>
      <td width="10%" class=forumrow><div align="right">日期:</div></td>
      <td colspan="2" class=forumrow><input name="adddate" type="text" id="adddate" size="12" maxlength="12" readonly> 
        <input onclick="popUpCalendar(this, form1.adddate, 'yyyy-mm-dd')" type="button" value="请选择日期"></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td width="28%" class=forumrow><div align="right">报销人:</div></td>
      <td colspan="4" class=forumrow><select name="selpayer" id="selpayer">
          <%
   Dim pa,pt
   Set pa=Conn.Execute("Select Payer From [Payer]")
   Do While Not pa.Eof
   Response.write "<option value='" & pa(0) & "'>" & pa(0) & "</option>"
   pa.MoveNext
   Loop
   pa.Close
   Set pa=Nothing
%>
        </select></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td class=forumrow><div align="right">费用类型:</div></td>
      <td colspan="4" class=forumrow><select name="seltype" id="seltype">
          <% 
   Set pt=Conn.Execute("Select PayType From [PayType] Where InOut="&isInOut&" ")
   Do While Not pt.Eof
   Response.write "<option value='" & pt(0) & "'>" & pt(0) & "</option>"
   pt.MoveNext
   Loop
   pt.Close
   Set pt=Nothing
%>
        </select></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td class=forumrow><div align="right">金额:</div></td>
      <td colspan="4" class=forumrow>
	  <input name="money" onkeypress="javascript:CheckNum();" type="text" id="money" size="10" maxlength="10"></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td class=forumrow><div align="right">项目名称:</div></td>
      <td colspan="4" class=forumrow> <input name="pjna" type="text" id="pjna" size="50" maxlength="50"></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td rowspan="2" class=forumrow><div align="right">说明:</div></td>
      <td colspan="4" class=forumrow><textarea name="message" cols="50" rows="8" id="message"></textarea> 
      </td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td colspan="3" class=forumrow>&nbsp; </td>
      <td width="43%" class=forumrow><a href="javascript:change(document.all.message,-50)"><img src="Image/minus.gif" alt="缩小文本框" width="20" height="20" border="0"></a> 
        <a href="javascript:change(document.all.message,50)"><img src="Image/plus.gif" alt="放大文本框" width="20" height="20" border="0"></a></td>
    </tr>
    <tr  bgcolor=ffffff> 
      <td colspan="5" align="center" class=forumrow><input type="submit" name="Submit" value="添 加"></td>
    </tr>
  </form>
</table>
<%End if%>
</html>

<%
Sub PaySave
Dim payadd,Sql
Dim listid,adddate,selpayer,seltype,money,pjna,message
Dim upsql
listid = Trim(Request.Form("listid"))
adddate = Request.Form("adddate")
selpayer = Request.Form("selpayer")
seltype = Request.Form("seltype")
money = Trim(Request.Form("money"))
pjna = Trim(Request.Form("pjna"))
message = Trim(Request.Form("message"))
Set payadd = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [PayList] Where (ID is null)"
payadd.Open Sql,Conn,1,3
payadd.addNew
payadd("ListID") = listid
payadd("Payer") = selpayer
payadd("PayType") = seltype
payadd("Money") = money
payadd("Project") = pjna
payadd("Menu") = message
payadd("Time") = adddate
payadd("InOut") = Request("id")
payadd.Update
payadd.Close
Set payadd=Nothing

Response.Write "<script language=javascript>alert('费用添加成功!');"
Response.Write "window.document.location.href='Pay_List.asp';</script>"
End Sub
%>

⌨️ 快捷键说明

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