<%--
  Class Name : EgovNoticeRegist.jsp
  Description : 게시물  생성 화면
  Modification Information
 
      수정일         수정자                   수정내용
    -------    --------    ---------------------------
     2009.03.24   이삼섭              최초 생성
     2011.08.31   JJY       경량환경 버전 생성
 
    author   : 공통서비스 개발팀 이삼섭
    since    : 2009.03.24
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="ko">
<link href="/js/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript" src="/js/calendar.js"></script>
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script>
<script src="<c:url value='/js/jquery.js' />"></script>
<script type="text/javascript" src="<c:url value='/js/EgovCalPopup.js' />"></script>
<%@ taglib prefix="ckeditor" uri="http://ckeditor.com"%>
<script type="text/javascript">
	function fn_egov_regist_notice(cmd) {
		CKEDITOR.instances.nttCn.updateElement();
		CKEDITOR.instances.bizCalendar.updateElement();
		CKEDITOR.instances.bizHistoy.updateElement();
		CKEDITOR.instances.bizHomePage.updateElement();
		CKEDITOR.instances.bizQna.updateElement();
		CKEDITOR.instances.bizTarget.updateElement();
		CKEDITOR.instances.bizSubject.updateElement();
		
		if(!$('input:radio[id="bizCode"]').is(":checked")){
			alert("사업구분을 넣어주세요");
			return;
		}
		
		if(""==$("#bizName").val()){
			alert("사업명을 넣어주세요");
			return;
		}
		
		if(""==$("#nttCn").val()){
			alert("사업내용을 넣어주세요");
			return;
		}
		
		<c:if test="${ bizIntroVO.bbsId ne 'EXTBBSM_000000000005' && bizIntroVO.bbsId ne 'EXTBBSM_000000000001'}" >
			if(""==$("#bizDateStr").val()){
				alert("시작 사업기간을 넣어주세요");
				return;
			}
		
			if(""==$("#bizDateEnd").val()){
				alert("종료 사업기간을 넣어주세요");
				return;
			}
			
			if(""==$("#bizQna").val()){
				alert("사업문의를  넣어주세요");
				return;
			}
		</c:if>
		
		if (confirm('<spring:message code="common.regist.msg" />')){
			if(cmd == 'regi'){
				document.frm.action = "<c:url value='/cop/bbs/insertBisIntro.do'/>";	
			}else{
				document.frm.action = "<c:url value='/cop/bbs/modifyBisIntro.do'/>";
			}
			document.frm.submit();
		}
	}
	
	function fn_egov_delete_notice() {
		var delForm = document.delForm ;
		var id = "${bizIntroVO.bbsId}";
		if(id =="EXTBBSM_000000000005"){
			delForm.action = "<c:url value='/cop/bbs/engBisIntroDelete.do'/>";	
		}else{
			delForm.action = "<c:url value='/cop/bbs/bisIntroDelete.do'/>";
		}
		delForm.submit();
	}
	
	
	function fn_egov_select_noticeList() {
		var id = "${bizIntroVO.bbsId}";
		if(id =="EXTBBSM_000000000005"){
			document.searchForm.action = "<c:url value='/cop/bbs/engSelectBizIntroList.do'/>";
		}else{
			document.searchForm.action = "<c:url value='/cop/bbs/selectBizIntroList.do'/>";	
		}
		document.searchForm.submit();
	}
	
	function fn_egov_regist_preview() {
		var PCC_window = window.open('', 'PCCV3Window', 'width=1200, height=700, resizable=1, scrollbars=yes, status=0, titlebar=0, toolbar=0, left=350, top=50' );
		
		var previewImgs = "";
		var i = 0;
		
		document.board.previewImgs.value = previewImgs;
		document.board.action = "<c:url value='/cop/bbs/bbsPreview.do'/>";
		document.board.target = "PCCV3Window";
		document.board.submit();
	}
	
</script>
<title>등록</title>
</head>
<body>
	<div class="ad_content">
		<div class="ad_con_head">
			<div class="ad_head_text">
				<p class="today_txt">
					<%-- <c:out value='${bdMstr.bbsNm}' /> --%>
					 글 등록
				</p>
				<div class="ad_head_ment">
					<p class="today_last_txt"><span id="cnt_cate_list"></span></p>
				</div>
			</div>
		</div>
		<div class="ad_subcon">
			<form name=frm method="post" action="">
				<input type="hidden" name="pageIndex" value="${bizIntroVO.pageIndex}" />
				<input type="hidden" name="nttId" value="${bizIntroVO.nttId}" />
				<input type="hidden" name="bbsId" value="${bizIntroVO.bbsId}" />
				<input type="hidden" name="searchCnd" value="<c:out value='${searchVO.searchCnd}'/>" />
				<input type="hidden" name="searchWrd" value="<c:out value='${searchVO.searchWrd}'/>" />
				<input type="hidden" name="cal_url" value="<c:url value='/sym/cmm/EgovNormalCalPopup.do'/>" />
				<div class="main1_div2">
					<table class="main1_table">
						<!-- 구분 -->
						<tr>
							<th>
								<span class="star_t">*</span>사업 구분
							</th>
							<td colspan="3">
								<c:forEach items="${codeResult}" var="result" varStatus="status">
									<input type="radio" id="bizCode" name="bizCode" value="${result.code}"
									<c:if test="${bizIntroVO.bizCode eq result.code}" >
										checked="checked"
									</c:if>
									>${result.codeNm}
								</c:forEach>
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t">* </span>
								사업명
							</th>
							<td colspan="3">
								<input id="bizName" name="bizName" type="text" size="50" maxlength="50" value="${bizIntroVO.bizName}" />
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t">
								</span>사업목적
							</th>
							<td colspan="3">
								<%-- <input id="bizSubject" name="bizSubject" type="text" size="50" maxlength="50" value="${bizIntroVO.bizSubject}" /> --%>
								<textarea id="bizSubject" name="bizSubject" title="<spring:message code="cop.nttCn" />" cols="500" rows="20">
									<c:out value="${bizIntroVO.bizSubject}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizSubject" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t">
								</span>사업기간
							</th>
							<td colspan="3">
								<input id="bizDateStr" name="bizDateStr" title="설문대상 시작일 입력" type="text" value="${bizIntroVO.bizDateStr}" size="11" maxlength="10">
								<a href="#LINK" onClick="javascript:fn_egov_NormalCalendar(document.frm, document.frm.bizDateStr);">
						      	<img src="<c:url value='/images/calendar.gif' />" align="middle" style="border:0px" alt="설문기간시작달력" title="새창">
						      	</a>
						      	~
						      	<input id="bizDateEnd" name="bizDateEnd" title="설문대상 시작일 입력" type="text" value="${bizIntroVO.bizDateEnd}" size="11" maxlength="10"> 
						      	<a href="#LINK" onClick="javascript:fn_egov_NormalCalendar(document.frm, document.frm.bizDateEnd);">
						      	<img src="<c:url value='/images/calendar.gif' />" align="middle"  style="border:0px" alt="설문기간종료달력" title="새창">
						      	</a>   
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t"></span>지원(참가)대상
							</th>
							<td colspan="3">
								<%-- <input id="bizTarget" name="bizTarget" type="text" value="${bizIntroVO.bizTarget}" size="50" maxlength="50" /> --%>
								<textarea id="bizTarget" name="bizTarget" title="<spring:message code="cop.nttCn" />" cols="500" rows="20">
									<c:out value="${bizIntroVO.bizTarget}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizTarget" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t">
								*
								</span>사업내용
							</th>
							<td colspan="3">
								<textarea id="nttCn" name="nttCn" title="<spring:message code="cop.nttCn" />" cols="500" rows="20">
									<c:out value="${bizIntroVO.nttCn}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="nttCn" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
							</td>
						</tr>
						<tr>
							<th>
								<span class="star_t"></span>추진일정
							</th>
							<td colspan="3">
								<textarea id="bizCalendar" name="bizCalendar" title="<spring:message code="cop.nttCn" />" cols="100" rows="5">
									<c:out value="${bizIntroVO.bizCalendar}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizCalendar" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								
								<%-- <input id="bizCalendar" name="bizCalendar" type="text" value="${bizIntroVO.bizCalendar}" size="50" maxlength="50"> --%>
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t"></span>사업연혁(또는 성과)
							</th>
							<td colspan="3">
								<textarea id="bizHistoy" name="bizHistoy" title="<spring:message code="cop.nttCn" />" cols="100" rows="5">
									<c:out value="${bizIntroVO.bizHistoy}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizHistoy" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								<%-- <input id="bizHistoy" name="bizHistoy" type="text" value="${bizIntroVO.bizHistoy}" size="50" maxlength="50"> --%>
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t"></span>홈페이지
							</th>
							<td colspan="3">
								<textarea id="bizHomePage" name="bizHomePage" title="<spring:message code="cop.nttCn" />" cols="100" rows="5">
									<c:out value="${bizIntroVO.bizHomePage}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizHomePage" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								<%-- <input id="bizHomePage" name="bizHomePage" type="text" value="${bizIntroVO.bizHomePage}" size="50" maxlength="50"> --%>
							</td>
						</tr>
						<tr>
							<th>
								<span class="star_t">
								</span>사업문의
							</th>
							<td colspan="3">
								<textarea id="bizQna" name="bizQna" title="<spring:message code="cop.nttCn" />" cols="100" rows="5">
									<c:out value="${bizIntroVO.bizQna}" escapeXml="false" />
								</textarea>
								<ckeditor:replace replace="bizQna" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
								<%-- <input id="bizQna" name="bizQna" type="text" value="${bizIntroVO.bizQna}" size="50" maxlength="50"  /> --%>
							</td>
						</tr>
						<c:if test="${'modi' eq bizIntroVO.cmd}">
						<tr>
							<th>
								<span class="star_t"></span>
								최종수정일
							</th>
							<td colspan="3">
								${bizIntroVO.lastUpdusrPnttm}
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="star_t"></span>
								작성자
							</th>
							<td colspan="3">
								${bizIntroVO.lastUpdusrNm}
							</td>
						</tr>
						</c:if>
					</table>
				</div>
				<!-- 버튼 시작(상세지정 style로 div에 지정) -->
				<div class="main1_btn_div">
					<button class="main1_btn" onclick="javascript:fn_egov_select_noticeList(); return false;">목 록</button>
					<c:if test="${bizIntroVO.cmd eq 'regi'}" >
						<button class="main1_btn main1_save_btn" id="main1_save_btn" onclick="javascript:fn_egov_regist_notice('regi'); return false;">등 록</button>
					</c:if>
					<c:if test="${bizIntroVO.cmd eq 'modi'}" >
						<button class="main1_btn main1_save_btn" id="main1_save_btn" onclick="javascript:fn_egov_regist_notice('modi'); return false;">수 정 </button>
						<button class="main1_btn main1_delete_btn" id="main1_delete_btn" onclick="javascript:fn_egov_delete_notice(); return false;">삭 제</button>
					</c:if>
				</div>
				<!-- 버튼 끝 -->
			</form>
		</div>
	</div>
	<!-- //content 끝 -->
	<form name="searchForm" method="get" action="<c:url value='/cop/bbs/selectBizIntroList.do'/>" ></form>
	<form name="delForm" method="get" action="<c:url value='/cop/bbs/bisIntroDelete.do'/>" >
		<input type="hidden" name="bbsId" value="${bizIntroVO.bbsId}" />
		<input type="hidden" name="del" value="${bizIntroVO.nttId}"/>
	</form>
	
</body>
</html>

