<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
    <br/>
    <br/>
    <sec:authorize access="hasRole('ADMIN')">
    <smvc:form action="../admin/formSequenceEdit.form" modelAttribute="formSequence"  method="post" id="formSequenceEdit" >
        <input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
        <table>
            <tr>
                <td class="error"><smvc:errors></smvc:errors></td>                
            </tr>
            <spring:bind path="name">		         
		         <c:if test="${status.error}"> 
		         		<tr>
			                <td class="error">Please specify a valid name.</td>                
			            </tr>
			     </c:if>
		      </spring:bind>
            <spring:bind path="increment">		         
		         <c:if test="${status.error}"> 
		         		<tr>
			                <td class="error">Please specify a proper increment value.</td>                
			            </tr>
			     </c:if>
		      </spring:bind>
		       <spring:bind path="formatMask">		         
		         <c:if test="${status.error}"> 
		         		<tr>
			                <td class="error">Please specify a proper formatMask value.</td>                
			            </tr>
			     </c:if>
		      </spring:bind>
		      
		       <spring:bind path="currentValue">		         
		         <c:if test="${status.error}"> 
		         		<tr>
			                <td class="error">Please specify a proper value in currentValue.</td>                
			            </tr>
			     </c:if>
		      </spring:bind>
            
        </table>
        
        <c:if test="${formSequenceSaved != NULL}">               	 	
	        <table border="0" align="center" class="message" >
                  <tr>
                  	<td colspan="2"><c:out value="${formSequenceSaved}"/></td>
                  </tr>  
		    </table>
		</c:if>
		
        <fieldset style="width: 520px" class="nobg">
            <legend>Edit Form Sequence</legend>
            <fieldset>
                <table>
                    <tr>
                        <td colspan="9"><B>Edit Form Sequence</B></td>
                    </tr>
                      <tr>
                        <td colspan="9">&#160;</td>
                    </tr>
                </table>
                <table width="100%" border = "1" bordercolor="#F8F8FF">
                    <tr>
                        <td width="10%"><B>Name :</B></td>
                        <td width="10%">
                        	<smvc:input path="name" maxlength="240" size="20" />
                        	<c:if test="${not empty formSequence.id}"><smvc:hidden path="id"/></c:if>
                        </td>
                    </tr>
                     <tr>
                        <td width="10%"><B>Prefix :</B></td>
                        <td width="10%"><smvc:input path="prefix" maxlength="240" size="20" /> ex: PR-</td>
                    </tr>
                     <tr>
                        <td width="10%"><B>Suffix :</B></td>
                        <td width="10%"><smvc:input path="suffix" maxlength="240" size="20" /> ex: /SS</td>
                    </tr>
                     <tr>
                        <td width="10%"><B>Increment :</B></td>
                        <td width="10%"><smvc:input path="increment" maxlength="240" size="20" /> ex: 1	</td>
                    </tr>
                     <tr>
                        <td width="10%"><B>Current Value:</B></td>
                        <td width="10%"><smvc:input path="currentValue" maxlength="240" size="20" /> ex: 0</td>
                    </tr>
                     <tr>
                        <td width="10%"><B>Format Mask** :</B></td>
                        <td width="10%"><smvc:input path="formatMask" maxlength="240" size="20" /> ex: 000000</td>
                    </tr>
                </table>
                    
                <table width="100%" >
                     <tr>
                         <td colspan="9">&#160;</td>
                    </tr>
                    <tr>
                         <td colspan="9">**If current value is 123 and format mask is 000000, number will show as 000123</td>
                    </tr>
                </table>
            </fieldset>
            <fieldset class="buttonFieldset">
				<table width="100%">
					<tr>
						<td align="left">
	                		<input type="button" value="Back To Auto Sequences" onclick="location.href='../admin/formSequenceList.form'" />
						</td>
						<td align="right">
	                		<input type="submit" value="Submit" onclick="showPleaseWait();" />
						</td>
					</tr>
				</table>
            </fieldset>
        </fieldset>        
   

                
    </smvc:form></sec:authorize>
