<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ page import="com.csc.library.database.*,com.csc.library.session.*,com.csc.library.utilities.*"  %>
<%@ include file="../CHECKPROFILE.jsp" %>
<% request.setCharacterEncoding("UTF-8"); %>
<%
  CheckNull chk = new CheckNull();
  UProfile up = null;
  if (session != null){
    up = (UProfile)session.getAttribute("userprofile");
  }
%>
<html ng-app='APS_INTERVIEW'>
<head>
  <title>Employee View</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <style>
    .csc-content .center{
      padding-top: 5px !important;
      padding-bottom: 5px !important;
    }
  </style>
</head>
<body>
<div class='bg-com'></div>
<jsp:include page="EMV_HEADMENU.jsp" flush="true" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/EMPVIEW/css/APP_UP/style_apsup.css" />
<link rel="stylesheet" href="css/Recruit.css"/>
<script type="text/javascript" src='../public/lib/angular-resource/angular-resource.min.js'></script>

<script type='text/javascript' src='JS/APS_INTERVIEW/Module.Controller.js'></script>
<script type='text/javascript' src='../RECRUIT/js/services.js'></script>
<script type='text/javascript' src='JS/APS_INTERVIEW/services.js'></script>
<script type='text/javascript' src='JS/APS_INTERVIEW/ListCandidate.Controller.js'></script>
<script type='text/javascript'>
  setLang('<%=up.get("lang")%>')
  $(function () {
    let now = '<%=new CscCalendar().getYYYYMMDD()%>'
    let user = '<%=up.get("user")%>'
    let dbName = '<%=up.getDbName()%>'
    let scope = angular.element(document.cscform).scope()
    scope.$apply(function () {
      scope.dbName = dbName
      scope.now = now
      scope.user = user
    })
  })
</script>

<section  ng-controller='listCandidate'>
  <div class="container csc-content">
    <form name="cscform" class="form-horizontal" method="post">
      <div ng-hide="isReady" class='loading-page'>
        <div class='spiner'></div>
      </div>
      <input type='hidden' name='candidateid'/>
      <input type='hidden' name='judge'/>
      <input type='hidden' name='jobid'/>
      <input type='hidden' name='committeeid' value='<%=up.get("employeeid")%>' />
      <input type='hidden' name='lang' value="<%=up.get("lang")%>"/>
      <input type="hidden" name="__applicantid">
      <input type="hidden" name="__action">
      <input type="hidden" name="__screen">
      <input type="hidden" name="__fixCon">




      <div class="csc-block">
        <div class="center">
          <h2 class="csc-block-head">รายชื่อผู้สมัคร</h2>
        </div>
        <%-- search applicantid--%>
        <div class="row">
          <div class="form-group">
            <div class="col-xs-4">
              <label class="control-label label-right">เลขที่ผู้สมัครงาน</label>
            </div>
            <div class="col-xs-8">
              <div class="col-xs-8">
                <input class="form-control helpReturn"  ng-model="search.candidateid" type="text"/>
              </div>
            </div>
          </div>
        </div>
        <%-- search name--%>
        <div class="row">
          <div class="form-group">
            <div class="col-xs-4">
              <label class="control-label label-right">ชื่อ / นามสกุลผู้สมัครงาน</label>
            </div>
            <div class="col-xs-8">
              <div class="col-xs-3">
                <input class="form-control helpReturn" placeholder="ชื่อ" ng-model="search.fullname" type="text"/>
              </div>
              <div class="col-xs-5">
                <input class="form-control helpReturn" placeholder="นามสกุล" ng-model="search.fullname" type="text"/>
              </div>
            </div>
          </div>
        </div>
        <div class="center">
          <button class="btn btn-primary" ng-click="search = {}; helpDesc = {}">ล้างข้อมูล</button>
        </div>
      </div>

      <div class="table-responsive">
        <table class="table table-head table-hover table-bordered table-title-left" >
          <thead>
          <tr>
            <th class="table-title" colspan="11">รายชื่อผู้สมัครงาน</th>
          </tr>
          <tr>
            <th swlang code='SW000193'>seq</th>
            <th>
              <a ng-click="sortBy('candidateid')" swlang code='SW002159'>candidateid</a>
              <span class="sortorder" ng-show="propertyName === 'candidateid'" ng-class="{reverse: reverse}"></span>
            </th>
            <th>
              <a swlang code='SW001984' ng-click="sortBy('fullname')">Fullname</a>
              <span class="sortorder" ng-show="propertyName === 'fullname'" ng-class="{reverse: reverse}"></span>
            </th>
            <th swlang code='SW000057'>Position</th>
            <th swlang code='SW000139'>Internal</th>
            <th swlang code='SW000019'>Status</th>
            <th>
              <a swlang code='SW002381' ng-click="sortBy('apsdate')">Date of valuation</a>
              <span class="sortorder" ng-show="propertyName === 'apsdate'" ng-class="{reverse: reverse}"></span>
            </th>
            <th swlang code='SW000639'>location</th>
            <th swlang code='SW013315'>Assessor's Sequence</th>
            <th swlang code='SW013316'>Previous Assessor Status</th>
            <th swlang code='SW000302'>Remark</th>
          </tr>
          </thead>
          <tbody>
          <tr ng-repeat="list in listcandidate  | filter : search | orderBy:propertyNameIn:reverseIn">
            <td class='center'>{{ $index+1 }}</td>
            <td class='center'>{{list.candidateid}}</td>
            <td>
              <a style="color: #4d4d4d !important;" ng-click='goPage(list)' ng-hide='list.ispass == "0"'>{{ list.fullname }}</a>
              <span ng-show='list.ispass == "0"'>{{ list.fullname }}</span>
            </td>
            <td class='center'>{{ list.job }}</td>
            <td class='center'>{{ internal_desc[list.internal].desc[lang] }}</td>
            <td class='center'>{{status_desc[list.status].desc[lang]}}</td>
            <td class='center'>{{ list.apsdate }}</td>
            <td class='center'><span ng-if="list.detail.hasOwnProperty('address')">{{list.detail.address}}</span></td>
            <td class='center'>{{ list.state }}</td>
            <td class='center'>{{p_status_desc[list.previous_status].desc[lang]}}</td>
            <td class='center'>{{ ispass_desc[list.ispass].desc[lang] }}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </form>
  </div>
  <a href="#top" id="top-button">
    <i class="fa fa-angle-up"></i>
    <div class="top-word">Back to top</div>
  </a>
</section>
<jsp:include page="FOOTER.jsp" flush="true" />
</body>
</html>