Пример #1
0
        } else {
            if ($_POST['type'] == 3) {
                User::updateUser($_POST['id'], $_POST['password'], $_POST['class']);
            }
        }
    }
    $app->redirect($app->urlFor('gestionUser'));
});
$app->get('/gestionUser', function () use($app) {
    $alladmin = User::listAdmin();
    $allteacher = User::listTeacher();
    $i = 0;
    $size = sizeof($allteacher);
    $tab = [];
    while ($i < $size) {
        $tab[] = subject::getAllSubject();
        $i++;
    }
    $subjectTeacher = array();
    $i = 0;
    $j = 0;
    while ($i < $size) {
        $size2 = sizeof($tab[$i]);
        while ($j < $size2) {
            $subjectTeacher[$tab[$i][$j]['teacherId']] = $tab[$i][$j]['subjectName'];
            $j++;
        }
        $i++;
    }
    $alluser = User::listUser();
    $allclass = StudentClass::getAllClass();