Files
sms_host20170829/common/calendar/date_new.asp
T
2026-02-23 10:01:00 +09:00

185 lines
4.6 KiB
Plaintext

<!--#include virtual="/include/lib/dbcon.asp"-->
<!--#include virtual="/include/function/default_func.asp"-->
<%
tmonth = request("tmonth")
tyear = request("tyear")
if tmonth = "" then
tmonth = cstr(datepart( "M" , now()))
end if
if tyear = "" then
tyear = cstr(datepart( "YYYY" , now()))
end if
prevm = cint(tmonth) - 1
nextm = cint(tmonth) + 1
prevy = cint( tyear )
nexty = cint( tyear )
if cint( tmonth ) = 12 then
nextm = 1
nexty = nexty + 1
tempmonth = 1
tempyear = cint( tyear ) + 1
elseif cint( tmonth ) = 1 then
prevm = 12
prevy = prevy - 1
tempmonth = cint( tmonth ) + 1
tempyear = cint( tyear )
else
tempmonth = cint( tmonth ) + 1
tempyear = cint( tyear )
end if
tempdate = tempyear &"-"& tempmonth &"-01"
tdate = cdate( tempdate )
endday = day( tdate - 1 )
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/include/css/default.css">
<style type="text/css">
.normalday{color:#000000}
.holiday{color:#F11903;}
.sholiday{color:#0062C8;}
.today{color:#FFFFFF; font-weight:bold }
</style>
<script language="javascript">
<!--
function over2(obj){
obj.style.backgroundColor="#FFFEF1";
}
function out(obj){
obj.style.backgroundColor="#FFFFFF";
}
function dateClick(subject){
subject = subject.split('|').join('\'');
subject = subject.split('^').join('\"');
//alert(subject);
parent.nd();
parent.drs("▷ <b>"+subject+"</b>","",window.event.x+250,window.event.y+200);
return true;
}
//-->
</script>
</head>
<body topmargin="0" leftmargin="0" onClick="parent.parent.nd();" scroll="no">
<!--
<DIV ID='overDiv' STYLE='position: absolute; z-index: 1; width: 160; visibility: hidden'></DIV>
-->
<!--<script language="JavaScript" src="layer.js"></script>-->
<table border="0" width="164" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="23" background="image/calendar_bg.gif">
<Table width="100%" cellspacing="0" cellpadding="0">
<tr>
<Td style="padding-left:7;"><font color="FFFFFF"><b><%=tyear%>년 <%=tmonth%>월</b></font></td>
<td align="right" style="padding-right:10;"><a href="date.asp?tyear=<%=prevy%>&tmonth=<%=prevm%>"><img src="image/calendar_left.gif" width="6" height="7" border="0"></a><a href="date.asp?tyear=<%=nexty%>&tmonth=<%=nextm%>"><img src="image/calendar_right.gif" width="6" height="7" border="0"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding-top:6;"><img src="image/calendar_tit.gif" width="164" height="21" border="0" alt=""></td>
</tr>
</table>
<table border="0" width="164" bgcolor="F3F3F3" cellspacing="2" cellpadding="0" align="center">
<%
d = 0
syoil = datepart("W" ,cdate(tyear &"-"& tmonth &"-01"))
for i = 1 to 42 step 1
if i mod 7 = 1 then
response.write "<tr height=16 bgcolor=ffffff>"
end if
if syoil <= i then
d = d + 1
end if
if d > 0 and d <= endday then
if cint(d) = day( now() ) and cint(tyear) = year( now() ) and cint(tmonth) = month( now()) then
dtext = "<font color='#FFFFFF'><b>"& d &"</b></font>"
overout = "bgcolor=D56090"
else
dtext = d
overout = "onmouseover='over2(this)' onmouseout='out(this)'"
end if
if i mod 7 = 1 then
response.write "<td class='holiday' "&overout&" align='center'>"& toDay &"</td>"
elseif i mod 7 = 0 then
response.write "<td class='sholiday' "&overout&" align='center'>"& toDay &"</td>"
else
response.write "<td class='normalday' "&overout&" align='center'>"& toDay &"</td>"
end if
else
response.write "<td>&nbsp;</td>"
end if
if i mod 7 = 0 then
response.write "</tr>"
end if
next
%>
</table>
</body>
</html>
<%
Dbcon.close
Set Dbcon = Nothing
Function toDay()
table = "bbs_12" '테이블명
DayColor = "#FF9900" '일정등록된 날짜 색
If Len(tmonth) = 1 Then
tmon = "0" & tmonth
Else
tmon = tmonth
End If
If Len(d) = 1 Then
tday = "0" & d
Else
tday = d
End If
toDayInfo = tyear & "-" & tmon & "-" & tday
'response.write toDayInfo
'response.end
sql = "select b_num, b_subject from "&table&" where b_regdate = '"&toDayInfo&"'"
'response.write sql
Set rs = Dbcon.Execute(sql)
If rs.bof Or rs.eof Then
toDay = dtext
Else
dtext = "<font color="&DayColor&" class='curHand'><b>"& dtext & "</b></font>"
Do Until rs.eof
linkUrl = "<a href=^javascript:;^ onClick=|window.open(^/program/bbs/view.asp?a_num=6310458&b_num="&rs("b_num")&"&p_click_date="&toDayInfo&"^,^^,^fullscreen=no,width=750,height=450,scrollbars=yes^)|>"
subject = subject &linkUrl & StringToHTML(rs("b_subject"), 20, false) & "</a><br>"
rs.movenext
Loop
toDay = "<p onClick='' onMouseOver='dateClick("""&subject&""")'>" 'onMouseOut="parent.nd();"
toDay = toDay & dtext & "</p>"
End If
Set rs = nothing
End function
%>