Skip to content

Commit

Permalink
iniciando actividad de admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankgmv committed Sep 19, 2022
1 parent 956864c commit 594f16b
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 310 deletions.
63 changes: 60 additions & 3 deletions Controlador/RecogerDatos/_admin/datos.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

include "../../../Modelo/conexion_db.php";

$ida = $_SESSION['id_adm'];
Expand Down Expand Up @@ -34,6 +35,34 @@ function Admin($id)
$this->ocupacion = $result['OCUPACION'];
$this->donde_labora = $result['DONDE_LABORA'];
}
function get_tareas()
{
global $conn;
$sql_12 = "SELECT * FROM TAREAS ORDER BY ESTADO_TAREA ASC;";
$consult = mysqli_query($conn, $sql_12);

return $consult;
}

function Get_datos_del_postulado($id_tarea)
{
global $conn;
$slq_8 = "SELECT * FROM POSTULADOS WHERE ID_TAREA = '$id_tarea' ORDER BY ESTADO_POSTULACION ASC;";
$CONSULT_8 = mysqli_query($conn, $slq_8);
return $CONSULT_8;
}

function Get_datos_del_estudiante($identidad)
{
global $conn;

$sql_7 = "SELECT concat(NOMBRES,' ',APELLIDOS) as NOMBRES, IDENTIDAD as ID_E, GRADO FROM ESTUDIANTES WHERE IDENTIDAD = '$identidad';";
$CONSULT_7 = mysqli_query($conn, $sql_7);
$rest = mysqli_fetch_array($CONSULT_7);

return $rest;
}

function get_mis_datos($ida)
{
global $conn;
Expand Down Expand Up @@ -86,6 +115,32 @@ function Get_busqueda_de_estudiante($id_estudiante)
return $result_4;
}

function Get_contar_los_postulados($id_tarea)
{
global $conn;
$sql_11 = "SELECT COUNT(ID_POSTULADO) AS TOTAL FROM POSTULADOS WHERE ID_TAREA = '$id_tarea';";
$CONSULT_11 = mysqli_query($conn, $sql_11);

$result__11 = mysqli_fetch_array($CONSULT_11);

$sql_10 = "SELECT COUNT(ID_POSTULADO) AS ACTIVOS FROM POSTULADOS WHERE ID_TAREA = '$id_tarea' AND ESTADO_POSTULACION LIKE 'A%';";
$CONSULT_10 = mysqli_query($conn, $sql_10);
$result__10 = mysqli_fetch_array($CONSULT_10);


$activos = $result__10['ACTIVOS'];
$total = $result__11['TOTAL'];
$inactivos = $total - $activos;

$N_POSTULACIONES = array('ACTIVOS' => $activos, 'TOTALES' => $total, 'INACTIVOS' => $inactivos);

return $N_POSTULACIONES;
}

function Get_egresados()
{
}

function Set_cambiar_password_directivo($id_directivo, $newPassword)
{
$newPassSeguro = password_hash($newPassword, PASSWORD_BCRYPT, ['vueltas' => 30]);
Expand Down Expand Up @@ -159,7 +214,7 @@ function Set_editar_estudiantes($id_estudiante, $Array)
}
}

function Get_egresar_estudiante($id_estudiante)
function Set_egresar_estudiante($id_estudiante)
{
global $conn;
// Obtener datos básicos
Expand Down Expand Up @@ -195,8 +250,8 @@ function Get_egresar_estudiante($id_estudiante)
return 1;
}
}
function Get_retirar_estudiante($id_estudiante)

function Set_retirar_estudiante($id_estudiante)
{
global $conn;
// Obtener datos básicos
Expand Down Expand Up @@ -242,6 +297,8 @@ function Get_retirar_estudiante($id_estudiante)





header("../../../Vista/perfiles/_admin/perfil_admin.php");
} else {
header("../../../index.php");
Expand Down
2 changes: 1 addition & 1 deletion Controlador/RecogerDatos/estudiante/datos.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function EstoyPostulado($id_tarea)

function NombreCreadorTarea($id_creador)
{

global $conn;
$SQL7 = "SELECT CONCAT(NOMBRES,' ', APELLIDOS) AS NOMBRES FROM DIRECTIVOS WHERE IDENTIDAD = '$id_creador';";
$queryC = mysqli_query($conn, $SQL7);
Expand All @@ -213,6 +212,7 @@ function EstoyActivo($id, $id_tarea)
$resultado = mysqli_fetch_array($consl);
return $resultado['ESTADO'];
}

} else {
header("Location:../../../Controlador/formulariosDatos/inicio_sesion.php");
$_SESSION['mensajeInicio'] = "Por favor inicia sesión nuevamente.";
Expand Down
2 changes: 1 addition & 1 deletion Vista/perfiles/_admin/info_general.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<body class="pt-4 mt-4">
<header class="container-fluid ">
<nav class="container-fluid navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<a class="navbar-brand" href="tareas.php">
<a class="navbar-brand" href="#">
<div class="row ">
<div class="col-auto text-start d-inline">
<img src="../../../Controlador/includes/recursos/img-cabecera.png" class="i" width="auto" height="80" alt="logo sistema">
Expand Down
10 changes: 5 additions & 5 deletions Vista/perfiles/_admin/perfil_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<body class="pt-4 mt-4">
<header class="container-fluid ">
<nav class="container-fluid navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<a class="navbar-brand" href="tareas.php">
<a class="navbar-brand" href="info_general.php">
<div class="row ">
<div class="col-auto text-start d-inline">
<img src="../../../Controlador/includes/recursos/img-cabecera.png" class="i" width="auto" height="80" alt="logo sistema">
Expand Down Expand Up @@ -168,15 +168,15 @@
<script src="//cdn.jsdelivr.net/npm/[email protected]/build/alertify.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

<?php if (isset($_SESSION['mensajeDePerfilDir'])) { ?>
<?php if (isset($_SESSION['mensajeDePerfilAdm'])) { ?>

<script>
swal("<?php print $_SESSION['tituloDePerfilDir']; ?>", " <?php print $_SESSION['mensajeDePerfilDir']; ?> "
<?php if (isset($_SESSION['tipoPerfilDir'])) { ?>, "<?php print $_SESSION['tipoPerfilDir']; ?>"
swal("<?php print $_SESSION['tituloDePerfilAdm']; ?>", " <?php print $_SESSION['mensajeDePerfilAdm']; ?> "
<?php if (isset($_SESSION['tipoPerfilAdm'])) { ?>, "<?php print $_SESSION['tipoPerfilAdm']; ?>"
<?php } ?>
);
</script>
<?php unset($_SESSION['mensajeDePerfilDir'], $_SESSION['tituloDePerfilDir'], $_SESSION['tipoPerfilDir']);
<?php unset($_SESSION['mensajeDePerfilAdm'], $_SESSION['tituloDePerfilAdm'], $_SESSION['tipoPerfilAdm']);
} ?>
</body>

Expand Down
Loading

0 comments on commit 594f16b

Please sign in to comment.