<!--#include file="../inc/conn2.asp"-->
<!--#include file="../inc/Thumbnail.asp" -->
<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script charset="utf-8" src="../inc/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="../inc/kindeditor/lang/zh_CN.js"></script>
<script language="javascript" src="eims.js"></script>
<link rel="stylesheet" href="../inc/kindeditor/themes/default/default.css" />
<script language="javascript" type="text/javascript" src="../inc/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="eims.css">
<title>eims config</title>
</head>
<body>
<%
Const PageShow = 7     '页码显示
Const InputSize = 45   '表单大小
Const pagenum = 20     '分页大小
'------------------------------------------------
Dim action,ItemID,SortID,BoxID
eims = Trim(Request("eims"))
eType = Trim(Request("eType"))
ItemID = Int(Request("ItemID"))
SortID = Int(Request("SortID"))
action = Trim(Request("action"))
TypeID=Int(request("TypeID"))

eTable = Prefix&eims
ListUrl = eims&"List.asp?eims="&eims
EditUrl = eims&"Edit.asp?eims="&eims

'-----删除数据
If Trim(Request("submit"))="删除" Then
Mgt("admin") 'Cookies : Permission
if Trim(Request("BoxID"))="" then WtMsg("没有选择数据")
if Trim(Request("del"))="yes" then
Conn.Execute "delete from ["&eTable&"] where ItemID in ("&Trim(Request("BoxID"))&")" '直接删除
else
Conn.Execute "update ["&eTable&"] set ItemRec=0 where ItemID in ("&Trim(Request("BoxID"))&")" '放入回收站
end if
End If

'-----更改状态 - 显示/隐藏/移动
If Trim(Request("submit"))="显示" Then Conn.Execute "update ["&eTable&"] set ItemRec=1 where ItemID in ("&Trim(Request("BoxID"))&")"
If Trim(Request("submit"))="隐藏" Then Conn.Execute "update ["&eTable&"] set ItemRec=0 where ItemID in ("&Trim(Request("BoxID"))&")"
If Trim(Request("submit"))="移动" Then Conn.Execute "update ["&eTable&"] set SortID="&SortID&" where ItemID in ("&Trim(Request("BoxID"))&")"

'================================================
'CurrentPage 当前页码
'totalnumber 总记录数
'maxperpage  每页显示记录数
'filename    脚本文件名
'================================================
Function showpage(CurrentPage,totalnumber,maxperpage,filename)
Dim n '最大页数  
If totalnumber Mod maxperpage=0 Then  
    n= totalnumber \ maxperpage  
Else
    n= totalnumber \ maxperpage+1  
End If
If CurrentPage<=1 Then  
    Response.Write "<span>首 页</span> <span>上一页</span>"  
Else  
    Response.Write "<span><a href="&filename&"&page=1>首 页</a></span>"  
    Response.Write "<span><a href="&filename&"&page="&CurrentPage-1&">上一页</a></span>"  
End If
If currentpage>=n Then  
    Response.Write "<span>下一页</span> <span>末 页</span>"  
Else  
    Response.Write "<span><a href="&filename&"&page="&(CurrentPage+1)&">下一页</a></span>"  
	Response.Write "<span><a href="&filename&"&page="&n&">末 页</a></span>"  
End If  
    Response.Write " 页次："&CurrentPage&"/"&n&"页 "  
    Response.Write " 共有"&totalnumber&"条记录 " 
    Response.Write "转到：<input type='text' name='page' size=2 maxlength=10 value="&currentpage&">"  
    Response.Write "&nbsp;<input type='button' value='跳转' onclick=""location.href='"&filename&"&page='+document.all('page').value;"">"  
End Function

'================================================
'读取分类
'================================================
sti=0
Function ListSort(fParentID)
Set xRs=Server.CreateObject("Adodb.RecordSet")
xRs.Open "Select * From ["&Prefix&eims&"Sort] Where ParentID="&int(fParentID)&" Order By SortSeq",Conn,1,1
While Not xRs.Eof
selected = ""
If Int(SortID) = Int(xRs("ItemID")) Then selected = "selected"
If fParentID=0 Then
Response.Write "<option value='"&Int(xRs("ItemID"))&"' "&selected&">"&Trim(xRs("SortName"))&"</option>"&VBCrlf  
Else
	tstr = ""
	For ii=1 To sti*3
	tstr = tstr&"&nbsp;&nbsp;"
	Next
Response.Write "<option value='"&Int(xRs("ItemID"))&"' "&selected&">"&tstr&"├ "&Trim(xRs("SortName"))&"</option>"&VBCrlf  
End If
sti=sti+1
	ListSort(xRs("ItemID"))
sti=sti-1
	xRs.MoveNext
	wend
xRs.close
Set xRs = Nothing
End Function

'================================================
'自动压缩图片
'================================================
if Int(Request.Form("Thumbnail"))=1 then
Photo=Trim(Request.Form("Photo"))
PhotoArr=split(Photo,"/")
PhotoNum=ubound(PhotoArr)
s_OriginalPath=Photo
s_BuildBasePath=replace(Photo,PhotoArr(PhotoNum),"")
BuildSmallPic s_OriginalPath, s_BuildBasePath, pmWidth, pmHeight
end if

'用户类型
function UserRank(fUserType)
select case Int(fUserType)
case 1 UserRank="后台管理"
case 2 UserRank="特别用户"
case 3 UserRank="前台注册"
case else UserRank="匿名用户"
end select
end function
%>
<!--#include file="cookies.asp"-->