혼자서 끙끙대다가 하루종일 막혀서...
<%@ language=vbscript %>
<% Option Explicit %>
<%
dim connDB
Set connDB = server.createobject("adodb.connection")
connDB.open = "dsn=ora92; uid=s2003037520; pwd=s2003037520;"
if connDB.state=1 then
response.write "성공"
else
response.write "실패"
end if
dim now_year, now_month, now_day, months, days, now_week_day
dim first_day, dates, first_day_flag, today, hday
dim day_title, day_color, day_bg_color, bg_color, day_font_color, holiday(13, 32)
dim i, j, k
dim pre_button, next_button, get_path_info
dim pre_year, pre_month, next_year, next_month, pre_week, next_week, show_pre, show_next
dim new_plan_button, del_plan_button, show_plan_button, button_flag
get_path_info = request.servervariables("PATH_INFO")
days = Array("0", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
months = Array("0", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
bg_color = Array("0", "ffaaaa", "99aa88", "99aa88", "99aa88", "99aa88", "99aa88", "c4daff")
day_font_color = Array("0", "red", "black", "black", "black", "black", "black", "blue")
holiday(1,1) = "신정"
holiday(3,1) = "삼일절"
holiday(5,5) = "어린이날"
holiday(6,6) = "현충일"
holiday(8,15) = "광복절"
holiday(10,3) = "개천절"
holiday(12,25) = "성탄절"
now_year = request("y")
now_month = request("m")
now_day = request("d")
if now_year="" and now_month="" then
now_week_day = Weekday(now)
now_year = Year(now)
now_month = Month(now)
now_day = Day(now)
end if
first_day = WeekDay(DateSerial(now_year, now_month, 1))-1
if now_year mod 4 <> 0 then
dates = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
else
dates = Array(0, 31, 29, 31, 30, 31, 30 ,31, 31, 30, 31, 30 ,31)
end if
pre_year = now_year
pre_month = now_month - 1
next_year = now_year
next_month = now_month + 1
show_pre = pre_month&"월"
show_next = next_month&"월"
if now_month = 1 then
pre_year = now_year - 1
pre_month = 12
show_pre = pre_year&"년 "&pre_month&"월"
end if
if now_month = 12 then
next_year = now_year + 1
next_month = 1
show_next = next_year&"년 "&next_month&"월"
end if
%>
<html>
<head><title> 일정관리 </title></head>
<body bgcolor="#FFFFFF" text="#000000 vlink="blue">
<style type="text/css">
a:link { text-decoration: none; color: #666666; }
a:visited { text-decoration: none; color: #666666; }
a:hover { text-decoration: none; color:#000000; }
</style>
<form method="post" action="calendar.asp">
<table border="2" cellpadding="0" celldpacing="0" align="center">
<tr>
<td width="150" align="center"><b><%=now_year%>-<%=months(now_month)%></b></td>
</tr>
</table>
<table border="2" cellpadding="0" cellspacing="0" align="center">
<tr align="center">
<%
for i=1 to 7
%>
<td width="100" align="center" height="30" bgcolor="<%=bg_color(i)%>"><font color="<%=day_font_color(i)%>"><b><%=days(i)%></b></font></td>
<%
next
%>
</tr>
</table>
<%
new_plan_button = "<span style='font-size:15px'> new </span>"
del_plan_button = "<span style='font-size:15px'> del </span>"
show_plan_button = "<span style='font-size:15px'> show </span>"
%>
<table border="2" cellpadding="0" cellspacing="0" align="center">
<tr bgcolor="ffffff">
<%
j = 1
k = 1
for i = 1 to dates(now_month)
do while k <= 7
if first_day+1 = j then
first_day_flag = 1
end if
if first_day_flag = 1 then
hday = ""
today = i
if i = CInt(now_day) then
today = "<b>" & i & "</b>"
end if
if j mod 7 = 1 or holiday(now_month, i) <> "" then
hday = holiday(now_month, i)
today = "<font color='red'>" & today & "</font>"
elseif j mod 7 = 0 then
today = "<font color='blue'>" & today & "</font>"
end if
%>
<td width="100" valign="top" onMouseOver="this.style.background='efffef'" onMouseOut="this.style.background='ffffff'" height="300">
<%=today%><span style="font-size:13px;font-family:궁서"><b><%=hday%></b></span><br><br><br><br><br>
<b><a href="<%=get_path_info%>"><span style="font-size:11px"><%=new_plan_button%></span></a>
<br><a href="<%=get_path_info%>"><span style="font-size:11px"><%=del_plan_button%></span></a>
<br><a href="<%=get_path_info%>"><span style="font-size:11px"><%=show_plan_button%></span></a>
<br><br><br><br><br><br><font size="2" font color="blue"><b>plans</b></font></td>
<%
i = i + 1
else
%>
<td width="100" align="center" height="300" bgcolor="ffffff" valign="middle"><font size="2" font color="green"><b>not<br>this<br>month</b></font></td>
<%
end if
k = k + 1
j = j + 1
loop
next
Do Until j Mod 7 = 1
%>
<td> </td>
<%
j = j + 1
Loop
%>
</tr>
</table>
<%
pre_button = "<span style='font-size:10px'> << </span>"
next_button = "<span style='font-size:10px'> >> </span>"
%>
<table width="700" border="2" align="center" cellspacing="0" cellpadding="0" style="margin-top:2">
<tr>
<td align="center" width="700" style="border:0 0 0 0">
<b><a href="<%=get_path_info%>?y=<%=now_year%>&m=<%=now_month%>&d=<%=now_day-7%>"><span style="font-size:11px"><%=pre_button%></span></a>
<a href="<%=get_path_info%>">Week</a>
<a href="<%=get_path_info%>?y=<%=now_year%>&m=<%=now_month%>&d=<%=now_day+7%>"><span style="font-size:11px"><%=next_button%></span></a>
<br><a href="<%=get_path_info%>?y=<%=pre_year%>&m=<%=pre_month%>"><span style="font-size:11px"><%=pre_button%></span></a>
<a href="<%=get_path_info%>">Month</a>
<a href="<%=get_path_info%>?y=<%=next_year%>&m=<%=next_month%>"><span style="font-size:11px"><%=next_button%></span></a>
<br><a href="<%=get_path_info%>?y=<%=now_year-1%>&m=<%=now_month%>"><span style="font-size:11px"><%=pre_button%></span></a>
<a href="<%=get_path_info%>">Year</a>
<a href="<%=get_path_info%>?y=<%=now_year+1%>&m=<%=now_month%>"><span style="font-size:11px"><%=next_button%></span></a>
</td>
</tr>
</table>
</html>
실행해 보시면 아시겠지만 일주일씩 나타내려고 하는데요...next_week을 클릭하면 그 다음주가 나와야 되는데 안되네요..
좀 도와주세요 고수님들..ㅡㅜ
제가 asp 개발환경셋팅이 안되어 있어서 일일이 코드 보고 분석하기..좀 그러네요... 죄송;;;;