postulantes.jsp 16.2 KB
Newer Older
Joel Florentin committed
1
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"  %>  
Joel Florentin committed
3 4
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
5 6
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<layout:extends name="layouts/base.jsp">
7 8 9 10 11
    <layout:put block="cssDeclaracion" type="APPEND">
    <link href="../css/PostulanteStyle.css" rel="stylesheet" type="text/css"/> 
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

    </layout:put>
12 13 14
    <layout:put block="contents" type="REPLACE">
      <h2>Lista de Postulantes</h2>
      <div id="buscador">
willgonzz committed
15
        <form name="buscador">
16 17 18 19 20 21 22 23 24
          <div class="row justify-content-start gy-2">
            
            <div class="col-auto">
              <input type="text" placeholder="Nombre" name="nombre" id="nombre" class="form-control" value="${param.nombre}">
            </div>
            <div class="col-auto">
              <button class="btn btn-primary">Buscar</button>
            </div>
          </div>
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
          <table class="w3-table ">
            <thead>
                <tr class="">
                  <th scope="col">Estado</th>
                  <th scope="col">Disponbilidad</th>
                  <th scope="col">Nivel de ingles</th>
                  <th scope="col">Institucion Educativa</th>
                  <th scope="col">Tecnologias</th>
                  <th scope="col">Nivel de Tecnologia</th>
                  <th scope="col">Experiencia general</th>
                  <th scope="col">Cargo</th>
                  <th scope="col">Convocatoria</th>
                </tr>
              </thead>
              <tbody>
                  <td>
                    <select class="form-select form-select-sm" name="estado" id="estado">
                      <option value="">Seleccione</option>
                      <c:forEach items="${estadoP}" var="estados">
                        <option value="${estados}" ${param.estado == estados ? "selected" : ""}>${estados.getEstado()}</option>
                      </c:forEach>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="dispo" id="dispo">
                      <option value="">Seleccione</option>
                      <c:forEach items="${disponibilidades}" var="disponibilidad">
                        <option value="${disponibilidad}" ${param.dispo == disponibilidad ? "selected" : ""}>${disponibilidad.getDescripcion()}</option>
                      </c:forEach>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="lvlEng" id="lvlEng">
                      <option value="">Seleccione</option>
                      <c:forEach var = "lvl" begin = "1" end = "5">
                        <option value="${lvl}" ${param.lvlEng == lvl ? "selected" : ""}>${lvl}</option>
                      </c:forEach>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="instId" id="instId">
                      <option value="">Seleccione</option>
                      <c:forEach items="${institucionesEducativas}" var="inst">
                        <option value="${inst.id}" ${param.instId == inst.id ? "selected" : ""}>${inst.nombre}</option>
                      </c:forEach>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="tecId" id="tecId">
                      <option value="">Seleccione</option>
                      <c:forEach items="${tecnologias}" var="tecnologia">
                        <option value="${tecnologia.id}" ${param.tecId == tecnologia.id ? "selected" : ""}>${tecnologia.nombre}</option>
                      </c:forEach>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm" name="lvlTec" id="lvlTec">
                      <option value="">Seleccione</option>
                      <c:forEach var = "lvl" begin = "1" end = "5">
                        <option value="${lvl}" ${param.lvlTec == lvl ? "selected" : ""}>${lvl}</option>
                      </c:forEach>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="expInMonths" id="expInMonths">
                      <option value="">Seleccione</option>
                      <option value="6">Mayor a 6 meses</option>
                      <option value="12">Mayor a 1 año</option>
                      <option value="36">Mayor a 3 años</option>
                      <option value="60">Mayor a 5 años</option>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="cargoId" id="cargoId">
                      <option value="">Seleccione</option>
                      <c:forEach items="${cargos}" var="cargo">
                        <option value="${cargo.id}" ${param.cargoId == cargo.id ? "selected" : ""}>${cargo.getNombre()}</option>
                      </c:forEach>
                    </select>
                  </td>
                  <td>
                    <select class="form-select form-select-sm " name="convId" id="convId">
                      <option value="">Seleccione</option>
                    </select>
                  </td>
              </tbody>
          </table>
         <!-- <div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 gy-1 mt-2">
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242

           <div class="col">
  
             <div class="row">
               <div class="col-auto col-md-4">
                <label class="form-label" for="estado">Estado</label>

               </div>
               <div class="col-auto col-md-8">
                <select class="form-select form-select-sm " name="estado" id="estado">
                  <option value="">Seleccione una opcion</option>
                  <c:forEach items="${estadoP}" var="estados">
                    <option value="${estados}" ${param.estado == estados ? "selected" : ""}>${estados.getEstado()}</option>
                  </c:forEach>
                </select>
               </div>
          </div>
            
  
           </div>
           
             <div class="col">

               <div class="row">
                 <div class="col-auto col-md-4">
                   <label class="form-label" for="dispo">Disponbilidad</label>
   
                 </div>
                 <div class="col-auto col-md-8">
                   <select class="form-select form-select-sm " name="dispo" id="dispo">
                     <option value="">Seleccione una opcion</option>
                     <c:forEach items="${disponibilidades}" var="disponibilidad">
                       <option value="${disponibilidad}" ${param.dispo == disponibilidad ? "selected" : ""}>${disponibilidad.getDescripcion()}</option>
                     </c:forEach>
                   </select>
                 </div>
               </div>
             </div>
             <div class="col">
              <div class="row">
                <div class="col-auto col-md-4">
                  <label class="form-label" for="lvlEng">Nivel de Ingles</label>
                </div>
                <div class="col-auto col-md-8">
                  <select class="form-select form-select-sm " name="lvlEng" id="lvlEng">
                    <option value="">Seleccione una opcion</option>
                    <c:forEach var = "lvl" begin = "1" end = "5">
                      <option value="${lvl}" ${param.lvlEng == lvl ? "selected" : ""}>${lvl}</option>
                    </c:forEach>
                  </select>
                </div>
              </div>
               
             
              
            </div>
            
          <div class="col">
            <div class="row">
              <div class="col-auto col-md-4">
                <label class="form-label" for="instId">Institucion Educativa</label>

              </div>
              <div class="col-auto col-md-8">
                <select class="form-select form-select-sm " name="instId" id="instId">
                  <option value="">Seleccione una opcion</option>
                  <c:forEach items="${institucionesEducativas}" var="inst">
                    <option value="${inst.id}" ${param.instId == inst.id ? "selected" : ""}>${inst.nombre}</option>
                  </c:forEach>
                </select>
              </div>
            </div>
             
           
          </div>
          <div class="col">

            <div class="row">
              <div class="col-auto col-md-4">
                <label class="form-label" for="tecId">Tecnologias</label>

              </div>
              <div class="col-auto col-md-8">
                <select class="form-select form-select-sm " name="tecId" id="tecId">
                  <option value="">Seleccione una opcion</option>
                  <c:forEach items="${tecnologias}" var="tecnologia">
                    <option value="${tecnologia.id}" ${param.tecId == tecnologia.id ? "selected" : ""}>${tecnologia.nombre}</option>
                  </c:forEach>
                </select>
              </div>
            </div>
          </div>
          
          <div class="col">
            <div class="row">
              <div class="col-auto col-md-4">
                <label class="form-label" for="lvlTec">Nivel de Tecnologia</label>
              </div>
              <div class="col-auto col-md-8">
                <select class="form-select form-select-sm" name="lvlTec" id="lvlTec">
                  <option value="">Seleccione una opcion</option>
                  <c:forEach var = "lvl" begin = "1" end = "5">
                    <option value="${lvl}" ${param.lvlTec == lvl ? "selected" : ""}>${lvl}</option>
                  </c:forEach>
                </select>
              </div>
            </div>
             
            
            
          </div>
          <div class="col">
             <div class="row">
              <div class="col-auto col-md-4">
                <label class="form-label" for="expInMonths">Experiencia en general</label>

              </div>
               <div class="col-auto col-md-8">
                 <select class="form-select form-select-sm " name="expInMonths" id="expInMonths">
                   <option value="">Seleccione una opcion</option>
                   <option value="6">Mayor a 6 meses</option>
                   <option value="12">Mayor a 1 año</option>
                   <option value="36">Mayor a 3 años</option>
                   <option value="60">Mayor a 5 años</option>
                 </select>

               </div>        
             </div>
          </div>
          <div class="col">
            <div class="row">
              <div class="col-auto col-md-4">
243
                <label class="form-label" for="cargoId">Cargo</label>
244 245
              </div>
              <div class="col-auto col-md-8">
246
                <select class="form-select form-select-sm " name="cargoId" id="cargoId">
247
                  <option value="">Seleccione una opcion</option>
248 249
                  <c:forEach items="${cargos}" var="cargo">
                    <option value="${cargo.id}" ${param.cargoId == cargo.id ? "selected" : ""}>${cargo.getNombre()}</option>
250 251 252 253 254
                  </c:forEach>
                </select>
              </div>
            </div>           
          </div>
255 256 257 258 259 260 261 262 263 264 265 266 267
          
        <div class="col">
          <div class="row">
            <div class="col-auto col-md-4">
              <label class="form-label" for="convId">Convocatoria</label>
            </div>
            <div class="col-auto col-md-8">
              <select class="form-select form-select-sm " name="convId" id="convId">
                <option value="">Seleccione una opcion</option>
              </select>
            </div>
          </div>           
        </div>
268
       </div> -->
269
      </form>
270
      </div>
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
      <div class="card text-dark bg-light mt-3">
        
        <div class="card-body">
          <div class="table-responsive">

            <table class="table">
              <thead>
                <tr>
                  <th scope="col">#</th>
                  <th scope="col">Nombre</th>
                  <th scope="col">Disponibilidad</th>
                  <th scope="col">Nivel de Ingles</th>
                  <th scope="col">Experiencia</th>
                  <th scope="col">Tecnologias</th>
                  <th scope="col">Estado</th>
                </tr>
              </thead>
              <tbody>
                  <c:forEach items="${postulantes}" var="postulante" varStatus="staPost">
                      <tr>
                          <th scope="row">${staPost.index + 1}</th>
                          <td>${postulante.nombre} ${postulante.apellido}</td>
                          <td>${postulante.disponibilidad.getDescripcion()}</td>
                          <td>${postulante.nivelIngles}</td>
295 296 297 298 299 300 301 302 303 304 305 306 307 308
                          <td><c:choose>
         
                            <c:when test = "${postulante.experienciaMeses < 12}">
                               ${postulante.experienciaMeses} mes<c:if test="${postulante.experienciaMeses > 1}">es</c:if>
                            </c:when>
                            
                            <c:when test = "${postulante.experienciaMeses > 12}">
                              <fmt:parseNumber var="j" integerOnly="true" type="number" value="${postulante.experienciaMeses / 12}" />  
                              <fmt:parseNumber var="k" integerOnly="true" type="number" value="${postulante.experienciaMeses % 12}" />  
                               ${j} año<c:if test="${postulante.experienciaMeses >= 24}">s</c:if> <c:if test="${k > 0}"> y ${k} mes<c:if test="${k > 1}">es</c:if></c:if> 
                            </c:when>

                         </c:choose>
                         </td>
309 310 311 312 313 314
                          <td>
                              <c:forEach items="${postulante.tecnologias}" var="detalle_tecnologia" varStatus="staTec">
                                  ${detalle_tecnologia.getTecnologia().getNombre()}${not staTec.last ? "," : ""}
                              </c:forEach>
                          </td>
                          <td>${postulante.estado.getEstado()}</td>
315
                          <td><a href="/postulantes/${postulante.id}"><i class="bi bi-eye-fill"></i></a></td>
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
                      </tr>
                  </c:forEach>
                </tbody>
      
          </table>
          </div>
          
        </div>
        <div class="card-footer">
          <div>
            <nav aria-label="Page navigation example">
              <ul class="pagination">
                <c:forEach begin="1" end="${pages}" var="nro">
                  <li class="page-item ${(param.nroPagina == null and nro == 1)  or param.nroPagina == nro-1 ? 'active' : ''}"><a class="page-link" href="javascript:buscarPagina(${nro})">${nro}</a></li>
                </c:forEach>
              </ul>
            </nav>
          </div>
        </div>
335
      </div>
336
     
337
    
338
      
339 340 341
    </layout:put>
    <layout:put block="scripts" type="APPEND">
      <script>
342 343 344 345
        var convocatorias = ${convocatoriaC};
      </script>
      <script src="./Convo.js"></script>
      <script>
346 347 348 349 350 351
        function habilitarLvlTec(){
          //si se selecciono una tecnologia entonces permitir seleccionar un nivel
          lvlTec.disabled = tecId.value == false
          if(lvlTec.disabled){
            lvlTec.firstElementChild.selected=true;
          }
Joel Florentin committed
352
          
353
        }
354

355 356 357 358 359 360 361 362 363 364 365 366 367 368
        function buscarPagina(nro){
          nro--
          const aBuscar = 'nroPagina='+nro
          if(!location.search) location.search = "?"+aBuscar
          const inicial = location.search.search(aBuscar);
          if(inicial==-1){//si no se encuentra y hay otros queries
            location.search = "&"+aBuscar
          }
          location.search.replace('nroPagina=',aBuscar)
        }
        const tecId = document.querySelector("#tecId");
        const lvlTec = document.querySelector("#lvlTec");
        tecId.addEventListener('change',habilitarLvlTec);
        habilitarLvlTec()
369 370


371 372 373
      </script>
    </layout:put>
</layout:extends>