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

<%
    Job             job         =   (Job) process.getAttribute("Job");
    String          currentPage =   (String) getData(request, "currentPage");
    AppSortOption   appSortOpt  =   (AppSortOption) getData(request, "sortOption");
    String          tabNumber   =   (String)  getData(request, "tabNumber");
    Boolean         expand      =   getData(request, "expand")!=null ? (Boolean)  getData(request, "expand") : Boolean.FALSE;

%>

<oneit:dynIncluded>

    <div class="main-applicants-filter">
        <div class="appli-list-shorting">
            <div class="appli-shorting-dropdown appli-left">
                <span class="appli-order-label">Bulk Update</span>
                <select class="form-control">
                    <option>To Shortlist</option>
                </select>
            </div> 
            <%
                if(tabNumber != null)
                {
                    String  firstTab    =   WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_SHORTLIST);
                    String  secondTab   =   WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_GRID);
            %>
                    <div class="appli-filter">
                        <ul class="">
                            <li class="lable-appli-shorting">View</li>
                            <li class="<%= (tabNumber == "1" ? "active" : "" ) + " short-list"%>">
                                    <oneit:button   value="List"   name="gotoPage" skin="link"
                                    requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstTab)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                            </li>
                            <li class="<%= (tabNumber == "2" ? "active" : "" ) + " grid-list"%>">
                                    <oneit:button   value="Grid"   name="gotoPage" skin="link"
                                    requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondTab)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                            </li>
                        </ul>
                    </div>
                    <div class="appli-shorting-dropdown">
                        <span class="appli-order-label">Export</span>
                        <select class="form-control">
                            <option>PDF</option>
                            <option>CSV</option>
                            <option>XML</option>
                        </select>
                    </div>
            <%
                }
            %>
            <div class="appli-shorting-dropdown">
                <span class="appli-order-label">order by</span>
                <select class="form-control"    onChange="location=this.value">
                <%
                    for (AppSortOption  sortOption : AppSortOption.getAppSortOptionArray())
                    {
                        String  optionLink  =   currentPage + "&JobID=" + job.getID() + "&AppSortOption=" + sortOption.getName() 
                                                + (expand ? "&Expand=Y" : "");
                %>
                        <option <%= (appSortOpt != null && appSortOpt == sortOption ? "selected" : "" )%>  value="<%= optionLink %>">
                            <oneit:toString value="<%= sortOption.getDescription() %>"   mode="EscapeHTML"/>
                        </option>
                <%
                    }
                %>
                </select>
            </div>
        </div>
    </div>
        
</oneit:dynIncluded>
