📄 cardlist.inc
字号:
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
"<tr height=10>" & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
"</tr>" & _
"<tr height=20>" & _
" <td width=600> "
if IsOfficer() then
if not IsEmpty(sPart) then TableLink = TableLink & _
" <img src=""../images/goto.gif""> <a href=""cardlist.asp"">我的卡片</a> "
if sPart <> "forpass" then TableLink = TableLink & _
" <img src=""../images/goto.gif""> <a href=""cardlist.asp?part=forpass&"">等待审批的卡片</a> "
if sPart <> "passed" then TableLink = TableLink & _
" <img src=""../images/goto.gif""> <a href=""cardlist.asp?part=passed&"">已发放的卡片</a> "
end if
TableLink = TableLink & _
" </td>" & _
"</tr>" & _
"</table>"
End Function
Function TableHeader()
TableHeader = _
"<table cellspacing=0 cellpadding=0 width=600 align=center class=tablelist>" & _
" <tr>" & _
" <td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"" height=20 >" & sHeader & "</td>" & _
" </tr>" & _
" <tr>" & _
" <td class=tdHead width=100> <img src=""../images/bg/ar-y.gif"" width=8 height=8> " & TableHeaderField(sFileName, "Serial", "卡片编号", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead width=180> " & TableHeaderField(sFileName, "Name", "资产名称", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead width=80> " & TableHeaderField(sFileName, "Department", "使用部门", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead width=80> " & TableHeaderField(sFileName, "UserName", "使用人", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead width=80> " & TableHeaderField(sFileName, "ApplyDate", "建卡日期", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead width=80> " & TableHeaderField(sFileName, "Status", "状态", sFormParams, iSort, iSorted) & "</td>" & _
" </tr>"
End Function
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
dim sTemp : sTemp = "" ' 临时字符串变量
dim j ' 临时循环变量
'------------------------------------
' 分页所需的变量定义
'------------------------------------
Dim iCounter : iCounter = 1
Dim iPrevPage, iNextPage
'------------------------------------
' 获取数据库连接
'------------------------------------
dim crs : set crs = New CRecordset
dim rs : set rs = crs.open(dbLocal,sSQL)
dim ID, sSerial, sName, sType, sUnit, sDepartment, sUserName, sApplyDate, sStatus
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.Move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
ID = crs.GetValue("ID")
sSerial = crs.GetValue("Serial")
sName = crs.GetValue("Name")
sDepartment = crs.GetValue("Department")
sUserName = crs.GetValue("UserName")
sApplyDate = crs.GetValue("ApplyDate")
sStatus = crs.GetValue("Status")
sTemp = sTemp & _
"<tr bgcolor=white>" & _
" <td class=tdlist title=""" & sSerial & """ style=""cursor:hand"" onclick=""javascript:location.href='cardlist.asp?" & sFormParams & "part=" & sPart & "&action=edit&id=" & ID & "';""> <img src=""../images/bg/ar-g.gif"" width=8 height=8> " & Bref(sSerial,10) & " </td>" & _
" <td class=tdlist title=""" & sName & """ align=left> " & Bref(sName,20) & " </td>" & _
" <td class=tdlist title=""" & sDepartment & """ align=left> " & Bref(sDepartment, 10) & " </td>" & _
" <td class=tdlist title=""" & sUserName & """ align=left> " & Bref(sUserName, 8) & " </td>" & _
" <td class=tdlist title=""" & sApplyDate & """ align=left> " & sApplyDate & " </td>" & _
" <td class=tdlist title=""" & sStatus & """ align=left> " & Bref(sStatus, 8) & " </td>" & _
"</tr>"
iCounter = iCounter + 1
rs.movenext
wend
crs.Close()
' 填补空白行
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
' 首页、前页、后页、尾页等分页信息
sTemp = sTemp & "<tr bgcolor=white><td class=tdlist colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr></table>"
TableRecords = sTemp
end Function
' ====================================================================================
' 实现数据库操作的功能函数
' AddCard()
' UpdateCard()
' DeleteCard()
' PassCard()
' BackCard()
' ====================================================================================
Function AddCard()
dim strSQL
dim sSerial : sSerial = GetParam("serial")
dim sName : sName = GetParam("name")
dim sType : sType = GetParam("type")
dim sUnit : sUnit = GetParam("unit")
dim sAmount : sAmount = GetParam("amount")
dim sDepartment : sDepartment = GetParam("department")
dim sUserName : sUserName = GetParam("username")
dim sApplyDate : sApplyDate = date
dim sStatus : sStatus = "等待审批"
strSQL = "insert into T_Expendable(Serial, Name, Type, Unit, Amount, Department, UserName" & _
", ApplyDate, Signer, Status)" & _
" values(" & ToSQL(sSerial, "Text") & ", " & ToSQL(sName, "Text") & ", " & ToSQL(sType, "Text") & _
", " & ToSQL(sUnit, "Text") & ", " & ToSQL(sAmount, "Text") & ", " & ToSQL(sDepartment, "Text") & _
", " & ToSQL(sUserName, "Text") & ", " & ToSQL(sApplyDate,"Text") & ", " & ToSQL(sEmpName, "Text") & _
", " & ToSQL(sStatus, "Text") & ")"
call ExecuteSQL(dbLocal, strSQL)
iCardID = DLookUp(dbLocal, "T_Expendable", "max(ID)", "Signer=" & ToSQL(sEmpName, "Text"))
call CommonSendMsg(MSG_APPROVE,"","请审批:低值易耗品","请审批低值易耗品卡片!",iEmpSerial,GetOfficer())
Response.Redirect "cardlist.asp?id=" & iCardID & "&"
Response.end
End Function
Function UpdateCard()
dim sSQL
dim sSerial : sSerial = GetParam("serial")
dim sName : sName = GetParam("name")
dim sType : sType = GetParam("type")
dim sUnit : sUnit = GetParam("unit")
dim sAmount : sAmount = GetParam("amount")
dim sDepartment : sDepartment = GetParam("department")
dim sUserName : sUserName = GetParam("username")
sSQL = "update T_Expendable" & _
" set Serial = " & ToSQL(sSerial, "Text") & _
", Name = " & ToSQL(sName, "Text") & _
", Type = " & ToSQL(sType, "Text") & _
", Unit = " & ToSQL(sUnit, "Text") & _
", Amount = " & ToSQL(sAmount, "Number") & _
", Department = " & ToSQL(sDepartment, "Text") & _
", UserName = " & ToSQL(sUserName, "Text") & _
", Status = '等待审批'" & _
" where ID = " & ToSQL(iCardID, "Number")
call ExecuteSQL(dbLocal, sSQL)
call CommonSendMsg(MSG_APPROVE,"","请审批:低值易耗品","请审批低值易耗品卡片!",iEmpSerial,GetOfficer())
Response.Redirect "cardlist.asp?id=" & iCardID & "&"
Response.end
End Function
Function DeleteCard()
dim strSQL
strSQL = "delete from T_Expendable where ID = " & ToSQL(iCardID, "Number")
call ExecuteSQL(dbLocal, strSQL)
Response.Redirect "cardlist.asp"
Response.end
End Function
Function PassCard()
dim strSQL, sSigner, iSigner
strSQL = "update T_Expendable set Status = '已经发放' where ID = " & ToSQL(iCardID, "Number")
call ExecuteSQL(dbLocal, strSQL)
sSigner = DLookUp(dbLocal, "T_Expendable", "Signer", "ID=" & iCardID)
iSigner = DLookUp(dbLocal, "T_Employee", "Serial", "Name='" & sSigner & "'")
call CommonSendMsg(MSG_APPROVE,"","审批通过并发放:低值易耗品","你提交的低值易耗品卡片已获批准并发放!",GetOfficer(),iSigner)
Response.Redirect "cardlist.asp"
Response.end
End Function
Function BackCard()
dim strSQL, sSigner, iSigner
strSQL = "update T_Expendable set Status = '不通过!' where ID = " & ToSQL(iCardID, "Number")
call ExecuteSQL(dbLocal, strSQL)
sSigner = DLookUp(dbLocal, "T_Expendable", "Signer", "ID=" & iCardID)
iSigner = DLookUp(dbLocal, "T_Employee", "Serial", "Name='" & sSigner & "'")
call CommonSendMsg(MSG_APPROVE,"","审批未通过:低值易耗品","对不起,你提交的低值易耗品卡片未获批准!",GetOfficer(),iSigner)
Response.Redirect "cardlist.asp"
Response.end
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -