<?php
session_start();
      if( (isset($_SESSION['IdAdmin'])) &&($_SESSION['IdAdmin']>0))
   {  
?>
<!DOCTYPE html>
<html>
<head>
<title>IESTP-Abancay-Docente</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="bower_components/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/pages/waves/css/waves.min.css" media="all">
<link rel="stylesheet" href="assets/icon/feather/css/feather.css">
<link rel="stylesheet" href="assets/icon/icofont/css/icofont.css">
<link rel="stylesheet" href="assets/icon/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/pages/notification/notification.css">
<link rel="stylesheet" href="assets/css/style.css">

<?php
include("script_funciones.php");
include('db___cn.php');
$mysqli=conex_db_mysql();
$administrador="SELECT IdAdministrador,Apellidos,Nombres,UrlFoto,Email,Celular,Usuario,Clave
              FROM tb_administrador 
              WHERE IdAdministrador='".$_SESSION['IdAdmin']."'";
$rs=$mysqli->query($administrador);
$fila_administrador=mysqli_fetch_array($rs);

$convocatoria="SELECT CodigoConvocatoria,Titulo FROM tb_bolsa_laboral WHERE IdBolsaLaboral=".base64_decode($_GET['id1']);
$rs_ver_convocatoria=$mysqli->query($convocatoria);
$fila_convocatoria=mysqli_fetch_array($rs_ver_convocatoria);

$estudiante="SELECT IdPostulacion,tb_estudiantes.IdEstudiante,Apellidos,Nombres,UrlFoto,Dni,Email,NumCelular,FechaNac,Edad,Domicilio,UrlCv,CondicionPostulacion,DetalleResultado
              FROM tb_estudiantes,tb_bolsa_laboral_postulaciones 
              WHERE tb_estudiantes.IdEstudiante=tb_bolsa_laboral_postulaciones.IdEstudiante
              and tb_estudiantes.IdEstudiante=".base64_decode($_GET['id']);
$rs=$mysqli->query($estudiante);
$fila_estudiante=mysqli_fetch_array($rs);

 mysqli_close($mysqli);
?>
</head>
<body>

<div class="loader-bg">
     <div class="loader-bar"></div>
</div>

<div id="pcoded" class="pcoded">
     <div class="pcoded-overlay-box"></div>
<div class="pcoded-container navbar-wrapper">
	
	<nav class="navbar header-navbar pcoded-header">
		<div class="navbar-wrapper">
			<div class="navbar-logo">
				<?php logo(); ?>	
			</div>
			<div class="navbar-container container-fluid">
			    <?php menuSuperior($fila_administrador['Nombres'],$fila_administrador['UrlFoto']); ?>
			</div>
		</div>
	</nav>

<div class="pcoded-main-container"><!-- inicio pcoded-main-container -->
  <div class="pcoded-wrapper"><!-- inicio pcoded-wrapper -->
	<nav class="pcoded-navbar">
	  <div class="nav-list">
	     <div class="pcoded-inner-navbar main-menu">
	        <div class="pcoded-navigation-label">Panel Navegaci&#243;n</div>
	          <?php  MenuPrincipal(); ?>
	     </div>
	  </div>
	</nav>

<div class="pcoded-content"><!-- inicio pcoded-content -->

	<div class="page-header card"> <!-- inicio page-header card - encabezado -->
		<div class="row align-items-end">
				<div class="col-lg-4">
				  
				</div>
				<div class="col-lg-8">
					<div class="page-header-breadcrumb">
							<ul class=" breadcrumb breadcrumb-title">
								<li class="breadcrumb-item">
								<a href="principal.php"><i class="feather icon-home"></i></a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Gestor Bolsa Laboral</a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Postulantes</a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Atender Postulaci&#243;n</a>
								</li>
							</ul>
					</div>
				</div>
		</div>
	</div><!-- fin page-header card - encabezado -->

	<div class="pcoded-inner-content"><!-- inicio pcoded-inner-content - contenido dinamico -->
		<div class="main-body">
			<div class="page-wrapper">
			     <div class="card bg-light">
					<div class="card-header bg-danger">C&#243;digo: <?php echo  $fila_convocatoria['CodigoConvocatoria']; ?></div>
					<div class="card-body">
						<h5 class="card-title">T&#237;tulo Convocatoria</h5>
						<p class="card-text"><?php echo $fila_convocatoria['Titulo']; ?></p>
					</div>
				 </div>

                <div class="card">
                 <form name="formEvaluarPostulacion" method="post" action="" onsubmit="evaluarPostulacion(); return false"> 
				  <input type="hidden" name="txt_id" id="txt_id" value="<?php echo $fila_estudiante['IdPostulacion'];?>"> 
					<div class="card-header bg-primary">
					  <h5>Atender Postulaci&#243;n</h5>
					</div>
					<div class="card-block pt-1 pb-1">
					 <div class="row">
	                   <div class="col-sm-2">
	                        <h4 class="f-14 f-w-600 f-s-italic">D.N.I.:</h4>
	                        <div class="p-2 mb-3 b-default rounded">
	                          <p class="mb-1"><?php echo $fila_estudiante['Dni'];?></p>
	                       </div>
	                   </div>
	                   <div class="col-sm-4">
	                       <h4 class="f-14 f-w-600 f-s-italic">Nombres:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['Nombres'];?></p>
	                       </div>  
	                   </div>
	                   <div class="col-sm-6">
	                      <h4 class="f-14 f-w-600 f-s-italic">Apellidos:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['Apellidos'];?></p>
	                       </div> 
	                   </div>
                     </div> 
	                <div class="row">
	                   <div class="col-sm-2">
	                     <h4 class="f-14 f-w-600 f-s-italic">Fecha Nac.:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1">
	                         <?php 
	                           $fecha_nac = new DateTime($fila_estudiante['FechaNac']);
	                           echo $fecha_nac->format('d-m-Y');
	                         ?>
	                         </p>
	                       </div>
	                   </div>
	                   <div class="col-sm-2">
	                     <h4 class="f-14 f-w-600 f-s-italic">Edad:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['Edad'];?></p>
	                       </div>
	                   </div>
	                   <div class="col-sm-2">
	                     <h4 class="f-14 f-w-600 f-s-italic">Celular:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['NumCelular'];?></p>
	                       </div>
	                   </div>
	                   <div class="col-sm-6">
	                     <h4 class="f-14 f-w-600 f-s-italic">Email:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['Email'];?></p>
	                       </div>
	                   </div>
	                </div>
	                <div class="row">
	                   <div class="col-sm-6">
	                     <h4 class="f-14 f-w-600 f-s-italic">Domicilio:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['Domicilio'];?></p>
	                       </div>
	                   </div>
	                   <div class="col-sm-3">
	                     <h4 class="f-14 f-w-600 f-s-italic">Curriculum Vitae:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <?php
	                            if ($fila_estudiante['UrlCv'] == "scv.pdf")
	                             {
	                               echo 'Sin Curriculum Vitae'; 
	                             }
	                          else
	                          {
	                             echo '<a href="../Cv/'.$fila_estudiante['UrlCv'].'" target="_blank">
	                                   Ver Curriculum Vitae</i>
	                                   </a>';
	                          }
	                          ?>
	                       </div>
	                   </div>
	                   <div class="col-sm-3">
						  <h4 class="f-14 f-w-600 f-s-italic">Condici&#243;n de Postulaci&#243;n:</h4>
	                       <div class="p-2 mb-3 b-default rounded">
	                         <p class="mb-1"><?php echo $fila_estudiante['CondicionPostulacion'];?></p>
	                       </div>
						</div>
	                </div>
	                 <div class="form-group row">
						<div class="col-sm-4">
						  <label class="f-14 f-w-600 f-s-italic" for="cb_estado_postulacion">Atender Postulaci&#243;n :</label>
                            <select class="form-control fill" id="cb_estado_postulacion" name="cb_estado_postulacion">
                              <option value="Apto Entrevista">Apto para Entrevista</option>
                              <option value="No Califica">No Califica</option>
						    </select>
						</div>
	                 </div>
	                 <div class="form-group row">
						<div class="col-sm-12">
						  <label class="f-14 f-w-600 f-s-italic" for="txt_detallar">Detallar resultado de postulaci&#243;n :</label>
                            <textarea class="form-control" rows="3" id="txt_detallar" maxlength="300">
                            	<?php echo trim($fila_estudiante['DetalleResultado']);?>
                            </textarea>
						</div>
	                 </div>
		           </div>
		            <div class="card-footer pt-0 pb-2">
		               <div class="form-group row">
							<div class="col-sm-12 text-center b-t-default pt-3">
			                  <input type="submit" class="btn btn-success" name="bt_evaluar" id="bt_evaluar" value="Registrar Atenci&#243;n">
                             <?php
							 echo '<a href="postulantesBolsaLaboral.php?id='.$_GET['id1'].'" class="btn btn-secondary"><i class="fa fa-mail-reply"></i>Volver</a>';
                             ?>
							</div>
			           </div>
	                </div>
	               </form>
                </div>
			</div>
		</div>
	</div><!-- fin pcoded-inner-content - contenido dinamico -->
</div> <!-- fin pcoded-content -->

</div><!-- fin pcoded-wrapper -->

</div> <!-- fin pcoded-main-container -->

</div>
</div>

<script src="bower_components/jquery/js/jquery.min.js"></script>
<script src="bower_components/popper/js/popper.min.js"></script>
<script src="bower_components/bootstrap/js/bootstrap.min.js"></script>
<script  src="bower_components/jquery-slimscroll/js/jquery.slimscroll.js"></script>
<script src="assets/pages/waves/js/waves.min.js"></script>
<script src="assets/js/pcoded.min.js"></script>
<script src="assets/js/vertical/vertical-layout.min.js"></script>
<script src="assets/js/script.js"></script>
<script  src="assets/js/bootstrap-growl.min.js"></script>
<script src="js/ajax.js"></script>

</body>
</html>
<?php
}
else
{ 
header("Location: LoginAdmin.php");
}
?>
