} else {
                    gotoLocation('email-templates.php');
                }
                break;
            case 'edit':
                $g_vars['page']['title'] = $lngstr['page_title_etemplates_edit'] . $lngstr['item_separator'] . $g_vars['page']['title'];
                if (isset($_GET['etemplateid'])) {
                    if (isset($_POST['bsubmit'])) {
                        if ($G_SESSION['access_emailtemplates'] > 1) {
                            include_once $DOCUMENT_PAGES . 'email-templates-3.inc.php';
                        } else {
                            gotoLocation('email-templates.php');
                        }
                    } else {
                        if (isset($_POST['bcancel'])) {
                            gotoLocation('email-templates.php');
                        } else {
                            include_once $DOCUMENT_PAGES . 'email-templates-2.inc.php';
                        }
                    }
                }
                break;
            default:
                include_once $DOCUMENT_PAGES . 'email-templates-1.inc.php';
        }
    } else {
        $g_vars['page']['notifications'] = $lngstr['inf_cant_access_emailtemplates'];
        include_once $DOCUMENT_PAGES . 'home.inc.php';
    }
} else {
    $g_vars['page']['title'] = $lngstr['page_title_signin'];
<?php

$i_now = time();
$i_dateend = $i_now + 60 * 60 * 24 * 365 * 10 + 60 * 60 * 24 * 3;
if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "tests (test_createdate, test_datestart, test_dateend, test_instructions, test_notes) VALUES(" . $i_now . ", " . $i_now . ", " . $i_dateend . ", '', '')") === false) {
    showDBError(__FILE__, 1);
}
$i_testid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'tests', 'testid');
gotoLocation('test-manager.php?testid=' . $i_testid . '&action=settings');
<?php 
require_once "inc/init.inc.php";
signoutUser();
gotoLocation('http://localhost/e-learning-website/index.php?option=com_wrapper&view=wrapper&Itemid=15');
            $G_SESSION['yt_questionno'] = count($i_answered_questionids) + 1;
            $G_SESSION['yt_got_answers'] = $i_got_answers;
            $G_SESSION['yt_got_points'] = $i_got_points;
            $G_SESSION['yt_points_pending'] = $i_points_pending;
            $G_SESSION['yt_state'] = TEST_STATE_QSHOW;
            gotoLocation('test.php');
        } else {
            setCookieVar('pending_test_ids', '');
            setCookieVar('pending_test_result_ids', '');
            include_once $DOCUMENT_PAGES . 'home.inc.php';
        }
        exit;
    }
}
unregisterTestData();
if ($f_testid) {
    if (initATest($f_testid)) {
        setCookieVar('pending_test_ids', (string) $G_SESSION['testid']);
        setCookieVar('pending_test_result_ids', (string) $G_SESSION['resultid']);
        if ($G_SESSION['yt_state'] == TEST_STATE_TESTINTRO) {
            gotoLocation('test.php?action=instructions&testid=' . $f_testid);
        } else {
            gotoLocation('test.php');
        }
    } else {
        include_once $DOCUMENT_PAGES . 'home.inc.php';
    }
} else {
    $g_vars['page']['errors'] = $lngstr['err_no_test_selected'];
    include_once $DOCUMENT_PAGES . 'home.inc.php';
}
if ($i_rSet2 = $g_db->Execute("SELECT subjectid FROM " . $srv_settings['table_prefix'] . "subjects WHERE subjectid={$f_subjectid}")) {
    $sql_subject_exists = $i_rSet2->RecordCount() > 0;
} else {
    $sql_subject_exists = false;
}
if (!$sql_subject_exists) {
    $g_vars['page']['errors'] .= $lngstr['err_subject_doesnotexist'];
}
$strQrySet = "test_type=" . $f_test_type . ", subjectid=" . $f_subjectid . ", gscaleid=" . $f_gscaleid . ", rtemplateid=" . $f_rtemplateid . ", test_reportgradecondition=" . $f_test_reportgradecondition . ", result_etemplateid=" . $f_result_etemplateid . ", test_name=" . $f_test_name . ", test_code=" . $f_test_code . ", test_description=" . $f_test_description . ", test_time=" . $nTestTime . ", test_timeforceout={$f_test_timeforceout}, test_attempts={$f_test_attempts}, test_contentprotection={$f_test_contentprotection}, test_shuffleq={$f_test_shuffleq}, test_shufflea={$f_test_shufflea}, test_qsperpage={$f_test_qsperpage}, test_canreview={$f_test_canreview}, test_showqfeedback={$f_test_showqfeedback}, test_result_showgrade={$f_test_result_showgrade}, test_result_showgradefeedback={$f_test_result_showgradefeedback}, test_result_showanswers={$f_test_result_showanswers}, test_result_showpoints={$f_test_result_showpoints}, test_result_rtemplateid={$f_test_result_rtemplateid}, test_result_showhtml={$f_test_result_showhtml}, test_result_showpdf={$f_test_result_showpdf}, test_result_email={$f_test_result_email}, test_result_emailtouser={$f_test_result_emailtouser}, test_datestart={$f_test_datestart}, test_dateend={$f_test_dateend}, test_instructions={$f_test_instructions}, test_prevtestid={$f_test_prevtestid}, test_nexttestid={$f_test_nexttestid}, test_price={$f_test_price}, test_other_repeatuntilcorrect={$f_test_other_repeatuntilcorrect}, test_notes={$f_test_notes}, test_forall={$f_test_forall}, test_enabled={$f_test_enabled}";
if ($g_vars['page']['errors']) {
    include_once $DOCUMENT_PAGES . "test-manager-2.inc.php";
} else {
    if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests SET " . $strQrySet . " WHERE testid={$f_testid}") === false) {
        showDBError(__FILE__, 1);
    }
    //9917//9917
    if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups_tests WHERE testid=" . $f_testid) === false) {
        showDBError(__FILE__, 2);
    }
    foreach ($f_group as $i_groupid => $i_ischecked) {
        if ($i_ischecked) {
            //9917//9917
            $g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "groups_tests (groupid, testid) VALUES (" . $i_groupid . ", " . $f_testid . ")");
        }
    }
    if (isset($_POST['bsubmit2'])) {
        gotoLocation('test-manager.php' . getURLAddon('?action=editt', array('action')));
    } else {
        gotoLocation('test-manager.php' . getURLAddon('', array('action', 'testid')));
    }
}
<?php

include_once $DOCUMENT_PAGES . 'test-saveresults.inc.php';
gotoLocation('test.php?action=results');
if ($i_questiontype == QUESTION_TYPE_ESSAY) {
    if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "results_answers SET result_answer_points=" . $f_points . ", result_answer_iscorrect=" . ($f_notdefined ? IGT_ANSWER_IS_UNDEFINED : ($f_points >= $i_questionpoints ? IGT_ANSWER_IS_CORRECT : ($f_points > 0 ? IGT_ANSWER_IS_PARTIALLYCORRECT : IGT_ANSWER_IS_INCORRECT))) . ", result_answer_feedback=" . $f_feedback . " WHERE resultid=" . $f_resultid . " AND result_answerid=" . $f_answerid) === false) {
        showDBError(__FILE__, 5);
    }
    $i_testpoints_max = 0;
    $i_rSet6 = $g_db->Execute("SELECT result_pointsmax FROM " . $srv_settings['table_prefix'] . "results WHERE resultid=" . $f_resultid);
    if (!$i_rSet6) {
        showDBError(__FILE__, 6);
    } else {
        if (!$i_rSet6->EOF) {
            $i_testpoints_max = $i_rSet6->fields["result_pointsmax"];
        }
        $i_rSet6->Close();
    }
    $i_rSet7 = $g_db->Execute("SELECT SUM(result_answer_points) as testpoints FROM " . $srv_settings['table_prefix'] . "results_answers WHERE resultid=" . $f_resultid);
    if (!$i_rSet7) {
        showDBError(__FILE__, 7);
    } else {
        if (!$i_rSet7->EOF) {
            $i_testpoints_new = $i_rSet7->fields['testpoints'];
        }
        $i_rSet7->Close();
    }
    $i_percents = $i_testpoints_max != 0 ? round($i_testpoints_new / $i_testpoints_max * 100) : 100;
    $i_grade = calcResultGrade($i_gscaleid, $i_percents);
    if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "results SET result_points=" . $i_testpoints_new . ", gscaleid=" . $i_gscaleid . ", gscale_gradeid=" . $i_grade['gradeid'] . " WHERE resultid=" . $f_resultid) === false) {
        showDBError(__FILE__, 9);
    }
}
gotoLocation('reports-manager.php?resultid=' . $f_resultid . '&action=viewq');
<?php

$f_gscaleid = (int) readGetVar('gscaleid');
$f_gscale_gradeid = (int) readGetVar('gscale_gradeid');
$i_gradecount = getRecordCount($srv_settings['table_prefix'] . 'gscales_grades', "gscaleid=" . $f_gscaleid);
if ($f_gscale_gradeid < $i_gradecount) {
    $g_db->Execute("LOCK TABLES " . $srv_settings['table_prefix'] . "gscales_grades WRITE");
    $g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "gscales_grades SET gscale_gradeid=0 WHERE gscale_gradeid=" . ($f_gscale_gradeid + 1) . " AND gscaleid=" . $f_gscaleid);
    $g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "gscales_grades SET gscale_gradeid=gscale_gradeid+1 WHERE gscale_gradeid=" . $f_gscale_gradeid . " AND gscaleid=" . $f_gscaleid);
    $g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "gscales_grades SET gscale_gradeid=" . $f_gscale_gradeid . " WHERE gscale_gradeid=0 AND gscaleid=" . $f_gscaleid);
    $g_db->Execute("UNLOCK TABLES");
}
gotoLocation('grades.php' . getURLAddon('?action=edit', array('action')));
<?php

$f_testid = (int) readGetVar('testid');
$f_id = (int) readGetVar('id');
if ((int) readGetVar('set')) {
    $g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "tests_attempts (testid, id, test_attempt_count) VALUES (" . $f_testid . ", " . $f_id . ", 0)");
    $g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests_attempts SET test_attempt_count=999999 WHERE testid=" . $f_testid . " AND id=" . $f_id);
} else {
    $g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "tests_attempts WHERE testid=" . $f_testid . " AND id=" . $f_id);
}
gotoLocation('reports-manager.php' . getURLAddon('?action=', array('action', 'testid', 'id', 'set')));
<?php

$f_testid = (int) readGetVar('testid');
$f_set = isset($_GET['set']) ? (int) $_GET['set'] : 0;
if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests SET test_enabled={$f_set} WHERE testid={$f_testid}") === false) {
    showDBError(__FILE__, 1);
}
gotoLocation('test-manager.php' . getURLAddon('', array('action', 'testid', 'confirmed', 'set')));
Beispiel #11
0
<?php

require_once "../inc/init.inc.php";
$i_url = '/guide.php' . getURLAddon();
if (!empty($_GET['language'])) {
    $i_language = readGetVar('language');
} else {
    $i_language = $srv_settings['language'];
}
if ($i_language != 'en' && $i_language != 'de' && $i_language != 'es') {
    $i_language = 'en';
}
$i_url = $i_language . '' . $i_url;
gotoLocation($i_url);
<?php

if (isset($_POST["box_users"])) {
    foreach ($_POST["box_users"] as $f_id) {
        deleteUser((int) $f_id);
    }
} else {
    $f_id = (int) readGetVar('id');
    deleteUser($f_id);
}
gotoLocation('users.php' . getURLAddon('', array('action', 'confirmed')));
function deleteUser($i_id)
{
    global $g_db, $srv_settings;
    if ($i_id > SYSTEM_USER_MAX_INDEX) {
        $g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "tests_attempts WHERE id=" . $i_id);
        $i_rSet1 = $g_db->Execute("SELECT resultid FROM " . $srv_settings['table_prefix'] . "results WHERE id=" . $i_id);
        if (!$i_rSet1) {
            showDBError(__FILE__, 1);
        } else {
            while (!$i_rSet1->EOF) {
                deleteResultRecord($i_rSet1->fields["resultid"]);
                $i_rSet1->MoveNext();
            }
            $i_rSet1->Close();
        }
        if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "results WHERE id=" . $i_id) === false) {
            showDBError(__FILE__, 2);
        }
        //9917//9917
        if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups_users WHERE id=" . $i_id) === false) {
<?php

if (isset($_POST["box_subjects"])) {
    foreach ($_POST["box_subjects"] as $f_subjectid) {
        deletesubject((int) $f_subjectid);
    }
} else {
    $f_subjectid = (int) readGetVar('subjectid');
    deletesubject($f_subjectid);
}
gotoLocation('subjects.php' . getURLAddon('', array('action', 'confirmed')));
function deletesubject($i_subjectid)
{
    global $g_db, $srv_settings;
    if ($i_subjectid > SYSTEM_SUBJECTS_MAX_INDEX) {
        if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests SET subjectid=1 WHERE subjectid=" . $i_subjectid) === false) {
            showDBError(__FILE__, 1);
        }
        if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "questions SET subjectid=1 WHERE subjectid=" . $i_subjectid) === false) {
            showDBError(__FILE__, 2);
        }
        if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "subjects WHERE subjectid={$i_subjectid}") === false) {
            showDBError(__FILE__, 3);
        }
    }
}
<?php

$f_gscaleid = (int) readGetVar('gscaleid');
$f_gscale_gradeid = (int) readGetVar('gscale_gradeid');
$f_grade_name = readPostVar('grade_name');
$f_grade_name = $g_db->qstr($f_grade_name, get_magic_quotes_gpc());
$f_grade_description = readPostVar('grade_description');
$f_grade_description = $g_db->qstr($f_grade_description, get_magic_quotes_gpc());
$f_grade_feedback = readPostVar('grade_feedback');
$f_grade_feedback = $g_db->qstr($f_grade_feedback, get_magic_quotes_gpc());
$f_grade_from = (double) readPostVar('grade_from');
if ($f_grade_from < 0) {
    $f_grade_from = 0;
}
if ($f_grade_from > 100) {
    $f_grade_from = 100;
}
$f_grade_to = (double) readPostVar('grade_to');
if ($f_grade_to < 0) {
    $f_grade_to = 0;
}
if ($f_grade_to > 100) {
    $f_grade_to = 100;
}
if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "gscales_grades SET grade_name={$f_grade_name}, grade_description={$f_grade_description}, grade_feedback={$f_grade_feedback}, grade_from='{$f_grade_from}', grade_to='{$f_grade_to}' WHERE gscaleid={$f_gscaleid} AND gscale_gradeid={$f_gscale_gradeid}") === false) {
    showDBError(__FILE__, 2);
}
gotoLocation('grades.php?action=edit&gscaleid=' . $f_gscaleid);
            $i_strData = str_replace("\r", '', $i_strData);
            $i_strData = str_replace(' ', '', $i_strData);
            $i_nData = (int) $i_strData;
            if ($i_nData < 0) {
                $i_nData = 0;
            }
            $f_subjectid = $i_nData;
            break;
    }
    $i_nCurrNearest = $i_nNextNearest;
    $i_nCurrNearestPos = $i_nNextNearestPos;
}
if (!empty($f_question_text)) {
    insertQuestion();
}
gotoLocation('test-manager.php' . getURLAddon('?action=editt', array('action')));
function NewValueApply($i_nAnswerType, $i_strValue)
{
    global $f_answer_correct, $f_answer_percents;
    switch ($i_nAnswerType) {
        case QUESTION_TYPE_MULTIPLECHOICE:
        case QUESTION_TYPE_TRUEFALSE:
        case QUESTION_TYPE_MULTIPLEANSWER:
            if (!is_array($f_answer_correct)) {
                $f_answer_correct = array();
            }
            if (!is_array($f_answer_percents)) {
                $f_answer_percents = array();
            }
            $i_nValue = (int) $i_strValue;
            if ($i_nValue > 0 and $i_nValue <= MAX_ANSWER_COUNT) {
<?php

if (isset($_POST["box_questions"])) {
    foreach ($_POST["box_questions"] as $f_questionid) {
        deleteQuestion((int) $f_questionid);
    }
} else {
    $f_questionid = (int) readGetVar('questionid');
    deleteQuestion($f_questionid);
}
if (isset($_GET["testid"])) {
    gotoLocation('test-manager.php' . getURLAddon('?action=editt', array('action', 'confirmed', 'questionid')));
} else {
    gotoLocation('question-bank.php' . getURLAddon('', array('action', 'confirmed', 'questionid')));
}
function deleteQuestion($i_questionid)
{
    global $g_db, $srv_settings;
    $i_rSet1 = $g_db->Execute("SELECT test_questionid, testid FROM " . $srv_settings['table_prefix'] . "tests_questions WHERE questionid={$i_questionid} ORDER BY test_questionid DESC");
    if (!$i_rSet1) {
        showDBError(__FILE__, 1);
    } else {
        while (!$i_rSet1->EOF) {
            deleteQuestionLink($i_rSet1->fields["testid"], $i_rSet1->fields["test_questionid"]);
            $i_rSet1->MoveNext();
        }
        $i_rSet1->Close();
    }
    if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid={$i_questionid}") === false) {
        showDBError(__FILE__, 2);
    }
<?php

if (isset($_POST["box_results"])) {
    foreach ($_POST["box_results"] as $f_resultid) {
        deleteResultRecord((int) $f_resultid);
    }
} else {
    $f_resultid = (int) readGetVar('resultid');
    deleteResultRecord($f_resultid);
}
gotoLocation('reports-manager.php' . getURLAddon('?action=', array('action', 'resultid', 'confirmed')));
<?php

if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "rtemplates (rtemplate_name, rtemplate_body) VALUES ('', '')") === false) {
    showDBError(__FILE__, 1);
}
$i_rtemplateid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'rtemplates', 'rtemplateid');
gotoLocation('report-templates.php?rtemplateid=' . $i_rtemplateid . '&action=edit');
        if (($configsuccess = $i_fh = @fopen('inc/config.inc.php', 'w')) !== false) {
            fwrite($i_fh, $i_data);
            fclose($i_fh);
        } else {
            $g_vars['page']['errors'] .= $lngstr['install_cannotwritetoconfig'];
        }
    }
}
if (!empty($_GET['download'])) {
    header("Content-Type: application/download\n");
    header("Content-Disposition: attachment; filename=\"config.inc.php\"");
    echo $_SESSION['INSTALL']['configfile'];
    exit;
}
if ($nextstage == 6) {
    gotoLocation('install-db.php');
    exit;
}
$g_vars['page']['title'] = $lngstr['install_title'];
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $lngstr['text_direction'] . '"><head><title>' . $g_vars['page']['title'] . '</title>
<meta http-equiv="Content-Language" content="' . $lngstr['meta_contentlanguage'] . '">
<meta content="text/html; charset=' . $lngstr['meta_charset'] . '" http-equiv=Content-Type>
<link rel="SHORTCUT ICON" href="favicon.ico">
<link href="shared/style.css" rel=stylesheet type=text/css>
<script language=javascript src="shared/shared.js" type="text/javascript"></script>
</head>
<body bgcolor="#ffffff"><form name="installForm" method="post" action="install.php">
<table style="height: 98%; border: 1px solid #CFD6E3;" cellpadding=0 cellspacing=25 border=0 width="780" height="100%" align=center>
<tr height="100%" vAlign=top><td><img src="images/logo.gif" width=200 height=40><br>
<input type="hidden" name="stage" value="' . $nextstage . '" />';
<?php

$f_id = (int) readGetVar('id');
$f_set = isset($_GET["set"]) ? (int) $_GET["set"] : 0;
if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "users SET user_enabled=" . $f_set . " WHERE id=" . $f_id) === false) {
    showDBError(__FILE__, 1);
}
gotoLocation('users.php' . getURLAddon('', array('action', 'set')));
<?php

gotoLocation('index.php');
<?php

if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "gscales (gscale_name) VALUES ('')") === false) {
    showDBError(__FILE__, 1);
}
$i_gscaleid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'gscales', 'gscaleid');
gotoLocation('grades.php?gscaleid=' . $i_gscaleid . '&action=settings');
<?php

if (isset($_POST["box_grades"])) {
    foreach ($_POST["box_grades"] as $f_gscaleid) {
        deleteGrade((int) $f_gscaleid);
    }
} else {
    $f_gscaleid = (int) readGetVar('gscaleid');
    deleteGrade($f_gscaleid);
}
gotoLocation('grades.php' . getURLAddon('', array('action', 'confirmed', 'gscaleid')));
function deleteGrade($i_gscaleid)
{
    global $g_db, $srv_settings;
    if ($i_gscaleid > SYSTEM_GRADES_MAX_INDEX) {
        if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests SET gscaleid=1 WHERE gscaleid=" . $i_gscaleid) === false) {
            showDBError(__FILE__, 1);
        }
        if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "gscales_grades WHERE gscaleid={$i_gscaleid}") === false) {
            showDBError(__FILE__, 2);
        }
        if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "gscales WHERE gscaleid={$i_gscaleid}") === false) {
            showDBError(__FILE__, 3);
        }
    }
}
<?php

$f_testid = (int) readGetVar('testid');
if ($f_testid) {
    $i_subjectid = 0;
    $i_rSet1 = $g_db->Execute("SELECT subjectid FROM " . $srv_settings['table_prefix'] . "tests WHERE testid={$f_testid}");
    if (!$i_rSet1) {
        showDBError(__FILE__, 1);
    } else {
        if (!$i_rSet1->EOF) {
            $i_subjectid = (int) $i_rSet1->fields['subjectid'];
        }
        $i_rSet1->Close();
    }
    if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "questions (subjectid, question_pre, question_post, question_text, question_solution) VALUES(" . $i_subjectid . ", '', '', '', '')") === false) {
        showDBError(__FILE__, 2);
    }
    $i_questionid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'questions', 'questionid');
    createQuestionLink($f_testid, $i_questionid);
    gotoLocation('question-bank.php' . getURLAddon('?action=editq&questionid=' . $i_questionid, array('action', 'questionid')));
} else {
    if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "questions (question_pre, question_post, question_text, question_solution) VALUES('', '', '', '')") === false) {
        showDBError(__FILE__, 3);
    }
    $i_questionid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'questions', 'questionid');
    gotoLocation('question-bank.php' . getURLAddon('?action=editq&questionid=' . $i_questionid, array('action', 'questionid')));
}
<?php

//9917
if ($g_db->Execute("INSERT INTO " . $srv_settings['table_prefix'] . "groups (group_name) VALUES ('')") === false) {
    showDBError(__FILE__, 1);
}
//9917
$i_groupid = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'groups', 'groupid');
gotoLocation('groups.php?groupid=' . $i_groupid . '&action=edit');
    } else {
        updateUser($arrValuesToUpdate);
    }
    if (isset($_POST['group']) && !empty($_POST['group'][0])) {
        $arrGroupIDsNew = readPostVar('group');
        unset($arrGroupIDsNew[0]);
        $arrGroupIDsToAdd = array();
        $arrGroupIDsToDelete = array();
        //9917//9917
        $i_rSet1 = $g_db->Execute("SELECT " . $srv_settings['table_prefix'] . "groups_users.groupid FROM " . $srv_settings['table_prefix'] . "groups_users WHERE id=" . $f_id);
        if (!$i_rSet1) {
            showDBError(__FILE__, 1);
        } else {
            while (!$i_rSet1->EOF) {
                if (!empty($arrGroupIDsNew[$i_rSet1->fields['groupid']])) {
                    unset($arrGroupIDsNew[$i_rSet1->fields['groupid']]);
                } else {
                    array_push($arrGroupIDsToDelete, $i_rSet1->fields['groupid']);
                }
                $i_rSet1->MoveNext();
            }
            $i_rSet1->Close();
        }
        foreach ($arrGroupIDsNew as $key => $val) {
            array_push($arrGroupIDsToAdd, $key);
        }
        manageUserGroups(array($f_id), $arrGroupIDsToAdd, true);
        manageUserGroups(array($f_id), $arrGroupIDsToDelete, false);
    }
    gotoLocation('users.php');
}
                } else {
                    gotoLocation('report-templates.php');
                }
                break;
            case 'edit':
                $g_vars['page']['title'] = $lngstr['page_title_rtemplates_edit'] . $lngstr['item_separator'] . $g_vars['page']['title'];
                if (isset($_GET['rtemplateid'])) {
                    if (isset($_POST['bsubmit'])) {
                        if ($G_SESSION['access_reporttemplates'] > 1) {
                            include_once $DOCUMENT_PAGES . "report-templates-3.inc.php";
                        } else {
                            gotoLocation('report-templates.php');
                        }
                    } else {
                        if (isset($_POST['bcancel'])) {
                            gotoLocation('report-templates.php');
                        } else {
                            include_once $DOCUMENT_PAGES . "report-templates-2.inc.php";
                        }
                    }
                }
                break;
            default:
                include_once $DOCUMENT_PAGES . "report-templates-1.inc.php";
        }
    } else {
        $g_vars['page']['notifications'] = $lngstr['inf_cant_access_reporttemplates'];
        include_once $DOCUMENT_PAGES . "home.inc.php";
    }
} else {
    $g_vars['page']['title'] = $lngstr['page_title_signin'];
                    setCookieVar('filter_reportsmanager_result_date', 0);
                    setCookieVar('filter_reportsmanager_result_datestart', 0);
                    setCookieVar('filter_reportsmanager_result_dateend', 0);
                    setCookieVar('filter_reportsmanager_id', '');
                    setCookieVar('filter_reportsmanager_testid', '');
                    setCookieVar('filter_reportsmanager_user_lastname', '');
                    setCookieVar('filter_reportsmanager_user_department', '');
                    setCookieVar('filter_reportsmanager_subjectid', '');
                    gotoLocation('reports-manager.php' . getURLAddon('?action=', array('action', 'id', 'user_lastname', 'user_department', 'testid')));
                }
                break;
            case 'exportcsv':
                if ($G_SESSION['access_reportsmanager'] > 1) {
                    include_once $DOCUMENT_PAGES . 'reports-manager-exportcsv.inc.php';
                } else {
                    gotoLocation('reports-manager.php' . getURLAddon('?action=', array('action')));
                }
                break;
            case 'preview':
            case 'print':
                include_once $DOCUMENT_PAGES . 'reports-manager-report-1.inc.php';
                break;
            default:
                include_once $DOCUMENT_PAGES . 'reports-manager-1.inc.php';
        }
    } else {
        $g_vars['page']['notifications'] = $lngstr['inf_cant_view_results'];
        include_once $DOCUMENT_PAGES . 'home.inc.php';
    }
} else {
    $g_vars['page']['title'] = $lngstr['page_title_signin'];
<?php

$f_subjectid = (int) readGetVar('subjectid');
$f_subject_parent_subjectid = (int) readPostVar('subject_parent_subjectid');
$f_subject_name = readPostVar('subject_name');
$f_subject_name = $g_db->qstr($f_subject_name, get_magic_quotes_gpc());
$f_subject_description = readPostVar('subject_description');
$f_subject_description = $g_db->qstr($f_subject_description, get_magic_quotes_gpc());
if ($g_vars['page']['errors']) {
    include_once $DOCUMENT_PAGES . "subjects-2.inc.php";
} else {
    if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "subjects SET subject_parent_subjectid={$f_subject_parent_subjectid}, subject_name={$f_subject_name}, subject_description={$f_subject_description} WHERE subjectid={$f_subjectid}") === false) {
        showDBError(__FILE__, 2);
    }
    gotoLocation('subjects.php');
}
Beispiel #30
0
         } else {
         }
     }
     break;
 case 'results':
     if (isset($G_SESSION['yt_state']) && $G_SESSION['yt_state'] == TEST_STATE_TRESULTS) {
         include_once $DOCUMENT_PAGES . 'test-showresults.inc.php';
     }
     break;
 default:
     if (!isset($G_SESSION['testid']) || isset($_GET['testid']) && $_GET['testid'] != $G_SESSION['testid'] || isset($G_SESSION['yt_state']) && ($G_SESSION['yt_state'] >= TEST_STATE_TRESULTS || $G_SESSION['yt_state'] == TEST_STATE_TESTINTRO)) {
         include_once $DOCUMENT_PAGES . 'test-3.inc.php';
     } else {
         if (isset($_POST['breview']) && !empty($_POST['review_questionno'])) {
             $i_questionno = (int) $_POST['review_questionno'];
             gotoLocation('test.php' . getURLAddon('?action=review&questionno=' . $i_questionno, array('action')));
         } else {
             if (isset($_POST['bsubmit']) || isset($_POST['bsubmit_prev']) || isset($_POST['bsubmit_next']) || isset($_POST['bsubmit_answer'])) {
                 if ($G_SESSION['yt_test_qsperpage'] != 1) {
                     include_once $DOCUMENT_PAGES . 'test-7.inc.php';
                 } else {
                     include_once $DOCUMENT_PAGES . 'test-2.inc.php';
                 }
             } else {
                 if ($G_SESSION['yt_test_qsperpage'] != 1) {
                     include_once $DOCUMENT_PAGES . 'test-6.inc.php';
                 } else {
                     include_once $DOCUMENT_PAGES . 'test-1.inc.php';
                 }
             }
         }