<%@ 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 == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
    Job                 job     = (Job) process.getAttribute("Job");

    if(job == null)
    {
        job = Job.createJob(objTran);

        process.setAttribute("Job", job);

        %><%@include file="/saferedirect.jsp" %><%
    }

    Level[] levels      = Level.SearchByAll().search(objTran);
    String  secondPage  = HTTPRequestDetails.getFullURL(WebUtils.getSamePageInRenderMode(request, PerformaArticleUtil.ASSESSMENT_CRITERIA), ProcessDecorator.getRequestParameters(request, new String[0]), "");
    String  thirdPage   = HTTPRequestDetails.getFullURL(WebUtils.getSamePageInRenderMode(request, PerformaArticleUtil.WORKPLACE_CULTURE), ProcessDecorator.getRequestParameters(request, new String[0]), "");
    String  fourthPage  = HTTPRequestDetails.getFullURL(WebUtils.getSamePageInRenderMode(request, PerformaArticleUtil.JOB_MATCH), ProcessDecorator.getRequestParameters(request, new String[0]), "");
    String  fifthPage   = HTTPRequestDetails.getFullURL(WebUtils.getSamePageInRenderMode(request, PerformaArticleUtil.JOB_REVIEW), ProcessDecorator.getRequestParameters(request, new String[0]), "");

%>
    <oneit:form name="editJob" method="post"    enctype="multipart/form-data">
        <div class="container-fluid">
        <%
            oneit.servlets.jsp.FormInformation     fi = oneit.servlets.jsp.FormJSP.getFormInformation (request);

            if (fi != null && fi.hasErrors ())
            {
        %>
                <div class="alert alert-danger">
                    <oneit:multifieldtext prefixTextName="pageHeader_errorPrefix" suffixTextName="pageHeader_errorSuffix" fieldTextName="pageHeader_errorText" deriveAllFields="true"/>
                </div>
        <%
            }
        %>
            <h1 class="page-title">Create a job <span class="active-time">(Active for 30 days)</span> </h1>
            <div class="main-tab-form">
                <ul class="nav nav-pills nav-justified">
                    <li class="active">
                        <a href="#"><span><%= job.jobDetailsCompleted() ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
                            Job Detail
                        </a>
                    </li>
                    <li class="<%= job.assessmentCompleted() ? "complate" : ""%>">
                        <a href="<%= secondPage %>"><span><%= job.assessmentCompleted() ? "<img src=\"images/right-mark.png\" />" : "2"%></span>
                            Assessment Criteria
                        </a>
                    </li>
                    <li class="<%= job.cultureCompleted() ? "complate" : ""%>">
                        <a href="<%= thirdPage %>"><span><%= job.cultureCompleted() ? "<img src=\"images/right-mark.png\" />" : "3"%></span>
                            Workplace Culture
                        </a>
                    </li>
                    <li class="<%= job.jobMatchCompleted() ? "complate" : ""%>">
                        <a href="<%= fourthPage %>"><span><%= job.jobMatchCompleted() ? "<img src=\"images/right-mark.png\" />" : "3"%></span>
                            Job Match Assessment
                        </a>
                    </li>
                    <li>
                        <a href="<%= fifthPage %>"><span>5</span>
                            Review and Submit
                        </a>
                    </li>
                </ul>
            </div>
            <div class="form-page-area">
                <div class="create-job">
                    <div class="form-group">
                        <select class="form-control">
                            <option>Optional: Use a previously created Job as a template</option>
                            <option>One 1</option>
                            <option>One 2</option>
                            <option>One 3</option>
                        </select>              
                    </div>
                    <div class="form-group">
                        <label>Job Title</label>
                        <oneit:ormInput obj="<%= job %>"    type="text" attributeName="JobTitle"    cssClass="form-control" />                                
                    </div>
                    <div class="form-group">
                        <label>Job Description</label>
                        <oneit:ormtextarea    obj="<%= job %>"  attributeName="JobDescription"  cssClass="form-control textarea-box"/>
                    </div>
                    <div class="form-brack-line"></div>
                    <div class="">
                        <div class="optional-title">OPTIONAL</div>
                        <div class="row">
                            <div class="col-sm-6 col-xs-12 form-group">
                                <label>Client</label>
                                <select class="form-control">
                                    <option>Please Select or Add New</option>
                                    <option>One 1</option>
                                    <option>One 2</option>
                                    <option>One 3</option>
                                </select> 
                            </div>              
                            <div class="col-sm-6 col-xs-12 form-group">
                                <label>Reference Number</label>
                                <input type="text" class="form-control" />
                            </div>         
                        </div>     
                    </div>
                    <div class="text-center">
                        <oneit:button   value="Proceed to Assessment Criteria"  name="gotoPage" cssClass="btn btn-primary" 
                                            requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
                                                                                .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap()).toMap() %>"/>
                    </div>
                </div>
            </div>
        </div>
    </oneit:form>
</oneit:dynIncluded>
