<%@ 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" %>

<oneit:dynIncluded>
<%
    String  nextPage    =   WebUtils.getSamePageInRenderMode(request, "SignIn");
    Job     job         =   (Job) process.getAttribute("Job");
    String  id          =   request.getParameter("id");
    String  key         =   request.getParameter("key");
    
    if(id != null && key != null)
    {
        job = Job.searchJobKey(transaction, Long.parseLong(id), key);
    }
    
    if(job != null)
    {
%>
        <style>
            .row {
                padding-bottom: 30px;
            }
            .power-footer {
                background-color:#fff;
            }
        </style>
        
        <div class="main-position-overview">
        <%
            BinaryContent   logo    =   job.getLogo();

            if(logo != null)
            {
                int logoHeight  =   45;
        %>
                <div class="aust-logo">
                    <tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
                </div>
        <%
            }
        %>
            <div class="overview-title">
                <oneit:toString value="<%= job.getJobTitle() %>"   mode="EscapeHTML"/>
            </div>
            <%
                if(job.getReferenceNumber() != null)
                {
            %>  
                    <div class="ref-number">
                        Ref: <oneit:toString value="<%= job.getReferenceNumber() %>"    mode="EscapeHTML"/>
                    </div>
            <%
                }
            %>
            
            <table class="table table-responsive pos-table">
                <tbody>
                    <tr>
                        <td class="pos-tabel-td">Location:</td>
                        <td class="pos-tabel-second"><oneit:toString    value="<%= job.getLocation() %>"    mode="EscapeHTML"   nullValue="-"/></td>
                    </tr>
                    <tr>
                        <td class="pos-tabel-td">Type:</td>
                        <td class="pos-tabel-second"><oneit:toString    value="<%= job.getJobType() %>" mode="EscapeHTML"   nullValue="-"/></td>
                    </tr>
                    <tr>
                        <td class="pos-tabel-td">Apply by:</td>
                        <td class="pos-tabel-second"><oneit:toString    value="<%= job.getApplyBy() %>" mode="MidDate"      nullValue="-"/></td>
                    </tr>
                </tbody>
            </table>

            <div class="job-detail-title">
              Job Details
            </div>

            <div class="pos-content">
                <oneit:toString value="<%= job.getJobDescription() %>"  mode="ParagraphHTML"    nullValue="-"/>
            </div>
            
            <oneit:form name="applyJob" method="post" enctype="multipart/form-data">
                <div class="apply-job-btn">
                    <oneit:button   value="Apply Now"   name="gotoPage" skin="link" 
                                    requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                </div>
            </oneit:form>
        </div>
<%
    }
    else
    {
%>
        <div class="main-position-overview">
            <p class="overview-title" align="center">Job is either deleted, or has expired.</p>
        </div>
<%
    }
%>
</oneit:dynIncluded>
