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

📄 jindu.asp

📁 投资管理系统, asp+ mssql server
💻 ASP
字号:
<%
response.expires=-1
dim ThisKey
ThisKey = "b"
%>
<!--#include file="../inc/permission.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Date.asp"-->
<!--#include file="../../inc/RightsForOne.asp"-->
<%
ID=trim(request("ID"))
LoginName=Session("LoginName")
If RightsForOne(ID,LoginName)<3 Then
	Response.Write "<Script Language='JavaScript'>"
	Response.Write "alert('你没有编辑此项目的权限');"
	Response.Write "self.close();"
	Response.Write "</Script>"
	Response.End
End If
%>
<html>
<head>
<title>修改投资情况</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet href="../css/main.css" type="text/css">
</head>
<%
set rs=server.createobject("adodb.recordset")

if trim(request("Del"))="1" then
	conn.execute("delete from tblJindu where ID="&trim(request("FID")))
	response.redirect("Jindu.asp?typet="&typet&"&ID="&trim(request("ID")))
end if

if trim(request("submit"))="确 定" then
	FID=trim(request("FID"))
	Item=replace(trim(request("Item")),"'","''")
	Money=replace(trim(request("Money")),"'","''")
	if Money="" then
		Money=0
	end if
	Content=replace(trim(request("Content")),"'","''")
	CountDate=replace(trim(request("CountDate")),"'","''")
	InputDate=replace(trim(request("InputDate")),"'","''")
	InputTime=now()

	if trim(request("FID"))="0" then
		rs.open "select * from tblJindu where ID is NULL",conn,1,2
		rs.addnew
		rs("ProjectID")=ID
		rs("Item")=Item
		rs("Money")=Money
		rs("Content")=Content
		rs("CountDate")=CountDate
		rs("InputDate")=InputDate
		rs("InputTime")=InputTime
		rs.update
		rs.close
		response.write "&nbsp;&nbsp;添加成功!  <a href=# onclick='javascript:window.close();'>[关闭窗口]</a>&nbsp;&nbsp;"
	else
		rs.open "select * from tblJindu where ID="&FID,conn,1,2
		
		rs("Item")=Item
		rs("Money")=Money
		rs("Content")=Content
		rs("CountDate")=CountDate
		rs.update
		rs.close
		response.write "&nbsp;&nbsp;修改成功!  <a href=# onclick='javascript:window.close();'>[关闭窗口]</a>&nbsp;&nbsp;"
	end if
end if

rs.open "select Name from tblBase where ID="&ID,conn,1,1
if not rs.eof then
	ProjectName=trim(rs("Name"))
end if
rs.close

rs.open "select * from tblJindu where ProjectID="&ID,conn,1,1
if not rs.eof then
	reTotal=rs.recordcount
end if

if trim(request("num"))="" then
	num=1
else
	num=trim(request("num"))
end if

for i=1 to num-1
	if not rs.eof then
		rs.movenext
	end if
next
FID=0
if trim(request("new"))<>"1" then
	if not rs.eof then	
		FID=rs("ID")
		Item=trim(rs("Item"))
		Money=trim(rs("Money"))
		Content=trim(rs("Content"))
		CountDate=trim(rs("CountDate"))
		InputDate=trim(rs("InputDate"))
	end if
end if
rs.close
for j=1 to reTotal
	if j=cint(num) then
		response.write "&nbsp&nbsp;<a href='Jindu.asp?typet="&typet&"&ID="&ID&"&num="&j&"'><font color=red>["&j&"]</font></a>"
	else
		response.write "&nbsp&nbsp;<a href='Jindu.asp?typet="&typet&"&ID="&ID&"&num="&j&"'>["&j&"]</a>"
	end if
next

if cint(FID)<>0 then
	response.write "&nbsp;&nbsp;<a href='Jindu.asp?typet="&typet&"&ID="&ID&"&FID="&FID&"&Del=1'>删除当前记录</a>"
end if

	response.write "&nbsp;&nbsp;<a href='Jindu.asp?typet="&typet&"&ID="&ID&"&new=1'>添加新记录</a>"
%>
<BODY bgcolor="#FFCC33" leftmargin=0 topmargin=5>
  <table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
  <form name="SubmitForm" method="post" action="Jindu.asp">
	<tr>
      <td valign="middle" align="center" style="border-left:1 solid #0047b0;border-top:1 solid #0047b0;border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">        
      <table width="500" border="0" cellspacing="0" cellpadding="0">        
   		 <input type="hidden" name="ID" value="<%=ID%>">
		 <input type="hidden" name="FID" value="<%=FID%>">
		 <input type="hidden" name="num" value="<%=num%>">
		 <input type="hidden" name="typet" value="<%=typet%>">
          <tr valign="middle" align="left"> 
            <td width=120 align=center style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">项目名称</td>
            <td width=380 align="left" style="border-bottom:1 solid #0047b0">&nbsp;<%=ProjectName%></td>
	       </tr>
          <tr valign="middle"> 
            <td align=center width=120 style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">进度项目</td>
            <td width=380 align="left" style="border-bottom:1 solid #0047b0">
			<select name="Item" onchange="Show()">
			 <option value="当年资金到位" <%if Item="当年资金到位" then%>selected<%end if%>>当年资金到位</option>
			 <option value="当年投资完成" <%if Item="当年投资完成" then%>selected<%end if%>>当年投资完成</option>
			 <option value="当年形象进度" <%if Item="当年形象进度" then%>selected<%end if%>>当年形象进度</option>
			 <option value="到去年底累计资金到位" <%if Item="到去年底累计资金到位" then%>selected<%end if%>>到去年底累计资金到位</option>
			 <option value="到去年底累计投资完成" <%if Item="到去年底累计投资完成" then%>selected<%end if%>>到去年底累计投资完成</option>
			 <option value="到去年底累计形象进度" <%if Item="到去年底累计形象进度" then%>selected<%end if%>>到去年底累计形象进度</option>
			</select>
			</td>
	       </tr>
		  <tr id=t style=<%if Item<>"当年形象进度" and Item<>"到去年底累计形象进度" then%>"display:none"<%end if%>>
			<td width=120 align=center style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">形象进度</td>
			<td width=380 align="left" style="border-bottom:1 solid #0047b0"><textarea name=Content rows=3 cols=51><%=Content%></textarea></td>
		  </tr>
		  <tr id=tt style=<%if Item="当年形象进度" or Item="到去年底累计形象进度" then%>"display:none"<%end if%>>
			<td width=120 align=center style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">金额</td>
			<td width=380 align="left" style="border-bottom:1 solid #0047b0"><input type=text name=Money value="<%=Money%>" size=15>(万元)</td>
		  </tr>
	      <tr valign="middle" align="left"> 
            <td width=120 align=center style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0"><span id=ti style=<%if Item="当年形象进度" or Item="到去年底累计形象进度" then%>"display:none"<%end if%>>资金到位时间</span><span id=tii style=<%if Item<>"当年形象进度" and Item<>"到去年底累计形象进度" then%>"display:none"<%end if%>>进度完成时间</span></td>
            <td width=380 align="left" style="border-bottom:1 solid #0047b0"><input type=text name=CountDate value="<%if CountDate<>"" then%><%=CountDate%><%else%><%=date3%><%end if%>"></td>
	     </tr>
	      <tr valign="middle" align="left"> 
            <td width=120 align=center style="border-bottom:1 solid #0047b0;border-right:1 solid #0047b0">数据录入时间</td>
            <td width=380 align="left" style="border-bottom:1 solid #0047b0"><%if InputDate<>"" then%>&nbsp;<%=InputDate%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%else%><input type=text name=InputDate value="<%=date2%>"><%end if%><font color=red> * 请注意时间格式</font></td>
	     </tr>
         <tr align="center" valign="middle"> 
           <td colspan="2" valign="middle" align="center">
		    <input type="submit" name="submit" onclick="return j();" value="确 定">
		    <input type="reset" name="exit" value="重 写">
            </td>
          </tr>
	</form>   
  </table>
</BODY>
</HTML>
<script language="JavaScript">
function Show(){
if (document.all("Item").value=="当年形象进度"){	
	document.all("t").style.display = "";
	document.all("tt").style.display = "none";
	document.all("ti").style.display = "none";
	document.all("tii").style.display = "";
	}
else{
	if (document.all("Item").value=="到去年底累计形象进度"){	
		document.all("t").style.display = "";
		document.all("tt").style.display = "none";
		document.all("ti").style.display = "none";
		document.all("tii").style.display = "";
		}
	else{
		document.all("t").style.display = "none";
		document.all("tt").style.display = "";
		document.all("ti").style.display = "";
		document.all("tii").style.display = "none";
		}
	}
}

function j(){
	s=document.SubmitForm.Money.value
	if(s!==''){
		dot=0
		for(i=0;i<s.length;i++){
			if(s.charAt(i)>'9'){
				alert("请输入正确的数字。");
				return false;
			}
			if(s.charAt(i)<'0'){
				if(s.charAt(i)=='.'){
					dot=dot+1
						if(dot>1){
							alert("请输入正确格式的数字。");
							return false;
						}
				}
				if(s.charAt(i)!='.'){
					alert("请输入正确的数字。");
					return false;					
				}
			}
		}
	}
}
</script>
<!--#include file="../inc/close.asp"-->

⌨️ 快捷键说明

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