<%
'-------------------------------------------------
'描述: 错误信息提示
'-------------------------------------------------
Function Alert(message,gourl) 
    message = replace(message,"'","\'")
    If gourl="-1" then
        Response.Write ("<script language=javascript>alert('" & message & "');history.go(-1)</script>")
    ElseIf gourl="-2" then
        Response.Write ("<script language=javascript>alert('" & message & "');history.go(-2)</script>")
    ElseIf gourl="-3" then
        Response.Write ("<script language=javascript>alert('" & message & "');window.close();</script>")
    Else
        Response.Write ("<script language=javascript>alert('" & message & "');location='" & gourl &"'</script>")
    End If
    Response.End()
End Function
'-------------------------------------------------
Function backurl(goourl) 
    If goourl="-1" then
        Response.Write ("<script language=javascript>history.go(-1)</script>")
    ElseIf goourl="-2" then
        Response.Write ("<script language=javascript>history.go(-2)</script>")
    Else
        Response.Write ("<script language=javascript>location='" & goourl &"'</script>")
    End If
    Response.End()
End Function
'-----------------------------------------
'描述: 时间格式转换
'-----------------------------------------
Function GetCount2(i)
   GetCount2 = Replace(Space(2-Len(i)), " ", "0") & i
End Function
Function FormatTime(DateTime,Format) 
  select case Format
	case "1"
    FormatTime=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日"
	case "2"
    FormatTime=""&month(DateTime)&"月"&day(DateTime)&"日"
	case "3" 
    FormatTime=""&year(DateTime)&"-"&month(DateTime)&"-"&day(DateTime)&""
	case "4"
    FormatTime=""&month(DateTime)&"-"&day(DateTime)&""
case Else
FormatTime=DateTime
end select
End Function
'=================================================
'分页函数PageNum(每页显示条数),PageClose(关闭数据),PageUrl(翻页)
'=================================================
Sub PageNum(nber)
	'oRs.open sSql,oconn,1,1
	'if oRs.bof and oRs.eof Then
	'response.write "暂无数据..."
	'Else
	page = request("page")						'page的传递参数
	total=oRs.recordcount 						'读取信息数目
	oRs.PageSize=nber							'设置页码 
	pagecount=oRs.PageCount 					'获取总页码 
	page=int(page)								'接收页码 
	if page<=0 then page=1						'判断页码
	oRs.AbsolutePage=page 						'本页页码
	mypage = total-(page-1)*oRs.PageSize
	If mypage > oRs.PageSize Then
	mypage = oRs.PageSize
	Else
	mypage = total-(page-1)*oRs.PageSize
	End If
	'for i=1 to mypage
End Sub
'=================================================
Sub PageUrl(purl,nber)
	response.write "<table border=""0"" cellspacing=""5"" cellpadding=""5"" width=""100%"" id=""pages""><tr><td align=""center"">"
	response.write "共<font color='red'>"&total&"</font>条  分<font color='red'>"&pagecount&"</font>页  每页<font color='red'>"&nber&"</font>条  第<font color='red'>"&page&"</font>页  "
	if page=1 and not page=pagecount then
	response.write "首页  上页  <a href='"&purl&"&page="&page+1&"'>下页</a>  <a href='"&purl&"&page="&pagecount&"'>末页</a>"
	elseif page<>1 and not page=pagcount then
	response.write"<a href='"&purl&"&page=1'>首页</a>  <a href='"&purl&"&page="&page-1&"'>上页</a>"
		If page=pagecount Then
		response.write"下页 末页"
		Else
		response.write"<a href='"&purl&"&page="&page+1&"'>下页</a>  <a href='"&purl&"&page="&pagecount&"'>末页</a>"
		End If
	End If
	response.write"</td></tr></table>"
End Sub
'=================================================
'会员姓名
'=================================================
Function USERNAME(aaa)
If aaa ="" Then
	Response.Write "--"
else
	Dim oRsme,sqlme
	sqlme= "Select TOP 1 Id,UserName FROM [Lstuser] where Id= "&aaa
	Set oRsme= Server.CreateObject("ADODB.Recordset")
	oRsme.open sqlme,oconn,1,1
	if oRsme.eof and oRsme.bof Then
		Response.Write "--"
	Else
		Response.write ""&oRsme(1)&""
	End if
	oRsme.close
	set oRsme=Nothing
End If
end Function
'=================================================
'线路名称
'=================================================
Function NEWSNAME(aaa)
If aaa ="" Then
Response.Write "所有分类"
else
	Dim oRsme,sqlme
	sqlme= "Select TOP 1 Id,PTitle FROM [LstNewsInfo] where Id= "&aaa
	Set oRsme= Server.CreateObject("ADODB.Recordset")
	oRsme.open sqlme,oconn,1,1
	if oRsme.eof and oRsme.bof Then
		Response.Write "无此分类"
	Else
		Response.write ""&oRsme(1)&""
	End if
	oRsme.close
	set oRsme=Nothing
End If
end Function

%>
