<!--#include file="conn.asp"-->
<!--#include file="CALENDARi.ASP"--><head>
</head>
<table width="29%" background="images/Diary_02_02.gif" cellspacing cellpadding>
  <tr>
    <td width="100%">

<link href="images/css.css" rel="stylesheet" type="text/css">

<DIV align=center>
<CENTER>
<FORM NAME="fmNextPrev" ACTION="calendar.asp" METHOD=POST>
    <TABLE WIDTH="270" BORDER=0 CELLPADDING=1 CELLSPACING=0 >
      <TR VALIGN=MIDDLE ALIGN=CENTER> 
        <TD COLSPAN=7 bgcolor="#efefef"> <TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%" BORDER=0>
            <TR VALIGN=MIDDLE ALIGN=CENTER> 
               <TD WIDTH="30%" ALIGN=RIGHT> <INPUT TYPE=submit NAME="subPrev" value="上月"> 
              </TD>
              <TD WIDTH="40%"> <FONT FACE="arial"  size=2><b> <%= Year(dtCurViewMonth)& "年" & MonthName(Month(dtCurViewMonth))%></B> 
                </FONT> </TD>
              <TD WIDTH="26%" ALIGN=LEFT> <INPUT TYPE=submit NAME="subNext" value="下月"> 
              </TD>
              <TD WIDTH="4%" ALIGN=LEFT>&nbsp; </TD>
            </TR>
          </TABLE></TD>
      </TR>
      <TR VALIGN=TOP ALIGN=CENTER BGCOLOR="#efefef"> 
        <%iday = Array( "日", "一", "二", "三","四","五","六") 
        For i = 0 To UBound(iday) 
        %>
     
        <TH WIDTH="5%" ><%=iday(i)%></TH>
        <%Next %>
      </TR>
      <%
   dtCurViewDay = DtPrevSunday(dtCurViewMonth)
  
   For iWeek = 0 To 5
      Response.Write "<TR VALIGN=TOP>" & vbCrLf

      For iDay = 0 To 6
         Response.Write "<TD HEIGHT=25 ALIGN=CENTER>"

         If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
            If dtCurViewDay = dtToday Then
               fontColor = "#660000"

            Else
               fontColor = "#996666"
            End If

         '---- Write day of month

         
            Response.Write Day(dtCurViewDay) & "</a></FONT>"



  
       rs.MoveFirst	
       While Not rs.EOF	' 判断是否过了最后一项
       
	happy=rs(5)
	If day(dtCurViewDay)=day(rs("diary"))and month(dtCurViewmonth)=month(rs("diary"))and year(dtCurViewmonth)=year(rs("diary"))Then
       
       For i=0 to rs.Fields.Count-1
       Next
       
       
            Response.Write " <a href='benri.asp?n="
            Response.Write Year(dtCurViewMonth)
            Response.Write "&y="
            Response.Write Month(dtCurViewMonth)
            Response.Write "&r="
            Response.Write Day(dtCurViewDay)
            Response.Write "' target=content title='查看本日的日记'>"
            Response.Write "<img VALIGN=TOP src=images/icon/"
            Response.Write happy
            Response.Write ".gif border=0></a><BR>"

end if
rs.MoveNext	' 移到下一项
       Wend  
         '---Else
            '---Response.Write "?
         end if

         Response.Write "</TD>" & vbCrLf
         dtCurViewDay = DateAdd("d", 1, dtCurViewDay)
      Next
      Response.Write "</TR>" & vbCrLf
   Next



%>
      <%REM --------END OF DRAW CALENDAR SECTION-------- %>
    </TABLE>



   
      <br>
<input type="hidden" Name="CURDATE" Value="<%=dtCurViewMonth%>">
      <%     
	conn.close
	set rs=nothing
%>
    </FORM>
    </CENTER>
</DIV> 
      <p>　</td>
  </tr>
</table>
