*      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
if ($user->get_level() != 0) {
    exit;
}
$dblink = DGradeDB::instance();
$dblink->delete_user($_GET['id']);
$users = dgr_get_users();
?>

<span id="chooseheader"><?php 
echo gettext('Users');
?>
</span>
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_startup();
if (!isset($_POST['id']) || !isset($_POST['name']) || !isset($_POST['startyear']) || !isset($_POST['tutorid']) || !isset($_POST['qid'])) {
    exit;
}
try {
    $u = new DGradeUser();
} catch (Exception $e) {
    exit;
}
$added = 0;
$ht = '';
if ($_POST['id'] == 0 && $u->get_level() == 0) {
    $dblink = DGradeDB::instance();
    $dblink->add_class(stripslashes($_POST['name']), stripslashes($_POST['startyear']), $_POST['tutorid']);
} else {
    if ($_POST['id'] > 0) {
        $class = new DGradeClass($_POST['id']);
        if ($u->get_level() == 0 || $u->get_uid() == $class->get_tutorid()) {
            $class->set_name(stripslashes($_POST['name']));
            $class->set_startyear(stripslashes($_POST['startyear']));
            $class->set_tutorid($_POST['tutorid']);
Exemple #3
0
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_require('/includes/student.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['semid']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $class = new DGradeClass($_GET['id']);
} catch (Exception $e) {
    exit;
}
if ($user->get_level() != 0 && $user->get_uid() != $class->get_tutorid()) {
    exit;
}
$email = $user->get_email();
if (empty($email)) {
    $err = 1;
    $msg = gettext('E-mail not set');
} else {
    $ret = true;
    foreach ($class->students as $st) {
        $student = new DGradeStudent($st);
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_require('/includes/student.php');
if (!isset($_POST['id']) || !isset($_POST['classid']) || !isset($_POST['name']) || !isset($_POST['surname']) || !isset($_POST['email']) || !isset($_POST['paremail']) || !isset($_POST['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $student = new DGradeStudent($_POST['id']);
} catch (Exception $e) {
    exit;
}
$name = stripslashes($_POST['name']);
$surname = stripslashes($_POST['surname']);
$email = stripslashes($_POST['email']);
$paremail = stripslashes($_POST['paremail']);
if ($_POST['id'] == 0) {
    $class = new DGradeClass($_POST['classid']);
    if ($user->get_level() != 0 && $class->get_tutorid() != $user->get_uid()) {
        exit;
    }
    $dblink = DGradeDB::instance();
    $dblink->add_student($_POST['classid'], $name, $surname, $email, $paremail);
Exemple #5
0
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/student.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['semid']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $student = new DGradeStudent($_GET['id']);
} catch (Exception $e) {
    exit;
}
if ($user->get_level() != 0 && $user->get_uid() != $student->get_tutorid()) {
    exit;
}
$email = $user->get_email();
$err = 0;
$msg = '';
if (empty($email)) {
    $err = 1;
    $msg = gettext('E-mail not set');
} else {
    if ($student->send($_GET['semid'], $email)) {
Exemple #6
0
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
} catch (Exception $e) {
    /* user not logged in */
    dgr_redirect('index.php');
}
$changeok = true;
if (isset($_POST['change_settings'])) {
    switch ($_POST['change_settings']) {
        case 1:
            $user->set_name($_POST['name']);
            $user->set_surname($_POST['surname']);
            $user->set_email($_POST['email']);
            $user->set_styleid($_POST['style']);
            $user->save();
            break;
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
if ($user->get_level() != 0 || $_GET['id'] == 0) {
    exit;
}
$dblink = DGradeDB::instance();
$dblink->delete_semester($_GET['id']);
$semesters = dgr_get_semesters();
?>

<option value="0"><?php 
echo gettext('new semester');
?>
</option>
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_require('/includes/student.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $u = new DGradeUser();
} catch (Exception $e) {
    exit;
}
$student = new DGradeStudent($_GET['id']);
if ($u->get_level() != 0 && $student->get_tutorid() != $u->get_uid()) {
    exit;
}
$dblink = DGradeDB::instance();
$dblink->delete_student($_GET['id']);
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $u = new DGradeUser();
} catch (Exception $e) {
    exit;
}
if ($u->get_level() != 0) {
    exit;
}
$dblink = DGradeDB::instance();
$dblink->delete_class($_GET['id']);
$classes = dgr_get_classes();
?>

<option value="0"><?php 
echo gettext('new class');
?>
</option>
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
if (!isset($_GET['id']) || !isset($_GET['absent']) || !isset($_GET['explained']) || !isset($_GET['late']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
$dblink = DGradeDB::instance();
if ($user->get_level() != 0 && !$dblink->can_modify_attendance($_GET['id'], $user->get_uid())) {
    exit;
}
$dblink->set_attendance($_GET['id'], $_GET['absent'], $_GET['explained'], $_GET['late']);
Exemple #11
0
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_startup();
$error = false;
$errmsg = '';
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
    $semesters = dgr_get_semesters();
    $classes = $user->get_classes($semesters[0]['id']);
    if (count($classes) > 0) {
        $class = new DGradeClass($classes[0]['class_id']);
        $classload = true;
    } else {
        $classload = false;
    }
} catch (Exception $e) {
    $error = true;
    $classload = false;
    $errmsg = $e->getMessage();
    $style = dgr_get_style('.');
}
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/student.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
if ($_GET['id'] > 0) {
    try {
        $student = new DGradeStudent($_GET['id']);
        $tutorid = $student->get_tutorid();
    } catch (Exception $e) {
        die($e->getMessage());
    }
    if ($user->get_level() != 0 && $user->get_uid() != $tutorid) {
        exit;
    }
    $info = $student->get_info();
    ?>
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_require('/includes/student.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['semid']) || !isset($_GET['view']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
if ($_GET['view'] == 1) {
    $student = new DGradeStudent($_GET['id']);
    $grades = $student->get_semester_grades($_GET['semid']);
    $longest = 0;
    foreach ($grades as &$g) {
        $g['grades'] = explode(',', $g['grades']);
        reset($g['grades']);
        /* foreach requires that */
        $cnt = count($g['grades']);
        if ($cnt > $longest) {
            $longest = $cnt;
        }
Exemple #14
0
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
} catch (Exception $e) {
    /* user not logged in */
    dgr_redirect('index.php');
}
if ($user->get_level() != 0) {
    die;
}
$users = dgr_get_users();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Exemple #15
0
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
try {
    $user = new DGradeUser();
    $style = dgr_get_style('.', $user->get_styleid());
} catch (Exception $e) {
    /* user not logged in */
    dgr_redirect('index.php');
}
if ($user->get_level() == 0) {
    $classes = dgr_get_classes();
    $users = dgr_get_users(true);
    if (isset($_GET['id']) && $_GET['id'] > 0) {
        $classid = $_GET['id'];
        $loadclass = 'true';
    } else {
        $classid = 0;
        $loadclass = 'false';
    }
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
if (!isset($_POST['id']) || !isset($_POST['grades']) || !isset($_POST['notes']) || !isset($_POST['semestral']) || !isset($_POST['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
} catch (Exception $e) {
    exit;
}
$dblink = DGradeDB::instance();
if ($user->get_level() != 0 && !$dblink->can_modify_grade($_POST['id'], $user->get_uid())) {
    exit;
}
$grades = dgr_strip_whitespaces(stripslashes($_POST['grades']));
$notes = stripslashes($_POST['notes']);
$semestral = stripslashes($_POST['semestral']);
$dblink->set_grade($_POST['id'], $grades, $notes, $semestral);
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['view']) || !isset($_GET['semid']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $class = new DGradeClass($_GET['id']);
    $user->set_classid($_GET['id']);
} catch (Exception $e) {
    exit;
}
$ht = '';
if ($_GET['view'] == 1) {
    $ht .= '<span id="chooseheader">' . gettext('Students') . '</span><span id="choosesel" style="display:none">1</span><span id="chooseid" style="display:none">0</span><div id="chooselist"><table cellpadding="0" cellspacing="0" width="100%">';
    $i = 0;
    foreach ($class->students as $st) {
        $stinfo = $class->get_student_brief($st);
        $tr = 'choose' . ++$i;
        $ht .= '<tr id="' . $tr . '" onmouseover="make_pointer(this)" onclick="change_selection(' . $i . ',' . $stinfo['id'] . ')">' . '<td style="width:15%" class="choosetd">' . $i . '</td>' . '<td class="choosetd">' . $stinfo['name'] . '</td>' . '<td class="choosetd">' . $stinfo['surname'] . '</td>' . '</tr>';
    }
    $ht .= '</table></div>';
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/db.php');
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
if (!isset($_GET['id']) || !isset($_GET['classid']) || !isset($_GET['semid']) || !isset($_GET['subid']) || !isset($_GET['teachid']) || !isset($_GET['block']) || !isset($_GET['desc']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $class = new DGradeClass($_GET['classid']);
} catch (Exception $e) {
    die($e->getMessage());
}
if ($user->get_level() != 0 && $user->get_uid() != $class->get - tutorid()) {
    die;
}
$dblink = DGradeDB::instance();
$block = $_GET['block'] == 1;
$desc = $_GET['desc'] == 1;
if ($_GET['id'] > 0) {
    $dblink->set_csubject($_GET['id'], $_GET['subid'], $_GET['teachid'], $block, $desc);
} else {
    if ($_GET['id'] == 0) {
        $id = $dblink->add_csubject($_GET['classid'], $_GET['semid'], $_GET['subid'], $_GET['teachid'], $block, $desc);
Exemple #19
0
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/common.php';
dgr_require('/includes/user.php');
dgr_startup();
$bad_login = false;
$errmsg = '';
if (isset($_GET['logout'])) {
    try {
        $user = new DGradeUser();
        $user->logout();
        $user = null;
    } catch (Exception $e) {
        /* do nothing */
    }
    dgr_redirect('index.php');
}
if (isset($_POST['dgrade_login'])) {
    try {
        $user = new DGradeUser($_POST['user'], $_POST['pass']);
    } catch (Exception $e) {
        $bad_login = true;
        $errmsg = $e->getMessage();
    }
    if (!$bad_login) {