
<%
sub birthday()
	dim sql,rs,ntime,ntime1

        ntime1=split(date,"-")
        if len(ntime1(1))<2 then
           ntime1(1)="0"&ntime1(1)
        end if
        if len(ntime1(2))<2 then
           ntime1(2)="0"&ntime1(2)
        end if
        ntime=ntime1(1)&ntime1(2)
        ntime=cstr(ntime)
        sql="select username,messageflag from LeadBBS_user where mid(Birthday,5,4)='"&ntime&"' and username<>'无名' order by id asc" 	
        set rs=Server.CreateObject("ADODB.RecordSet")
        rs.open sql,con,1,3
        dim totaluser
            totaluser=rs.recordcount

%>
<br>
<% If GBL_TableHeadString <> "" Then %>
<table width=100% border=0 cellspacing=0 cellpadding=0 align=center>
  <tr>
    <td><%=GBL_TableHeadString%></td>
  </tr>
</table>
<% End If %>
<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=5 align=center bgcolor=<%= DEF_BBS_DarkColor %> class=TBone>
      <tr bgcolor=<%=DEF_BBS_LightDarkColor%> >
         <td class=TBHead colSpan=4><img src=images/blank.gif width=2 height=3 colspan=16><br><b><font color=ffffff class=HeadFont>今日蜕变生日社民名单</font></b> </td>
      </tr>
      <tr bgcolor=<%=DEF_BBS_LightColor%> align=left class=TBBG9>
         <td>
<%
        if rs.eof or rs.bof then
	   response.write "" 
	else
           dim c
	       c=0
	   do while not rs.eof
          '发送短信祝贺
           dim fromuser,touser,title,sql2,rs2,content
           fromuser=DEF_SiteNameString
           touser=rs(0)
           Title=DEF_SiteNameString&"祝生日快乐"
           Content="蜕变携全体社民祝愿"& rs(0) &"生日快乐！开心每一天 ^o^"
           sql2="select * from LeadBBS_InfoBox where title='"&Title&"' and touser='"&touser&"' and left(sendtime,4)='"&left(date(),4)&"' "
           set rs2=Server.CreateObject("ADODB.RecordSet")
           rs2.open sql2,con,1,3
           if rs2.eof or rs2.bof then
              rs2.addnew
              rs2("FromUser")=FromUser
              rs2("ToUser")=ToUser
              rs2("Title")=Title
              rs2("Content")=Content
              rs2("IP")=GBL_IPAddress
              rs2("SendTime")=GetTimeValue(now)
              rs2("ReadFlag")=0
              rs2.update
           end if
	   response.write"<font color=#ffffff><b>■</b></font> <a href=User/LookUserInfo.asp?name="&rs(0)&" target=_blank title=""查看该用户的个人资料"">"&rs(0)&"</a>&nbsp;&nbsp;"
           if rs2("ReadFlag")=0 then
              rs("messageflag")=1
              rs.update
           end if
           rs.movenext
           c=c+1
           if c mod 5=0 then response.write"<br>"
	   loop
           rs2.close
           set rs2=nothing
	end if
        
        rs.close
        set rs=nothing
%>
          </td>
        </tr>
        
</table>
 <% If GBL_TableBottomString <> "" Then %><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><% End If %><br>
<%
end sub

%>