📄 sheet_mgr.inc
字号:
<%
Function TableTop()
TableTop = _
"<table cellspacing=0 cellpadding=0 width=""100%"" align=center style=""table-layout:fixed;border-style:solid;border-color:black;border-width:1px;"">" & vbLF & _
"<tr bgcolor=white height=25 style=""font-size:10pt;font-weight:800;"">" & _
"<td colspan=8 style=""color:red;"" align=center>下列显示的各清单编号,红色为等待完成,绿色为需要处理的,蓝色为已完成!</td></tr>" & _
"</table>"
End Function
'*******************************************************************************
Function TableHeader()
TableHeader = _
"<table cellspacing=0 cellpadding=0 width=""100%"" align=center style=""table-layout:fixed;border-style:solid;border-color:black;border-width:1px;"">" & vbLF & _
"<tr style=""display:none"">" & vbLF & _
" <td width=75>这一行仅用于控制表格的宽度</td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td>" & vbLF & _
" <td width=75></td></tr>" & vbLF
End Function
'*******************************************************************************
Function TableRecords1(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
dim sTemp : sTemp = "" ' 临时字符串变量
dim j, i ' 临时循环变量
dim sql
'------------------------------------
' 分页所需的变量定义
'------------------------------------
Dim iCounter : iCounter = 1
Dim iPrevPage, iNextPage
Dim rowCount : rowCount = 0
'------------------------------------
' 获取数据库连接
'------------------------------------
dim rs : set rs = Openrs(conn,sSQL)
dim sSheetID
dim sOptype,pOptype,sUrl,sSheetStatus
''response.write sSQL : response.end
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.move (iCurrentPage - 1) * iRecordsPerPage * iCols
end if
for j = 1 to iRecordsPerPage step 1
sTemp = sTemp & "<tr bgcolor=white height=30>"
for i = 1 to iCols
if Not rs.EOF then
sSheetID = rs("sheet_id")
pOptype = rs("optype")
sSheetStatus = rs("sheet_status")
sql = "select type_desc from t_op_type where type_id =" & pOptype
sOpType = DLookUp(conn,sql)
'response.write sOpType : response.end
if hasright(ID_STOCK) < RIGHT_WRITE then
select case pOpType
case "1" '' 入库
sUrl = "sheet_purchase_in.asp"
case "2" '' 移入
sUrl = "sheet_handover.asp"
case "3" '' 归还
sUrl = "sheet_borrow.asp"
case "4" '' 领用
sUrl = "sheet_item.asp"
case "5" '' 退货
sUrl = "sheet_return.asp"
case "6" '' 报废
sUrl = "sheet_discard.asp"
case "7" '' 移出
sUrl = "sheet_handover.asp"
case "8" '' 借出
sUrl = "sheet_borrow.asp"
end select
sTemp = sTemp & "<td title=""点击可以察看“" & sSheetID & "”的信息"" style=""cursor:hand;color:blue;"" onclick=""javascript:location.href='" & sUrl & "?sheet_id=" & sSheetID & "';"" nowrap> " & sOpType & "单_" & sSheetID & "</td>"
else
if sSheetStatus = 1 then
select case pOpType
case "1" '' 入库
sUrl = "sheet_purchase_in.asp"
case "2" '' 移入
sUrl = "sheet_handover.asp"
case "3" '' 归还
sUrl = "sheet_borrow.asp"
case "4" '' 领用
sUrl = "sheet_item.asp"
case "5" '' 退货
sUrl = "sheet_return.asp"
case "6" '' 报废
sUrl = "sheet_discard.asp"
case "7" '' 移出
sUrl = "sheet_handover.asp"
case "8" '' 借出
sUrl = "sheet_borrow.asp"
end select
sTemp = sTemp & "<td title=""点击可以察看“" & sSheetID & "”的信息"" style=""cursor:hand;color:blue;"" onclick=""javascript:location.href='" & sUrl & "?sheet_id=" & sSheetID & "';"" nowrap> " & sOpType & "单_" & sSheetID & "</td>"
else
select case pOpType
case "1" '' 入库
sUrl = "purchase_input_over.asp"
case "2" '' 移入
sUrl = "handover_output_detail.asp"
case "3" '' 归还
sUrl = "sheet_borrow.asp"
case "4" '' 领用
sUrl = "item_output_over.asp"
case "5" '' 退货
sUrl = "return_output_over.asp"
case "6" '' 报废
sUrl = "discard_output_over.asp"
case "7" '' 移出
sUrl = "handover_output_over.asp"
case "8" '' 借出
if sSheetStatus = 0 then
sUrl = "borrow_output_over.asp"
else
sUrl = "borrow_input.asp"
end if
end select
if sSheetStatus = 2 then
sTemp = sTemp & "<td title=""点击可以察看“" & sSheetID & "”的信息"" style=""cursor:hand;color:green;"" onclick=""javascript:location.href='" & sUrl & "?sheet_id=" & sSheetID & "';"" nowrap> " & sOpType & "单_" & sSheetID & "</td>"
else
sTemp = sTemp & "<td title=""点击可以察看“" & sSheetID & "”的信息"" style=""cursor:hand;color:red;"" onclick=""javascript:location.href='" & sUrl & "?sheet_id=" & sSheetID & "';"" nowrap> " & sOpType & "单_" & sSheetID & "</td>"
end if
end if
end if
rs.movenext
else
sTemp = sTemp & "<td class=tdlist> </td>"
end if
next
sTemp = sTemp & "</tr>"
iCounter = iCounter + 1
next
rs.Close()
set rs = nothing
' 首页、前页、后页、尾页等分页信息
sTemp = sTemp & "<tr bgcolor=white height=20><td colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr>"
TableRecords1 = _
sTemp & _
"</table>"
End Function
'*******************************************************************************
function TableAction()
dim sTemp : sTemp = ""
' if IsHrAdmin then '' 只有人事管理员才显示管理的链接
' sTemp = _
' " " & vbLF & _
' " <a style=""color:blue"" href=""emp_oe.asp?emp_serial=" & pEmpSerial & """><img border=0 src=""../images/edit.gif""> 修改员工信息</a>" & vbLF & _
' " " & vbLF & _
' " <a style=""color:blue"" href=""emp_od.asp?emp_serial=" & pEmpSerial & """><img border=0 src=""images/dismiss.gif""> 员工离职</a>" & vbLF
' end if
TableAction = _
"<table width=600 cellspacing=0 cellpadding=5 height=30 align=center>" & vbLF & _
" <tr>" & vbLF & _
" <td align=center>" & _
" <a style=""color:blue"" target=_blank href=""sheet_mgr.asp?sheet_id=" & pSheetID & "&forprint=1""><img border=0 src=""../images/edit.gif""> 察看打印版</a>" & vbLF & _
" " & vbLF & _
" <a style=""color:blue"" href=""sheet_mgr.asp""><img border=0 src=""../images/property.gif""> 出入库单管理</a>" & vbLF & _
sTemp & vbLF & _
"</td>" & vbLF & _
" </tr>" & vbLF & _
"</table>"
end function
'*******************************************************************************
function TableAction()
dim sTemp : sTemp = ""
' if IsHrAdmin then '' 只有人事管理员才显示管理的链接
' sTemp = _
' " " & vbLF & _
' " <a style=""color:blue"" href=""emp_oe.asp?emp_serial=" & pEmpSerial & """><img border=0 src=""../images/edit.gif""> 修改员工信息</a>" & vbLF & _
' " " & vbLF & _
' " <a style=""color:blue"" href=""emp_od.asp?emp_serial=" & pEmpSerial & """><img border=0 src=""images/dismiss.gif""> 员工离职</a>" & vbLF
' end if
TableAction = _
"<table width=600 cellspacing=0 cellpadding=5 height=30 align=center>" & vbLF & _
" <tr>" & vbLF & _
" <td align=center>" & _
" <a style=""color:blue"" href=""sheet_stock.asp""><img border=0 src=""../images/arrowr.gif""> 库存明细</a>" & vbLF & _
" <a style=""color:blue"" href=""sheet_goods.asp""><img border=0 src=""../images/arrowr.gif""> 仓库报表</a>" & vbLF & _
sTemp & vbLF & _
"</td>" & vbLF & _
" </tr>" & vbLF & _
"</table>"
end function
'*******************************************************************************
Function TableLink()
dim sTemp : sTemp = ""
if hasright(ID_STOCK) < RIGHT_WRITE then
sTemp = _
"<table width=""100%"" cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_query.asp"">库存查询</a>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
else
sTemp = _
"<table width=""100%"" cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_query.asp"">库存查询</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_input.asp"">物品入库</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/output.asp"">物品出库</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_move.asp"">物品移动</a></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
end if
TableLink = sTemp
End Function
'*******************************************************************************
Sub PrepareData(conn, sql, sSortFields, sDelimiter)
dim sSQL : sSQL = sql
dim arrayFields
dim bFlag, i
'--------------------------------------
' 获取总的记录数,以便分页
'--------------------------------------
iTotalRecords = TotalRecords(conn, sSQL)
if iTotalRecords = 0 then
' 一条记录都找不到
end if
'--------------------------------------
' 计算总页数,当前页码
'--------------------------------------
if iTotalRecords mod (iRecordsPerPage * iCols) = 0 then
iTotalPages = int(iTotalRecords / (iRecordsPerPage * iCols))
else
iTotalPages = int(iTotalRecords / (iRecordsPerPage * iCols))+ 1
end if
if iTotalPages = 0 then iTotalPages = 1
iCurrentPage = GetParam("Page")
if IsEmpty(iCurrentPage) then
iCurrentPage = 1
end if
if Not isNumeric(iCurrentPage) then
iCurrentPage = 1
end if
iCurrentPage = CLng(iCurrentPage) ' 转化成整数再与iTotalPages比较,否则就是比较出来的结果是不正确的
if iCurrentPage > iTotalPages then
iCurrentPage = iTotalPages
end if
'--------------------------------------
' 排序列、排序方向、排序参数
'--------------------------------------
arrayFields = Split(sSortFields, sDelimiter) '' 分隔排序字段
bFlag = false
for i = LBound(arrayFields) to UBound(arrayFields)
if sSorting = arrayFields(i) then
bFlag = true '' 标志找到了匹配的排序字段
exit for
end if
next
if IsEmpty(sSorting) then
sSorting = ""
elseif bFlag = false then
sSorting = "" '' 如果没有找到匹配的排序字段,则不排序
else
if sSorting = sSorted then ' 这一列是上次排序的列,则将iSorted的值置空""(降序排列),否则置iSort的值(升序排列)
sDirection = " desc"
sSortParams = "Sorting=" & sSorting & "&Sorted=" & sSorted & "&"
sSorted = ""
else
sDirection = " asc"
sSortParams = "Sorting=" & sSorting & "&Sorted=" & "&"
sSorted = sSorting
end if
end if
if sSorting <> "" then
sOrderby = " order by " & sSorting & sDirection
end if
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -