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

172 lines
4.3 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:#6C6C6C}
.holiday{color:#E3714E;}
.sholiday{color:#556AD6;}
.today{color:#FFFFFF; font-weight:bold }
</style>
<script language="javascript">
<!--
function over2(obj){
obj.style.backgroundColor="#FFFEF1";
}
function out(obj){
obj.style.backgroundColor="#FFFFFF";
}
//-->
</script>
</head>
<body topmargin="0" leftmargin="0" onClick="parent.parent.nd();" scroll="no" style="background-color:transparent" >
<!--
<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="147" cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan="7" height="30" valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><font color="FFFFF" size="3"><b><%=tyear%></b></font></td>
<td style="padding-left:30;padding-top:2;"><a href="date.asp?tyear=<%=prevy%>&tmonth=<%=prevm%>"><img src="image/content_week_month_move_ic_01.gif" border="0" align="absmiddle"></a><font color="0F67A4"><b><%=tmonth%>월</font></b></font><a href="date.asp?tyear=<%=nexty%>&tmonth=<%=nextm%>"><img src="image/content_week_month_move_ic_02.gif" border="0" align="absmiddle"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="7" style="padding-top:4;"><img src='image/month_top.gif'></td></td>
</tr>
<%
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>"
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=#60D4D5"
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'><font class=''>"& toDay &"</font></td>"
elseif i mod 7 = 0 then
response.write "<td class='sholiday' "&overout&" align='center'><font class=''>"& toDay &"</font></td>"
else
response.write "<td class='normalday' "&overout&" align='center'><font class=''>"& toDay &"</font></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_15" '테이블명
a_num = "19113837"
DayColor = "#FF9900" '일정등록된 날짜 색
If Len(tmonth) = 1 Then
tmon = "0" & tmonth
Else
tmon = tmonth
End If
If Len(d) = 1 Then
tday = "0" & dtext
Else
tday = d
End If
toDayInfo = tyear & "-" & tmon & "-" & d
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=/program/bbs/view.asp?a_num="&a_num&"&b_num="&rs("b_num")&"&p_click_date="&toDayInfo&" target=_parent>"
subject = subject &linkUrl & StringToHTML(rs("b_subject"), 20, fale) & "</a><br>"
rs.movenext
Loop
toDay = "<p onClick='' onMouseOver='parent.nd();parent.drs(""▷ <b>" & subject & "</b>"","""",window.event.x+280,window.event.y+670);return true;'>" 'onMouseOut="parent.nd();"
toDay = toDay & dtext & "</p>"
End If
Set rs = nothing
End function
%>