asp实现的可以提醒生日的几种方法附代码(2)
%>
方法二:
<%
days1=split(date(),"-")
days2=split(DateAdd("d",5,date()),"-")
sql="select [id],Memberid,birthday from customers "
if days1(1)<>days2(1) then
sql=sql+" where (month(birthday) = '"&days1(1)&"' or month(birthday)='"&days2(1)&"')"
else
sql=sql+" where month(birthday) = '"&days1(1)&"'"
end if
sql=sql+" and day(birthday) between '"&days1(2)&"' and '"&days2(2)&"'"
'Response.Write(sql)
set conn=server.CreateObject("ADODB.connection")
conn.open connstr
set rs=Conn.execute(sql)
if not rs.eof then%>
<script language="JavaScript">
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用(asilas添加)
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
if(i>500) closeDiv()
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
内容版权声明:除非注明,否则皆为本站原创文章。