최초커밋
This commit is contained in:
287
include/calendar.html
Normal file
287
include/calendar.html
Normal file
@@ -0,0 +1,287 @@
|
||||
|
||||
<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 = myValueIn[i][1]*1;
|
||||
if(myValueIn[i][0] == "month") month = myValueIn[i][1]*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<><31>"; ar[1] = "2<><32>"; ar[2] = "3<><33>"; ar[3] = "4<><34>"; ar[4] = "5<><35>"; ar[5] = "6<><36>";
|
||||
ar[6] = "7<><37>"; ar[7] = "8<><38>"; ar[8] = "9<><39>"; ar[9] = "10<31><30>"; ar[10] = "11<31><31>"; ar[11] = "12<31><32>";
|
||||
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 = " "; // <20><><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var border = 0; // <20><><EFBFBD>̺<EFBFBD> <20>θ<D7B5>
|
||||
var cellspacing = "1"; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var headerColor = "black"; // <20><><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var headerSize = "2"; // <20><><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ũ<><C5A9>
|
||||
var colWidth = "27"; // <20><><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD> ũ<><C5A9>
|
||||
var dayCellHeight = "22";// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var dayColor = "white"; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var cellHeight = "20"; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
var todayColor = "red"; // <20><><EFBFBD><EFBFBD> <20><>¥ <20><><EFBFBD><EFBFBD>
|
||||
var timeColor = "blue"; // <20>ð<EFBFBD> ǥ<><C7A5> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
var text = "";
|
||||
text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + ' align=\'center\'>';
|
||||
text += '<TR COLSPAN=1 HEIGHT=' + headerHeight + ' bgcolor="#FFFFFF"><td>';
|
||||
if (actval.substring(0, 9) != "txt_dates") {
|
||||
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=/images/business/rec_blue1.gif border=0 align=absmiddle ></a></td>';
|
||||
/*<2A><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20>ڽ<EFBFBD> <20><><EFBFBD><EFBFBD>*/
|
||||
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();\'>';
|
||||
|
||||
var yyyy = 2005;
|
||||
if (actval == "txt_birthday" || actval == "marriage_date" ||
|
||||
actval == "txt_family_birthday_1" || actval == "txt_family_real_birthday_1" ||
|
||||
actval == "txt_family_birthday_2" || actval == "txt_family_real_birthday_2" ||
|
||||
actval == "txt_family_birthday_3" || actval == "txt_family_real_birthday_3" ||
|
||||
actval == "txt_family_birthday_4" || actval == "txt_family_real_birthday_4" ||
|
||||
actval == "txt_family_birthday_5" || actval == "txt_family_real_birthday_5"
|
||||
) {
|
||||
yyyy = 1950;
|
||||
}
|
||||
|
||||
//for(i=1950; i<(curyear+2); i++) {
|
||||
for (i = yyyy; i < (curyear + 2); i++) {
|
||||
if (year != i) {
|
||||
text += '<option value=' + i + ' >' + i;
|
||||
} else {
|
||||
text += '<option value=' + i + ' selected>' + i;
|
||||
}
|
||||
}
|
||||
text += '</select><b><3E><>' +
|
||||
'</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><3E><>' +
|
||||
'</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=/images/business/rec_blue2.gif border=0 align=absmiddle ></a> ';
|
||||
text += '<img src=/images/business/rec_purple.gif border=0 align=absmiddle OnClick="window.close()" style="cursor:pointer" >';
|
||||
text += '</FONT>';
|
||||
} else {
|
||||
text += '<td>' + year + '<27><> ' + (month + 1) + '<27><></td>';
|
||||
}
|
||||
text += '</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] = "<22><>"; weekDay[1] = "<22><>"; weekDay[2] = "ȭ"; weekDay[3] = "<22><>";
|
||||
weekDay[4] = "<22><>"; weekDay[5] = "<22><>"; weekDay[6] = "<22><>";
|
||||
|
||||
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:pointer\' 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:pointer\' 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("<22><><EFBFBD><EFBFBD> : "+actval+" : "+dateStr+" // "+opener.document.forms.length);
|
||||
//for(var i = 0; i<opener.document.forms.length; i++){
|
||||
//alert("<22><><EFBFBD><EFBFBD> : "+i+" : "+opener.document.forms[i]);
|
||||
//console.log("<22><><EFBFBD><EFBFBD> : "+i+" : "+opener.document.forms[i].txt_date[1]+"//actval : "+actval);
|
||||
//}
|
||||
if (eval("opener.document.forms[0]." + actval)) {
|
||||
if (eval("opener.document.forms[0].tmp_" + actval) != null) {
|
||||
eval("opener.document.forms[0].tmp_" + actval).value = dateStr.substring(8, 10);
|
||||
}
|
||||
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>
|
||||
Reference in New Issue
Block a user