<? if ( !defined("_INCLUDED_GLOBAL") ) exit;		// [Security]Allow_url_fopen = On ?>

<script language="JavaScript" src="<?= $nmpath ?>/include/form_check.js"></script>
<script language="JavaScript">
<!--
	function sadmin_hoilday_del_check()
	{
		var msg = "";
		var res = true;
		var form = document.list;

 		if (countCheckBox(form, 'chk[]') < 1)
 		{
			alert("삭제할 항목들을 선택하여 주십시오.");
			return;
 		}

		res = confirm("선택한 항목들을 삭제하시겠습니까?");
		if (res == true)
		{
			form.action = nmpath + "/sadmin_holiday_list_del_ok.php?<?= get_qs() ?>";
			form.method = "post";
			form.submit();
		}
	}	// function

	function sadmin_holiday_list_search()
	{
		var form = document.list;

		if (form_chk_value(form.s_word, "검색할 단어") == false) return;

		location.href = nmpath + "/sadmin_holiday_list.php?<?= get_qs('s_word') ?>&s_word=" + form.s_word.value;
	}	// function

	function sadmin_holiday_list_del(di_subject, di_content, di_no)
	{
	    var msg = "";
	    var res = true;
	    var form = document.list;

		msg = "["+di_subject+"]으로 등록된 '" + di_content + "'을 삭제하시겠습니까?";

	    res = confirm(msg);
	    if (res == true)
	    {
            location.href = nmpath + "/sadmin_holiday_list_del_ok.php?di_no=" + di_no + "&<?= get_qs() ?>";
	    }
	}	// function

//-->
</script>


<div class="alert alert-info" role="alert">
	<font color=blue>
		※ [일정관리 - 월간일정]의 달력에서 보여줄 공휴일 및 기념일을 관리할 수 있습니다.  (대체공휴일 추가 등)
	</font>
</div>


<form name="list" method="post" onSubmit="JavaScript:return(false);" style="margin:0;">
	<?= get_qs_input_hidden('s_word') ?>

	<table width=100% cellspacing=0 cellpadding=0>
	<tr>
		<td>
			&nbsp;※ 전체 <?= $diary_all_cnt ?>건
		</td>
		<td align=right>
			<input type=text name=s_word size=30 maxlength=255 value="<?= $v_s_word ?>" onKeyPress="JavaScript:if(event.keyCode == 13) sadmin_holiday_list_search();">
			<a class="btn btn-default btn-xs" href="JavaScript:sadmin_holiday_list_search();">검색</a>
			<a class="btn btn-default btn-xs" href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_word', 'pageID') ?>">취소</a>
		</td>
	</tr>
	</table>

	<br style="line-height: 5px">

	<table width=100% cellspacing=0 cellpadding=5>
	<tr>
		<td>
			<a class="btn btn-default btn-xs" href="JavaScript:checkedCheckBoxClick(document.list, 'chk[]');">전체선택</a>
			<a class="btn btn-default btn-xs" href="JavaScript:sadmin_hoilday_del_check();">삭제</a> |
			<a class="btn btn-default btn-xs" href="<?= $nmpath ?>/sadmin_holiday_list_add.php">공휴일 추가</a>
		</td>
		<td align=right>
			<!-- [Begin] Pager Links -->
			<? include(nskindir('webmail').'/pager_view.inc.html'); ?>
			<!-- [End] Pager Links -->
		</td>
	</tr>
	</table>

	<br style="line-height: 3px">

	<table width=100% cellspacing=0 cellpadding=5 border=0 class="table table-condensed">
	<thead>
	<tr align=center>
		<th width=5%></th>
		<th nowrap width=10%><a href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_key', 's_key2', 'pageID') ?>&s_key=di.di_subject&s_key2=<?= $order_set['set'] ?>"><b><font color=#ffffff>이름<?= $order_img['di_subject'] ?></a></th>
		<th nowrap width=20%><a href="<?php /*= $nmpath */?>/sadmin_holiday_list.php?<?php /*= get_qs('s_key', 's_key2', 'pageID') */?>&s_key=di.di_content&s_key2=<?php /*= $order_set['set'] */?>"><b><font color=#ffffff>구분<?php /*= $order_img['di_content'] */?></a></th>
		<th nowrap width=30%><a href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_key', 's_key2', 'pageID') ?>&s_key=di.di_startdate&s_key2=<?= $order_set['set'] ?>"><b><font color=#ffffff>시작일<?= $order_img['di_startdate'] ?></a></th>
		<th nowrap width=30%><a href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_key', 's_key2', 'pageID') ?>&s_key=di.di_enddate&s_key2=<?= $order_set['set'] ?>"><b><font color=#ffffff>종료일<?= $order_img['di_enddate'] ?></a></th>
		<th nowrap width=20%><a href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_key', 's_key2', 'pageID') ?>&s_key=di.di_repeat&s_key2=<?= $order_set['set'] ?>"><b><font color=#ffffff>되풀이<?= $order_img['di_repeat'] ?></a></th>
		<th nowrap width=20%><a href="<?= $nmpath ?>/sadmin_holiday_list.php?<?= get_qs('s_key', 's_key2', 'pageID') ?>&s_key=di.di_regdate&s_key2=<?= $order_set['set'] ?>"><b><font color=#ffffff>등록일<?= $order_img['di_regdate'] ?></a></th>
		<th nowrap><b><font color=#ffffff>관리</th>
	</tr>
	</thead>

	<? for ($i=0; $i<$rows_cnt; $i++) { ?>
			<tr id="tr<?= $i ?>" class=main_table_body_Y<?= ($i%2) ?>>
				<td width="5%"><input type=checkbox name="chk[]" value="<?= $rows['di_no'][$i] ?>" onClick="JavaScript:list_click(document.all.tr<?= $i ?>, 'main_table_body_click_Y', 'main_table_body_Y<?= ($i%2) ?>');"></td>
				<td nowrap width=10%><?= $rows['di_subject'][$i] ?></td>
				<td nowrap width=10%><?= $rows['di_content'][$i] ?></td>
				<td nowrap width=20%><?= $rows['di_startdate'][$i] ?></td>
				<td nowrap width=30%><?= $rows['di_enddate'][$i] ?></td>
				<td nowrap width=30%><?= $G_SYS['DI_REPEAT'][$rows['di_repeat'][$i]] ?></td>
				<td nowrap width=20% align=center><?= $rows['di_regdate'][$i] ?></td>
				<td align=center nowrap>
					<a class="btn btn-default btn-xs" href="<?= $nmpath ?>/sadmin_holiday_list_mod.php?di_no=<?= $rows['di_no'][$i] ?>&<?= get_qs() ?>">수정</a>
					<a class="btn btn-default btn-xs" href="javascript:sadmin_holiday_list_del('<?= $rows['di_subject'][$i] ?>', '<?= $rows['di_content'][$i] ?>', '<?= $rows['di_no'][$i] ?>')">삭제</a>
				</td>
			</tr>
	<? }	// for() ?>
	<tr><td colspan=6 height=1 bgcolor=#D7D4E8 style="padding: 0px"></td></tr>
	</table>

	<? if ($rows_cnt == 0) { ?>
	<table width=100% cellspacing=1 cellpadding=3>
		<? if (!$_GET['s_word']) { ?>
			<tr>
				<td align=center>등록된 IP가 없습니다.</td>
			</tr>
		<? } else { ?>
			<tr>
				<td align=center>검색된 IP가 없습니다.</td>
			</tr>
		<? }	// if() ?>
	<tr><td colspan=6 height=1 bgcolor=#E5E5E5 style="padding: 0px"></td></tr>
	<tr><td colspan=6 height=1 bgcolor=#D7D4E8 style="padding: 0px"></td></tr>
	</table>
	<? }	// if() ?>

	<table cellspacing=0 cellpadding=0 width=100%><tr><td height=5></td></tr></table>

	<br style="line-height: 3px">

	<table width=100% cellspacing=0 cellpadding=5>
	<tr>
		<td>
			<a class="btn btn-default btn-xs" href="JavaScript:checkedCheckBoxClick(document.list, 'chk[]');">전체선택</a>
			<a class="btn btn-default btn-xs" href="JavaScript:sadmin_ip_del_check();">삭제</a>
		</td>
		<td align=right>
			<!-- [Begin] Pager Links -->
			<? include(nskindir('webmail').'/pager_view.inc.html'); ?>
			<!-- [End] Pager Links -->
		</td>
	</tr>
	</table>

</form>
</div>
