<% Set ST = New SelectTable if v_year = "" then intThisYear = Year(now) else intThisYear = v_year End if if v_month = "" then intThisMonth = Right( "0" & Month(now), 2 ) else intThisMonth = Right( "0" & v_month, 2 ) End if intThisMonth2 = intThisMonth '//1~9숫자 앞에 0붙이기 gday = Right("0"&Day(now), 2) '//오늘날짜 datFirstDay = Weekday( DateSerial( intThisYear, intThisMonth, 1 ) ) '//요일 구하기 (num) intLastDay = Day( DateSerial( intThisYear, intThisMonth+1, 1-1 ) ) '//마지막날 구하기 jucnt = Round( ( ( datFirstDay + intLastDay) / 7 ) + 0.5, 0 ) 'response.write jucnt '// 이전, 다음 만들기 If CInt( intThisMonth ) = 1 Then prevYear = intThisYear - 1 Else prevYear = intThisYear End if If CInt( intThisMonth ) = 1 Then prevMonth = 12 Else prevMonth = CInt(intThisMonth) - 1 End if If intThisMonth = 12 Then nextYear = intThisYear + 1 Else nextYear = intThisYear End if If intThisMonth = 12 Then nextMonth = 1 Else nextMonth = intThisMonth + 1 End if %>
<% 'cal = CInt(a_width) / 7 day1 = (-1 * datFirstDay)+2 '//날수1 For ju = 1 to jucnt '//주간 7개 돌리공.. %> <% for i = 1 to 7 '//글자색 Select Case i Case 1 : tcolor="sun" Case 7 : tcolor="sat" Case Else tcolor = "" End select '//날짜계산 If day1 > 0 and day1 <= intLastDay then cday = day1 else cday = "" End If day_class = "" If cday <> "" Then thisdate = dateserial(intThisYear, intThisMonth, cday) If Date() = thisdate Then day_class = "today " 'sch_on cday = "TODAY" End If cnt = todaySchedule( thisdate ) If cnt <> "0" Then day_class = day_class & "sch_on" End if End If %> <% day1 = day1 + 1 next %> <%next%>
<%=cday%>
<% function todaySchedule( thisdate ) Dim ST Dim sql, cnt Set ST = New SelectTable where_query = " where b_sdate <= '" & thisdate & "' AND b_edate >='" & thisdate & "' and b_id = '" & SESSION("ss_m_id") & "' " sql = "select count(*) as cnt from " & tablename & where_query cnt = ST.selectQueryColumn( sql ) todaySchedule = cnt End function %>