Files
KIN/contact/include/calendar_month.html
2025-09-29 17:55:08 +09:00

198 lines
6.2 KiB
HTML

<html>
<head>
<title>KRI WEB CALENDAR</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<link rel="StyleSheet" href="lucis.css" type="text/css">
<script language="JavaScript">
<!--
if (document.all) {
docObj = "document.all."
styleObj = ".style"
} else {
docObj = "document."
styleObj = ""
}
var icount = 0;
function parseUrl() {
var myValueIn = unescape(location.search.replace(/\+/g,' '));
myValueIn = myValueIn.substring(1).split('&');
var year = 0;
var month = 0;
var actval = "";
for(i=0;i<myValueIn.length;i++)
myValueIn[i] = myValueIn[i].split('=');
for(i=0;i<myValueIn.length;i++){
if(myValueIn[i][0] == "year") year = parseInt(myValueIn[i][1]);
if(myValueIn[i][0] == "month") month = parseInt(myValueIn[i][1]);
if(myValueIn[i][0] == "actval") actval = myValueIn[i][1];
if(myValueIn[i][0] == "icount") icount = myValueIn[i][1];
}
setCal(year,month,actval);
}
function leapYear(year) {
if (year % 4 == 0) return true;
return false;
}
function getDays(month, year) {
var ar = new Array(12);
ar[0] = 31; ar[1] = (leapYear(year)) ? 29 : 28; ar[2] = 31; ar[3] = 30; ar[4] = 31; ar[5] = 30;
ar[6] = 31; ar[7] = 31; ar[8] = 30; ar[9] = 31; ar[10] = 30; ar[11] = 31;
return ar[month];
}
function getMonthName(month) {
var ar = new Array(12);
ar[0] = "1¿ù"; ar[1] = "2¿ù"; ar[2] = "3¿ù"; ar[3] = "4¿ù"; ar[4] = "5¿ù"; ar[5] = "6¿ù";
ar[6] = "7¿ù"; ar[7] = "8¿ù"; ar[8] = "9¿ù"; ar[9] = "10¿ù"; ar[10] = "11¿ù"; ar[11] = "12¿ù";
return ar[month];
}
function setCal(year,month,actval) {
var now = new Date();
month = month - 1;
var curyear = now.getYear();
var curmonth = now.getMonth();
if(year==0) year = now.getYear();
if(month<0||month>11) month = now.getMonth();
var monthName = getMonthName(month);
var date = now.getDate();
now = null;
var firstDayInstance = new Date(year, month, 1);
var firstDay = firstDayInstance.getDay();
firstDayInstance = null;
var days = getDays(month, year);
drawCal(firstDay + 1, days, date, monthName, year, month, curyear, curmonth, actval);
}
function drawCal(firstDay, lastDate, date, monthName, year, month, curyear, curmonth, actval) {
var headerHeight = " "; // Å×À̺í Çì´õ¼¿ÀÇ ³ôÀÌ
var border = 0; // Å×À̺í Å׵θ®
var cellspacing = "1"; // ¼¿°£ÀÇ °£°Ý
var headerColor = "black"; // Å×À̺í Çì´õ »ö»ó
var headerSize = "2"; // Å×À̺í Çì´õ ±ÛÀÚ Å©±â
var colWidth = "27"; // Å×ÀÌºí ¼¿ÀÇ Å©±â
var dayCellHeight = "22";// ¿äÀÏ ¶óÀÎÀÇ ³ôÀÌ
var dayColor = "white"; // ¿äÀÏ »ö»ó
var cellHeight = "20"; // ¼¿ÀÇ ³ôÀÌ
var todayColor = "red"; // ¿À´Ã ³¯Â¥ »ö»ó
var timeColor = "blue"; // ½Ã°£ Ç¥½Ã »ö»ó
var text = "";
text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + ' align=\'center\'>';
text += '<TR COLSPAN=1 HEIGHT=' + headerHeight + ' bgcolor="#FFFFFF">';
/*³â¿ù ¼±Åà ¼¿·ºÆ® ¹Ú½º »ý¼º*/
text += '<td>'+
'<table border="0" width=\' \' height=\' \' >'+
'<form name=\'date_list\'>'+
'<input type=\'hidden\' name=\'actval\' value='+actval+'><tr>'+
'<td align=center>'+
'<select name=\'year\' onchange=\'change_year();\'>';
for(var i=1950; i<(curyear+2); i++) {
if(year != i) {
text += '<option value='+i+' >'+i;
} else {
text += '<option value='+i+' selected>'+i;
}
}
text += '</select><b>³â'+
'</td>'+
'</tr></table></td>';
text += '<td>';
text += '<img src="../imgs/common/rec_purple.gif" border=0 align=absmiddle OnClick="window.close()" style="cursor:hand" >';
text += '</FONT></td>';
text += '</TR></form>';
text += '</TABLE>';
text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + ' bgcolor="#977BD0">';
var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>';
openCol += '<FONT COLOR="' + dayColor + '">';
var closeCol = '</FONT></TD>';
var digit = 0;
for (var row = 1; row <=3; ++row){
text += '<TR bgcolor="white" ALIGN="center">';
for(var col = 1; col <= 4; ++col){
digit++;
text += '<TD bgcolor=yellow style=\'cursor:hand\' HEIGHT=50 width=50';
text += ' onMouseOver="this.style.backgroundColor=\'#E1E9FF\'" onMouseOut="this.style.backgroundColor=\'\'"';
text += ' onClick="sendVal(\'' + year + '\',\''+ digit + '\',\'' + actval + '\');">';
text += digit + " ¿ù";
text += '</TD>';
}
text += '</TR>';
}
text += '</TABLE>';
document.write(text);
}
function sendVal(year, mon, actval) {
var dateStr = "";
if (mon <10) mon = 0+mon;
dateStr = year+ '-' + mon;
if((actval!=""||actval!= null)&&opener) {
if(eval("opener.document.forms[0]." + actval)) {
eval("opener.document.forms[0]." + actval).value = dateStr;
eval("opener.document.forms[0]." + actval).focus();
}
} else alert(dateStr);
self.close();
}
function change_year() {
location.href = "calendar_month.html?year=" + date_list.year.value + "&actval=" + date_list.actval.value + "&icount="+icount; //+ "&month=" + date_list.month.value
}
function SetInit()
{ var ileft = new Number;
var itop = new Number;
ileft = window.event.clientX;
itop = window.event.clientY;
//alert(ileft + " : " + itop);
window.resizeTo(200,300);
if((ileft) < 0 ) ileft = 0;
if((itop) < 0 ) itop = 0;
if(icount == 0){
icount++;
window.moveBy(ileft-50, itop-50);
}
}
//-->
</script>
</head>
<body bgcolor="#EEEEFF" leftmargin="0" topmargin="8" marginwidth="0" marginheight="0" OnLoad="SetInit()">
<script language="JavaScript">
<!--
parseUrl();
icount++;
//alert(icount);
//-->
</script>
</body>
</html>