<%@ 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="/extensions/performa/inc/stdimports.jsp" %>
<%@page import="oneit.utils.text.FormatUtils"%>

<oneit:dynIncluded>
<%
    JobApplication          jobApplication  =   (JobApplication) process.getAttribute("JobApplication");
    List<JobApplication>    applications    =   (List<JobApplication>) process.getAttribute("Applications");
    
    if(request.getParameter("JobApplicationID")!=null)
    {
       jobApplication  =  JobApplication.getJobApplicationByID(transaction, Long.parseLong(request.getParameter("JobApplicationID")));
       
        process.setAttribute("JobApplication", jobApplication);
        process.setAttribute("Job", jobApplication.getJob());
    }
    
    Debug.assertion(jobApplication != null, "JobApplication is null in admin portal view applicants");
    
    Job             job             =   jobApplication.getJob();
    String          samePage        =   WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
    
    
    //to navigation between applications
    if(applications==null)
    {
        applications    =   Utils.getApplicationsSorted(job.getJobApplicationsSet().toArray(new JobApplication[job.getJobApplicationsSet().size()]), AppSortOption.RANK);
        process.setAttribute("Applications", applications);
    }
    
    int                     appPosition     =   applications.indexOf(jobApplication);
    int                     prevNo          =   appPosition - 1;
    int                     nextNo          =   appPosition + 1;
    JobApplication          prevApp         =   prevNo<0 ? applications.get(applications.size()-1) : applications.get(prevNo);
    JobApplication          nextApp         =   nextNo>=applications.size() ? applications.get(0) : applications.get(nextNo);
%>

<script type="text/javascript">
    $(document).ready(function()
    {
        $('.percent-red-b').percentageLoader({
            valElement: 'p',
            strokeWidth: 15,
            bgColor: '#e5e8eb',
            ringColor: '#f9623d',
            textColor: '#4a4a4a',
            fontSize: '30px',
            fontWeight: 'normal',
            showPercent: false
        });
        $('.percent-yellow-b').percentageLoader({
            valElement: 'p',
            strokeWidth: 15,
            bgColor: '#e5e8eb',
            ringColor: '#ffd14c',
            textColor: '#4a4a4a',
            fontSize: '30px',
            fontWeight: 'normal',
            showPercent: false
        });
        $('.percent-green-b').percentageLoader({
            valElement: 'p',
            strokeWidth: 15,
            bgColor: '#e5e8eb',
            ringColor: '#03ac66',
            textColor: '#4a4a4a',
            fontSize: '30px',
            fontWeight: 'normal',
            showPercent: false
        });
        
        $('.percent-green').percentageLoader({
            valElement: 'p',
            strokeWidth: 15,
            bgColor: '#e5e8eb',
            ringColor: '#41bdb4',
            textColor: '#4a4a4a',
            fontSize: '30px',
            fontWeight: 'normal',
            showPercent: false
        });
        $('.percent-blue').percentageLoader({
            valElement: 'p',
            strokeWidth: 15,
            bgColor: '#e5e8eb',
            ringColor: '#fbd44e',
            textColor: '#4a4a4a',
            fontSize: '30px',
            fontWeight: 'normal',
            showPercent: false
        });
        
    });
</script>

<oneit:form name="jobApplication" method="post"    enctype="multipart/form-data">
        
    <div class="dashboard-content-area">
        <div class="first-part">
            <oneit:dynInclude   page="/extensions/adminportal/inc/job_title_bar.jsp"   data="<%= CollectionUtils.EMPTY_MAP%>"/>
        </div>
        <div class="second-part v-applicant-area">
            <oneit:dynInclude   page="/extensions/adminportal/inc/view_application_tab_applicant.jsp"   
                                data="<%= CollectionUtils.mapEntry("prevAppID", prevApp.getObjectID())
                                                        .mapEntry("nextAppID", nextApp.getObjectID()).toMap() %>"/>
        </div>
    </div>
</oneit:form>

</oneit:dynIncluded>