コード例 #1
0
ファイル: gestionGrupos.php プロジェクト: vinird/planillas2
    }
}
$num_grupo_doble = isset($_POST['cboGrupoDoble']) ? $_POST['cboGrupoDoble'] : "";
$docentesDoble = array(array());
for ($i = 0; $i < 6; $i++) {
    if (isset($_POST['txtProfesorDoble' . $i])) {
        $tmp = explode("-", $_POST['txtProfesorDoble' . $i])[0];
        $nombre = trim(explode(" ", $tmp)[0]);
        $apellidos = trim(explode(" ", $tmp)[1]);
        if (!empty(trim(explode(" ", $tmp)[2]))) {
            $apellidos .= " " . trim(explode(" ", $tmp)[2]);
        }
        $resultado = $db2->obtenerDocentes();
        while ($fila = mysqli_fetch_assoc($resultado)) {
            if ($nombre == $fila['nombre'] && $apellidos == $fila['apellidos']) {
                if (verificarTiemposDocente($fila['cedula']) + convertirFraccionesDoble(trim(explode("-", $_POST['txtProfesorDoble' . $i])[1])) > 1) {
                    $_SESSION['alerta'] = 1;
                    $_SESSION['alerta-contenido'] = "El docente " . $fila['nombre'] . " " . $fila['apellidos'] . " se excede de su tiempo";
                    header("Location: ../masterPage.php");
                    exit;
                }
                $docentesDoble[$i][0] = $fila['cedula'];
                $docentesDoble[$i][1] = convertirFraccionesDoble(trim(explode("-", $_POST['txtProfesorDoble' . $i])[1]));
            }
        }
    }
}
$horarioCursoDoble = array(array());
for ($i = 0; $i < 6; $i++) {
    if (isset($_POST['txtHorarioDoble' . $i])) {
        $tmp = explode(" ", $_POST['txtHorarioDoble' . $i]);
コード例 #2
0
        $_SESSION['alerta-contenido'] = "Docente borrado con éxito. <br/>Se eliminó " . $jornada_docenteAdministrativo . " tiempos del presupuesto " . $nombre_presupuesto2 . ".";
        ////////////////// Registro de actividad /////////////
        $descripcionRegistroActividad = "Se eliminó el docente con la cédula " . $cedula . ", nombre " . $nombre2 . " " . $apellidos2 . ", y se eliminó " . $jornada_docenteAdministrativo . " tiempos del presupuesto " . $nombre_presupuesto2 . ".";
        $dbRegistroActividad->agregarRegistroActividad($utc, $fecha, $usuario, $descripcionRegistroActividad);
        //////////////////////////////////////////////
    } else {
        $_SESSION['alerta'] = 3;
        $_SESSION['alerta-contenido'] = "Ocurrió un error al eliminar el docente";
    }
    exit;
}
//////////////////// AGREGAR ////////////////////////////////
if (isset($_POST['btnRegistrar2'])) {
    $_SESSION['alerta'] = 1;
    header("Location: ../masterPage.php");
    $tiemposDocente = verificarTiemposDocente($cedula);
    if ($tiemposDocente + $jornada_docenteAdministrativo > 1) {
        $_SESSION['alerta-contenido'] = "No puede agregar mas tiempos al docente encargado <br>porque pasa el límite de un tiempo.";
        header("Location: ../masterPage.php");
        exit;
    }
    if ($cedula == "") {
        $_SESSION['alerta-contenido'] = "Debe ingresar la cedula.";
        exit;
    }
    if (empty($nombre)) {
        $_SESSION['alerta-contenido'] = "Debe ingresar el nombre.";
        exit;
    }
    ///// Verifica que la cedula del docente no exista
    $resultado = $db->obtenerDocenteAdministrativo();