<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="kcg.faics.cmmn.service.CodeService" %>
<form:form commandName="corpVO" id="detailForm" name="detailForm" enctype="multipart/form-data">
	<form:hidden path="orgId" />
	<form:hidden path="grpNo" />
	<form:hidden path="writer" />
	<form:hidden path="writerPlace1" />
   	<div id="table">
   	<table class="tb">
   		<colgroup>
   			<col width="150"/>
   			<col width="?"/>
   		</colgroup>
   		<tr>
   			<td class="tbtd_caption">
   				<label for="title"><c:out value="${fieldNameMap['place1str']}" /></label>
   			</td>
   			<td class="tbtd_content">
   				<c:choose>
   					<c:when test="${registerFlag == 'create' and loginUserVO.place1 eq 'PS00'}">
	   					<form:select path="place1" cssClass="use">
							<c:forEach var="result" items="${placeList}" varStatus="status">
								<form:option value="${result.code2}" label="${result.codenm}" />
							</c:forEach>
		    			</form:select>
   					</c:when>
   					<c:otherwise>
   						<c:out value="${corpVO.place1str}" />
   						<form:hidden path="place1" />
   					</c:otherwise>
   				</c:choose>
   			</td>
   		</tr>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.name}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="name" cssClass="txt" />
   			</td>
   		</tr>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.location}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="location" cssClass="txt" />
   			</td>
   		</tr>
   		<c:if test="${corpVO.grpNo eq '03'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.shipCnt}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="shipCnt" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<c:if test="${corpVO.grpNo ne '01'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.ceo}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="ceo" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<c:if test="${corpVO.grpNo eq '04' or corpVO.grpNo eq '05'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.jobType}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="jobType" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<c:if test="${corpVO.grpNo eq '03'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.memberCnt}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="memberCnt" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<c:if test="${corpVO.grpNo eq '05'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.partner}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="partner" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<c:if test="${corpVO.grpNo eq '03'}">
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.basicYear}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="basicYear" cssClass="txt" />
   			</td>
   		</tr>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.fund}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="fund" cssClass="txt" />
   			</td>
   		</tr>
   		</c:if>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.tel}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="tel" cssClass="txt" />
   			</td>
   		</tr>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.fax}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="fax" cssClass="txt" />
   			</td>
   		</tr>
   		<tr>
   			<td class="tbtd_caption"><label for="title"><c:out value="${fieldNameMap.comments}" /></label></td>
   			<td class="tbtd_content">
   				<form:input path="comments" cssClass="txt" />
   			</td>
   		</tr>
   	</table>
    </div>
   	<div id="sysbtn">
   		<ul>
   			<li>
            	<span class="btn_blue_l">
	      			<c:choose>
		      			<c:when test="${registerFlag == 'modify'}">
		       				<a href="<c:url value='/target/corp/view.do'>
                				<c:param name="orgId" value="${corpVO.orgId}" />
                				<c:param name="orgNo" value="${corpVO.orgNo}" />
                				<c:param name="place1" value="${corpVO.place1}" />
                			 </c:url>"><spring:message code="button.cancel" /></a>
		       			</c:when>
		       			<c:otherwise>
			    			<a href="<c:url value='/target/corp/list.do'>
                				<c:param name="orgId" value="${corpVO.orgId}" />
                				<c:param name="grpNo" value="${corpVO.grpNo}" />
                				<c:param name="place1" value="${corpVO.place1}" />
                			 </c:url>"><spring:message code="button.cancel" /></a>
	       				</c:otherwise>
       				</c:choose>
                    <img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code="button.cancel" />"/>
               	</span>
            </li>            
   			<li>
            	<span class="btn_blue_l">
                   	<a href="javascript:fn_save();">
                       	<c:if test="${registerFlag == 'create'}">
                       		<spring:message code="button.goCreate" />
                       		<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code="button.goCreate" />"/>
                       	</c:if>
                       	<c:if test="${registerFlag == 'modify'}">
                       		<spring:message code="button.goModify" />
                       		<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code="button.goModify" />"/>
                       	</c:if>
                   	</a>
               	</span>
          	</li>
   		</ul>
   	</div>
</form:form>


<script type="text/javascript" src="<c:url value='/validator.do'/>"></script>
<validator:javascript formName="corpVO" staticJavascript="false" xhtml="true" cdata="false"/>
<script type="text/javaScript" defer="defer">
<!--
	function fn_save() {
		var frm = document.detailForm;
		if (!validateCorpVO(frm)) {
			return;
		} else {
			frm.submit();
		}
	}
	-->
</script>