Exemplo n.º 1
0
     $resultado2 = $dbDocentesConPermisos->obtenerDocentesConPermiso();
     while ($fila = mysqli_fetch_assoc($resultado2)) {
         if ($fila['cedula'] == $cedula) {
             $_SESSION['alerta-contenido'] = "El docente ya existe";
             exit;
         }
     }
     if (empty($nombre)) {
         $_SESSION['alerta-contenido'] = "Debe ingresar el nombre";
         exit;
     }
     if (empty($apellidos)) {
         $_SESSION['alerta-contenido'] = "Debe ingresar los apellidos";
         exit;
     }
     $seRealizo = $db->agregarDocente($cedula, $nombre, $apellidos, $grado_academico, $tipo_contrato);
     if ($seRealizo == 0) {
         $_SESSION['alerta'] = 2;
         $_SESSION['alerta-contenido'] = "Docente agregrado con éxito";
         ////////////////// Registro de actividad /////////////
         $descripcionRegistroActividad = "Se agregó el docente " . $nombre . " " . $apellidos . ", cédula " . $cedula;
         $dbRegistroActividad->agregarRegistroActividad($utc, $fecha, $usuario, $descripcionRegistroActividad);
         //////////////////////////////////////////////////
         exit;
     } else {
         $_SESSION['alerta'] = 3;
         $_SESSION['alerta-contenido'] = "Ocurrió un error al agregar el docente" . $seRealizo;
         exit;
     }
 }
 exit;