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

268 lines
9.8 KiB
HTML

<!-- #include file = "../include/default_values.asp" -->
<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.getFullYear();
var curmonth = now.getMonth();
if(year==0) year = now.getFullYear();
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"><td>';
text += '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>';
text += '<a href="calendar.html?year=' + ((month==0) ? year-1 : year) + '&month=' + ((month==0) ? 12 : month )
text += '&actval=' + actval + '&icount=' + icount + '"><img src=/source/imgs/business/rec_blue1.gif border=0 align=absmiddle ></a></td>';
/*³â¿ù ¼±Åà ¼¿·ºÆ® ¹Ú½º »ý¼º*/
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(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>'+
'<td>'+
'<select name="month" onchange="change_month(this.options.selectedIndex);">';
for(i=0; i < 12; i++) {
if(month != i) {
text += '<option value="'+(i+1)+'">'+ (i+1);
} else {
text += '<option value="'+(i+1)+'" selected>'+(i+1);
}
}
text += '</select><b>¿ù'+
'</td>'+
'</tr></table></td>';
text += '<td><a href="calendar.html?year=' + ((month==11) ? year+1 : year) + '&month=' + ((month==11) ? 1 : month + 2)
text += '&actval=' + actval + '&icount=' + icount + '"><img src=/source/imgs/business/rec_blue2.gif border=0 align=absmiddle ></a> ';
text += '<img src=/source/imgs/business/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" ALIGN="center">';
var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>';
openCol += '<FONT COLOR="' + dayColor + '">';
var closeCol = '</FONT></TD>';
var weekDay = new Array(7);
weekDay[0] = "ÀÏ"; weekDay[1] = "¿ù"; weekDay[2] = "È­"; weekDay[3] = "¼ö";
weekDay[4] = "¸ñ"; weekDay[5] = "±Ý"; weekDay[6] = "Åä";
text += '<TR ALIGN="center">';
for (var dayNum = 0; dayNum < 7; ++dayNum) {
text += openCol + "<b>" +weekDay[dayNum] + closeCol;
}
text += '</TR>';
var digit = 1;
var curCell = 1;
for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
text += '<TR bgcolor="white" ALIGN="center">';
for (var col = 1; col <= 7; ++col) {
if (digit > lastDate) break;
if (curCell < firstDay) {
text += '<TD bgcolor="white" ></TD>';
curCell++;
} else {
if (digit == date && year == curyear && month == curmonth ) {
text += '<TD bgcolor=yellow style=\'cursor:hand\' HEIGHT=' + cellHeight;
text += ' onMouseOver="this.style.backgroundColor=\'#E1E9FF\'" onMouseOut="this.style.backgroundColor=\'\'"';
text += ' onClick="sendVal(\'' + year + '\',\'' + (month + 1) + '\',\''+ digit + '\',\'' + actval + '\');">';
text += '<FONT COLOR="' + todayColor + '">';
text += digit;
text += '</FONT><BR>';
text += '</TD>';
} else {
text += '<TD bgcolor="white" style=\'cursor:hand\' HEIGHT=' + cellHeight;
text += ' onMouseOver="this.style.backgroundColor=\'#E1E9FF\'" onMouseOut="this.style.backgroundColor=\'\'"';
text += ' onClick="sendVal(\'' + year + '\',\''+ (month + 1) + '\',\'' + digit + '\',\'' + actval + '\');">' + digit + '</TD>';
}
digit++;
}
}
text += '</TR>';
}
text += '</TABLE>';
document.write(text);
}
function sendVal(year, mon, day, actval) {
var dateStr = "";
if (mon <10) mon = 0+mon;
if (day <10) day = 0+day;
dateStr = year+ '-' + mon + '-' + day;
if((actval!=""||actval!= null)&&opener) {
//alert(actval+" : "+dateStr+" // "+opener);
//alert("eval : "+"opener.document.forms[0]." + actval);
//alert("[0] : "+(opener.document.forms[0][actval] != null));
//alert("[1] : "+(opener.document.forms[1][actval] != null));
if(opener.document.forms[0][actval] != null){
if(eval("opener.document.forms[0]." + actval)) {
eval("opener.document.forms[0]." + actval).value = dateStr;
eval("opener.document.forms[0]." + actval).focus();
}
}else if(opener.document.forms[1][actval] != null){
if(eval("opener.document.forms[1]." + actval)) {
eval("opener.document.forms[1]." + actval).value = dateStr;
eval("opener.document.forms[1]." + actval).focus();
}
}else{
//alert("¹¹Áö : "+actval+" : "+dateStr+" // "+opener.document.forms.length);
//for(var i = 0; i<opener.document.forms.length; i++){
//alert("¹¹Áö : "+i+" : "+opener.document.forms[i]);
//console.log("¹¹Áö : "+i+" : "+opener.document.forms[i].txt_date[1]+"//actval : "+actval);
//}
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.html?year=" + date_list.year.value + "&month=" + date_list.month.value + "&actval=" + date_list.actval.value + "&icount="+icount;
}
function change_month() {
//alert(window.event.clientX);
//alert(window.event.clientY);
location.href = "calendar.html?year=" + date_list.year.value + "&month=" + date_list.month.value + "&actval=" + date_list.actval.value + "&icount="+icount;
}
function SetInit()
{ var ileft = new Number;
var itop = new Number;
ileft = window.event.clientX;
itop = window.event.clientY;
//alert(ileft + " : " + itop);
window.resizeTo(245,245);
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>