<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="../../inc/std_imports.jsp" %>

<oneit:dynIncluded>
<%
    ObjectTransaction   objTran         = process.getTransaction ();
    String              nextPage        = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
    JobApplication      jobApplication  = (JobApplication) process.getAttribute("JobApplication");
    Job                 job             = jobApplication.getJob();
    
%>
    <script>
        $(document.body).addClass('bg-color');
    </script>
    
    <div class="main-application-outline">
        <div class="selection-aust-logo">
            <img src="images/australia-post.png" />
            <span><oneit:toString value="<%= job.getJobTitle() %>"  mode="EscapeHTML"/></span>
        </div>
        <div class="show-mobile-title">
            <div class="mobile-title-page">Section 1 - Selection Criteria</div>
            <div class="mobile-estimated">Estimated time to complete: <b>5 mins</b></div>
        </div>
        <div class="section-title m-hide">Section 1</div>
        <div class="section-c-title m-hide">
            Selection Criteria
        <span>Estimated time to complete: <b>5 mins</b></span>
        </div>
        <div class="section-tab-view">
            <div class="main-tab-form">
                <ul class="nav nav-pills nav-justified">
                    <li class="active"><a href="#"><span>1</span><div class="mobile-hide">Selection Criteria</div></a></li>
                    <li><a href="#"><span>2</span><div class="mobile-hide">Workplace Culture</div></a></li>
                    <li><a href="#"><span>3</span><div class="mobile-hide">Job Match Assessment</div></a></li>
                    <li><a href="#"><span>4</span><div class="mobile-hide">Submit Application</div></a></li>
                </ul>
            </div>
            <div class="section-page-area">
                <div class="main-sc-section">
                    <p>
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper at magna a
                        tristique. Ut ut magna ut mauris sagittis placerat. Suspendisse vitae tempus sem. Lorem
                        ipsum dolor sit amet, consectetur adipiscing elit.
                    </p>
                </div>         
                <%
                    for(CriteriaType ct: CriteriaType.getCriteriaTypeArray())
                    {
                        List<AssessmentCriteriaAnswer>  answerList  = jobApplication.getACAnswersByType(ct);

                        if(!answerList.isEmpty())
                        {
                %>
                            <div class="selection-br-line"></div>
                            <div class="main-sc-section">
                                <div class="selection-form-title"><oneit:toString value="<%= ct %>" mode="EscapeHTML"/></div>
                                <%
                                    for(AssessmentCriteriaAnswer answer: answerList)
                                    {
                                        String  optionKey   = WebUtils.getInputKey(request, answer, AssessmentCriteriaAnswer.FIELD_Answer);
                                %>
                                        <div class="form-group-new question-y-n">
                                            <label class="second-label"><oneit:toString value="<%= answer.getAssessmentCriteria() %>" mode="EscapeHTML"/></label>
                                            <div class="radio radio-primary second-radio-primary">
                                                <input type="radio" name="<%= optionKey %>" value="y" id="radio5" <%= answer.getAnswer() == true ? "selected" : " %>/>
                                                <input type="radio" name="radio30" id="radio5" value="option1" checked="">
                                                <label for="radio5">
                                                    Yes
                                                </label>
                                            </div>
                                            <div class="radio radio-primary second-radio-primary">
                                                <input type="radio" name="<%= optionKey %>" value="n" id="radio6" <%= answer.getAnswer() == false ? "selected" : " %>/>
                                                <input type="radio" name="radio30" id="radio6" value="option1" checked="">
                                                <label for="radio6">
                                                    No
                                                </label>
                                            </div>
                                        </div>              
                                        <div class="textarea-box">
                                            <textarea class="form-control second-style" placeholder="Please add any notes to support your answer"></textarea>
                                        </div>
                                <%
                                    }
                                %>
                            </div>
                <%
                        }
                    }
                %>
                <div class="selection-br-line"></div>
                <div class="main-sc-section btn-remove-padd">
                    <div class="section-btn text-center">
                        <input type="button" class="box-btn-gray" value="Save and exit" />
                        <input type="button" class="box-btn" value="Proceed to step 2" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</oneit:dynIncluded>