112 lines
3.4 KiB
Plaintext
112 lines
3.4 KiB
Plaintext
<%@ Language=VBScript%>
|
||
<%
|
||
''년도와 월만 보이기용 달력..
|
||
|
||
Response.Buffer = true
|
||
|
||
target = request("x")
|
||
%>
|
||
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
|
||
<LINK rel="stylesheet" type="text/css" href="cfg/text.css">
|
||
<form name="caleder2" method="post">
|
||
<input type="hidden" name="target" value="<%=target%>">
|
||
</form>
|
||
<script language='javascript'>
|
||
<!--
|
||
|
||
var today = new Date(); real_year = today.getYear(); str = null; month_value = 0;
|
||
var lastday = null; firstweek = null;
|
||
var wid = 4; hei = 12/wid; big_wid = 600;
|
||
var small_wid = (big_wid / wid) - 10;
|
||
var week_day = new Array('일','월','화','수','목','금','토');
|
||
|
||
//var x = document.forms[0].element[x].value;
|
||
|
||
document.write("<style>");
|
||
document.write(".a { font-family: 'Arial', '돋움'; color: white; font-size: 13px}");
|
||
document.write("</style>");
|
||
document.write("<body onselectstart='return false' onload='start()'>");
|
||
document.write("<center>");
|
||
document.write("<table><form name='calendar'>");
|
||
document.write("<tr>");
|
||
document.write("<td onClick='year_(true)' style='cursor:hand'>◀</td>");
|
||
document.write("<td>");
|
||
document.write("<select name = 'year_name' onchange='year_change();'>");
|
||
for (var i=real_year+1; i>=1950;--i)
|
||
{
|
||
document.write("<option value = '" + i + "'>" + i);
|
||
}
|
||
document.write("</select>");
|
||
document.write("<td onClick='year_(false)' style='cursor:hand'>▶</td>");
|
||
document.write("</tr>");
|
||
document.write("</form></table>");
|
||
document.write("<div id=taewan style='visibility:visible'>");
|
||
document.write("<table><tr><td><q id='calendars'></q></td></tr></table>");
|
||
document.write("</div>");
|
||
|
||
function start() {
|
||
str = "<table border='1'>";
|
||
for(j = 1; j < hei+1; j++) {
|
||
str = str + "<tr height='10' align='center' valign='top' class='a'>";
|
||
for(n = 1; n < wid+1; n++) {
|
||
str = str + "<td>" + month_(month_value) + "</td>";
|
||
if(n != wid) { str = str + "<td> </td>"; } }
|
||
str = str + "</tr>"; }
|
||
str = str + "</table>";
|
||
calendars.innerHTML = str;
|
||
}
|
||
|
||
function on_m(x,y) {
|
||
if(y) { x.style.cursor='hand'; x.style.backgroundColor='pink'; }
|
||
else { x.style.cursor = ''; x.style.backgroundColor=''; }
|
||
}
|
||
|
||
|
||
function year_(x) {
|
||
if(x) { today.setYear(today.getYear()-1); }
|
||
else { today.setYear(today.getYear()+1); }
|
||
if (today.getYear() < 2000){
|
||
document.calendar.year_name.value = 1900 + today.getYear();
|
||
}else{
|
||
document.calendar.year_name.value = today.getYear();
|
||
}
|
||
month_value = 0;
|
||
start();
|
||
}
|
||
|
||
function year_change(){
|
||
today.setYear(document.calendar.year_name.value);
|
||
month_value = 0;
|
||
start();
|
||
}
|
||
|
||
function popup(tmp_z) {
|
||
var target = document.caleder2.target.value;
|
||
opener.document.forms[0].elements[eval(target)].value=tmp_z;
|
||
self.close();
|
||
}
|
||
|
||
function month_(x) {
|
||
month_value = month_value + 1;
|
||
imsi_0 = new Date (today.getYear(),today.getMonth(),1);
|
||
imsi_1 = new Date (today.getYear(),today.getMonth()+1);
|
||
lastday = (imsi_1 - imsi_0)/1000/60/60/24;
|
||
var y = today.getYear(); m = x; d = 1;
|
||
var week = new Date(y,m,d);
|
||
var target = document.c
|
||
firstweek = week.getDay();
|
||
firstweek = firstweek - (firstweek * 2 - 1);
|
||
tmp_m = m + 1;
|
||
if (tmp_m < 10) {
|
||
tmp_m = '0' + tmp_m;
|
||
}
|
||
y = document.calendar.year_name.value;
|
||
tmp_tmp = y + '-' + tmp_m;
|
||
gap = "<table width='60' border='1'>";
|
||
gap = gap + "<tr align='center'><td onmouseover='on_m(this,true)' onmouseout='on_m(this,false)' onClick=popup('"+tmp_tmp+"')>" + eval(x+1) + " 월</td></tr>";
|
||
gap = gap + "</table>";
|
||
return gap;
|
||
}
|
||
//-->
|
||
</script>
|