📄 disprent.asp
字号:
<!--#include file="CONN.ASP"-->
<!--#include file="ChkErr.asp"-->
<!--#include file="ResultMsg.asp"-->
<%
If IsEmpty(Session("UserID"))=True Then
Response.Write GetErr(7)
Response.End
End If
If IsNumeric(Request("id"))=False Or Request("id")="" Then
Response.Write GetErr(1)
Response.End
Else
'判断标注超期的影片
strSQL="SELECT * FROM [Tenancy] WHERE TAC_StartTime_D IS NOT NULL AND TAC_EndTime_D IS NULL"
Set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open strSQL,objConn,1,3
Dim MsgUser
For i=1 To objRS.RecordCount
If DateDiff("d",DateAdd("d",objRS("TAC_Lease_N"),objRS("TAC_StartTime_D")),Now())>objRS("TAC_Lease_N") Then
strSQL="UPDATE [Tenancy] SET TAC_TimeOut_B=True,TAC_MsgUser_B=True WHERE TAC_ID_N="&objRS("TAC_ID_N")
objConn.Execute(strSQL)
End If
objRS.MoveNext
Next
objRS.Close
'用户是否是管理员
Dim IsAdmin
strSQL="SELECT UI_IsAdmin_B FROM [UserInfo] WHERE UI_ID_N="&Session("UserID")
objRS.Open strSQL,objConn,1,3
IsAdmin=objRS("UI_IsAdmin_B")
objRS.Close
'若用户不是管理员,则判断其所浏览的交易记录是否是自己的
If IsAdmin=False Then
strSQL="SELECT TAC_UI_ID_FN FROM [Tenancy] WHERE TAC_ID_N="&Request("id")
objRS.Open strSQL,objConn,1,3
If objRS.BOF Or objRS.EOF Then
Response.Write GetErr(12)
Response.End
objRS.Close
Set objRS=Nothing
CloseDatabase
End If
If objRS("TAC_UI_ID_FN")<>Session("UserID") Then
Response.Write GetErr(1)
Response.End
End If
objRS.Close
End If
strSQL="SELECT * FROM [Tenancy],[UserInfo],[VideoInfo],[Payment],[TypeInfo] WHERE TAC_ID_N="&Request("id")&" AND TAC_VI_ID_FN=VI_ID_N AND TAC_UI_ID_FN=UI_ID_N AND VI_TI_ID_FN=TI_ID_N AND VI_PMT_ID_FN=PMT_ID_N"
objRS.Open strSQL,objConn,1,3
If objRS.BOF Or objRS.EOF Then
Response.Write GetErr(12)
Response.End
objRS.Close
Set objRS=Nothing
CloseDatabase
End If
'超期天数
Dim tmpTimeout
If IsNull(objRS("TAC_StartTime_D"))=False Then
tmpTimeout=DateDiff("d",DateAdd("d",objRS("TAC_Lease_N"),objRS("TAC_StartTime_D")),Now())
If tmpTimeout<=0 Then
tmpTimeout=0
End If
Else
tmpTimeout=0
End If
'刷新影片状态记录
If IsNull(objRS("TAC_StartTime_D"))<>True Then
If tmpTimeout>objRS("TAC_Lease_N") Then
'若影片超出租期未还,则设定影片状态为超期
strSQL="UPDATE [Tenancy] SET TAC_TimeOut_B=True WHERE TAC_ID_N="&Request("id")
objConn.Execute(strSQL)
End If
End If
'获取并判断用户租金
Dim tmpUserPayment
If IsNull(objRS("TAC_StartTime_D"))<>True Then
If objRS("TAC_TimeOut_B")=True Then
tmpUserPayment=objRS("PMT_Price_N")*DateDiff("d",objRS("TAC_StartTime_D"),Now())+objRS("PMT_LateFee_N")*tmpTimeout
Else
tmpUserPayment=objRS("PMT_Price_N")*objRS("TAC_Lease_N")
End If
Else
tmpUserPayment=0
End If
'管理选项
Dim tmpCtr
If IsNull(objRS("TAC_StartTime_D"))=True Then
tmpCtr="[<a href=modifyRent.asp?action=CancelBooked&id="&Request("id")&">取消预订</a>]"
End IF
If IsAdmin=True Then
tmpCtr=tmpCtr&" [<a href=modifyRent.asp?action=CtrRent&id="&Request("id")&">用户起租/结算</a>]"
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<link href="style.css" rel="stylesheet" type="text/css">
<title>察看租赁记录</title>
<script language="javascript" src="JS\inc.js"></script>
</head>
<body>
<table class=tableborder1 align=center cellspacing=1 cellpadding=3 width=100% height=100%>
<tr><th colspan=2 id=tabletitlelink height=25 style=font-weight:normal align=center>租赁记录ID:<b><%=objRS("TAC_ID_N")%></b></th></tr>
<tr><td class=TableBody2 align=right width=25%>影片:</td><td class=TableBody1 align=left><a href=dispmovie.asp?id=<%=objRS("VI_ID_N")%> target=_blank><%=objRS("VI_Title_S")%>(点击显示)</a></td></tr>
<tr><td class=TableBody2 align=right width=25%>介质:</td><td class=TableBody1 align=left><%=objRS("TI_Description_S")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>租户:</td><td class=TableBody1 align=left><%=objRS("UI_Name_S")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>预订时间:</td><td class=TableBody1 align=left><%=objRS("TAC_ReserveTime_D")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>起租时间:</td><td class=TableBody1 align=left><%=objRS("TAC_StartTime_D")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>返还时间:</td><td class=TableBody1 align=left><%=objRS("TAC_EndTime_D")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>是否超时:</td><td class=TableBody1 align=left><%=objRS("TAC_TimeOut_B")%></td></tr>
<tr><td class=TableBody2 align=right width=25%>超时:</td><td class=TableBody1 align=left><%=tmpTimeout%>天</td></tr>
<tr><td class=TableBody2 align=right width=25%>租金:</td><td class=TableBody1 align=left><%=tmpUserPayment%>¥</td></tr>
<tr><td class=TableBody2 align=right width=25%>押金:</td><td class=TableBody1 align=left><%=objRS("PMT_Deposit_N")%>¥</td></tr>
<tr><td class=TableBody2 align=right width=25%>租金标准:</td><td class=TableBody1 align=left><%=objRS("PMT_Price_N")%>¥/天</td></tr>
<tr><td class=TableBody2 align=right width=25%>滞纳金:</td><td class=TableBody1 align=left><%=objRS("PMT_LateFee_N")%>¥/天</td></tr>
<tr><td class=TableBody2 align=right width=25%>租期:</td><td class=TableBody1 align=left><%=objRS("TAC_Lease_N")%>天</td></tr>
<tr><td class=TableBody2 align=right width=25%>管理:</td><td class=TableBody1 align=left><%=tmpCtr%></td></tr>
</table>
</body>
</html>
<%
objRS.Close
Set objRS=Nothing
CloseDatabase
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -