本文整理汇总了PHP中showDBError函数的典型用法代码示例。如果您正苦于以下问题:PHP showDBError函数的具体用法?PHP showDBError怎么用?PHP showDBError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showDBError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteUser
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) {
showDBError(__FILE__, 3);
}
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_id) === false) {
showDBError(__FILE__, 4);
}
}
}
示例2: deleteVisitor
function deleteVisitor($i_visitorid)
{
global $g_db, $srv_settings;
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "visitors WHERE visitorid={$i_visitorid}") === false) {
showDBError(__FILE__, 1);
}
}
示例3: deleteETemplate
function deleteETemplate($i_etemplateid)
{
global $g_db, $srv_settings;
if ($i_etemplateid > SYSTEM_ETEMPLATES_MAX_INDEX) {
if ($g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "tests SET result_etemplateid=0 WHERE result_etemplateid={$i_etemplateid}") === false) {
showDBError(__FILE__, 1);
}
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "etemplates WHERE etemplateid={$i_etemplateid}") === false) {
showDBError(__FILE__, 2);
}
}
}
示例4: deleteGrade
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);
}
}
}
示例5: deletesubject
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);
}
}
}
示例6: deleteTest
function deleteTest($i_testid)
{
global $g_db, $srv_settings;
$g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "tests_attempts WHERE testid=" . $i_testid);
//9917//9917
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups_tests WHERE testid=" . $i_testid) === false) {
showDBError(__FILE__, 1);
}
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "tests_questions WHERE testid=" . $i_testid) === false) {
showDBError(__FILE__, 2);
}
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_testid) === false) {
showDBError(__FILE__, 3);
}
}
示例7: deleteGroup
function deleteGroup($i_groupid)
{
global $g_db, $srv_settings;
if ($i_groupid > SYSTEM_GROUP_MAX_INDEX) {
//9917//9917
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups_users WHERE groupid={$i_groupid}") === false) {
showDBError(__FILE__, 1);
}
//9917//9917
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups_tests WHERE groupid={$i_groupid}") === false) {
showDBError(__FILE__, 2);
}
//9917
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "groups WHERE groupid={$i_groupid}") === false) {
showDBError(__FILE__, 3);
}
}
}
示例8: deleteQuestion
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);
}
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "questions WHERE questionid={$i_questionid}") === false) {
showDBError(__FILE__, 3);
}
}
示例9: deleteScaleGrade
function deleteScaleGrade($gscaleid, $gscale_gradeid)
{
global $g_db, $srv_settings;
if ($g_db->Execute("DELETE FROM " . $srv_settings['table_prefix'] . "gscales_grades WHERE gscaleid=" . $gscaleid . " AND gscale_gradeid=" . $gscale_gradeid) === false) {
showDBError(__FILE__, 1);
}
$i_rSet2 = $g_db->Execute("SELECT gscale_gradeid FROM " . $srv_settings['table_prefix'] . "gscales_grades WHERE gscaleid=" . $gscaleid . " AND gscale_gradeid>" . $gscale_gradeid . " ORDER BY gscale_gradeid");
if (!$i_rSet2) {
showDBError(__FILE__, 2);
} else {
$i_counter = $gscale_gradeid - 1;
while (!$i_rSet2->EOF) {
$i_counter++;
if ($i_rSet2->fields["gscale_gradeid"] != $i_counter) {
$g_db->Execute("UPDATE " . $srv_settings['table_prefix'] . "gscales_grades SET gscale_gradeid=" . $i_counter . " WHERE gscaleid=" . $gscaleid . " AND gscale_gradeid=" . $i_rSet2->fields["gscale_gradeid"]);
}
$i_rSet2->MoveNext();
}
$i_rSet2->Close();
}
}
示例10: getAdvancedReportPDF
function getAdvancedReportPDF($resultid)
{
global $g_db, $G_SESSION, $DOCUMENT_FPDF, $lngstr, $srv_settings, $i_rSet2, $i_rSet3, $i_rSet4, $i_rSet5, $i_rSet6;
ob_start();
include_once $DOCUMENT_FPDF . 'html2fpdf.php';
$i_pdf = false;
$i_can_access = false;
if ($G_SESSION['access_reportsmanager'] > 1) {
$i_can_access = true;
} else {
$i_rSet1 = $g_db->Execute("SELECT resultid FROM " . $srv_settings['table_prefix'] . "results WHERE id=" . $G_SESSION['id'] . " AND resultid=" . $resultid);
if (!$i_rSet1) {
showDBError(__FILE__, 1);
} else {
$i_can_access = $i_rSet1->RecordCount() > 0;
}
}
$i_isok = $i_can_access;
if ($i_isok) {
$i_isok = $i_rSet2 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "results WHERE resultid=" . $resultid, 1);
}
if ($i_isok) {
$i_isok = !$i_rSet2->EOF;
}
if ($i_isok) {
$i_isok = $i_rSet3 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_rSet2->fields['testid'], 1);
}
if ($i_isok) {
$i_isok = !$i_rSet3->EOF;
}
if ($i_isok) {
$i_isok = $i_rSet3->fields['rtemplateid'] > 0 && ($i_rSet3->fields['test_reportgradecondition'] == 0 || $i_rSet3->fields['test_reportgradecondition'] >= $i_rSet2->fields['gscale_gradeid']);
}
if ($i_isok) {
$i_isok = $i_rSet6 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_rSet2->fields['id'], 1);
}
if ($i_isok) {
$i_isok = !$i_rSet6->EOF;
}
$i_result_detailed_1_items = array();
$i_result_detailed_2_items = array();
$i_result_detailed_3_items = array();
$i_result_detailed_4_items = array();
if ($i_isok) {
$i_isok = $i_rSet7 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "results_answers, " . $srv_settings['table_prefix'] . "questions WHERE resultid=" . $resultid . " AND " . $srv_settings['table_prefix'] . "results_answers.questionid=" . $srv_settings['table_prefix'] . "questions.questionid ORDER BY result_answerid");
}
if ($i_isok) {
$i_questionno = 0;
while (!$i_rSet7->EOF) {
$i_questionno++;
$i_answers = array();
$i_rSet5 = $g_db->Execute("SELECT answer_text, answer_correct FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid=" . $i_rSet7->fields['questionid'] . " ORDER BY answerid");
if (!$i_rSet5) {
showDBError(__FILE__, 5);
} else {
$i_answerno = 1;
while (!$i_rSet5->EOF) {
$i_answers[$i_answerno] = $i_rSet5->fields['answer_text'];
$i_answers_correct[$i_answerno] = $i_rSet5->fields['answer_correct'];
$i_answerno++;
$i_rSet5->MoveNext();
}
$i_rSet5->Close();
}
$i_detailed_correct = $i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT;
$i_result_detailed_3_items[$i_questionno] = $i_questionno . '. ' . getTruncatedHTML($i_rSet7->fields['question_text'], 0);
$i_result_detailed_1_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno] . '<br />';
$i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_iscorrect'] . ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_UNDEFINED ? $lngstr['label_undefined'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT ? $lngstr['label_yes'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_PARTIALLYCORRECT ? $lngstr['label_partially'] : $lngstr['label_no']))) . '<br />';
$i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '<br />';
if (!$i_detailed_correct) {
$i_result_detailed_2_items[$i_questionno] = $i_result_detailed_1_items[$i_questionno];
}
$i_result_detailed_3_items[$i_questionno] = '<tr><td>' . $i_result_detailed_3_items[$i_questionno] . '</td></tr>';
for ($i = 1; $i < $i_answerno; $i++) {
switch ($i_rSet7->fields['question_type']) {
case QUESTION_TYPE_MULTIPLECHOICE:
case QUESTION_TYPE_TRUEFALSE:
$i_answers_given = (int) $i_rSet7->fields['result_answer_text'];
$i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : ($i == $i_answers_given ? '4' : '0')) . '.gif" width=13 height=13> ' . $i_answers[$i] . '</tr>';
break;
case QUESTION_TYPE_MULTIPLEANSWER:
$i_answers_given = explode(QUESTION_TYPE_MULTIPLEANSWER_BREAK, $i_rSet7->fields['result_answer_text']);
$i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : (in_array($i, $i_answers_given) ? '4' : '0')) . '.gif" width=13 height=13> ' . $i_answers[$i] . '</tr>';
break;
case QUESTION_TYPE_FILLINTHEBLANK:
$i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_answers[$i]) . '</td></tr>';
break;
}
}
if ($i_rSet7->fields['question_type'] == QUESTION_TYPE_ESSAY) {
$i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_rSet7->fields['result_answer_text']) . '</td></tr>';
}
$i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '</td></tr>';
if (!$i_detailed_correct) {
$i_result_detailed_4_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno];
}
$i_rSet7->MoveNext();
}
$i_rSet7->Close();
$i_result_detailed_1_text = implode('<br />', $i_result_detailed_1_items);
//.........这里部分代码省略.........
示例11: showDBError
showDBError(__FILE__, 4);
} else {
if (!$i_rSet4->EOF) {
$i_questiontext = $i_rSet4->fields["question_text"];
$i_questiontype = $i_rSet4->fields["question_type"];
$i_questionpoints = $i_rSet4->fields["question_points"];
}
$i_rSet4->Close();
}
echo '<h2>' . $lngstr['page_reportsmanager']['correct_answer'] . '</h2>';
echo '<p><table cellpadding=0 cellspacing=5 border=0 width="100%">';
echo '<tr><td colspan=2>' . $i_questiontext . '</td></tr>';
$i_answers = array();
$i_rSet5 = $g_db->Execute("SELECT answer_text, answer_correct FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid=" . $i_questionid . " ORDER BY answerid");
if (!$i_rSet5) {
showDBError(__FILE__, 5);
} else {
$i_answerno = 1;
while (!$i_rSet5->EOF) {
$i_answers[$i_answerno] = $i_rSet5->fields["answer_text"];
$i_answers_correct[$i_answerno] = $i_rSet5->fields["answer_correct"];
$i_answerno++;
$i_rSet5->MoveNext();
}
$i_rSet5->Close();
}
for ($i = 1; $i < $i_answerno; $i++) {
echo '<tr>';
switch ($i_questiontype) {
case QUESTION_TYPE_MULTIPLECHOICE:
case QUESTION_TYPE_TRUEFALSE:
示例12: writeResultStats
function writeResultStats($i_resultid)
{
global $g_db, $lngstr, $srv_settings, $g_vars;
$g_vars['page']['resultid'] = $i_resultid;
$i_testid = 0;
$i_rSet6 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "results WHERE resultid=" . $i_resultid, 1);
if (!$i_rSet6) {
showDBError(__FILE__, 6);
} else {
if (!$i_rSet6->EOF) {
$i_testid = $i_rSet6->fields['testid'];
$g_vars['page']['result_date'] = getDateLocal($lngstr['language']['date_format_full'], $i_rSet6->fields['result_datestart']);
$g_vars['page']['time_spent'] = getTimeFormatted($i_rSet6->fields['result_timespent']);
$g_vars['page']['got_points'] = $i_rSet6->fields['result_points'];
$g_vars['page']['points_max'] = $i_rSet6->fields['result_pointsmax'];
$g_vars['page']['score'] = $g_vars['page']['points_max'] != 0 ? round($g_vars['page']['got_points'] * 100 / $g_vars['page']['points_max']) : 100;
$g_vars['page']['grade'] = getGradeData($i_rSet6->fields['gscaleid'], $i_rSet6->fields['gscale_gradeid']);
$i_id = $i_rSet6->fields['id'];
$i_rSet7 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_id, 1);
if (!$i_rSet7) {
showDBError(__FILE__, 7);
} else {
if (!$i_rSet7->EOF) {
$g_vars['page']['username'] = $i_rSet7->fields['user_firstname'] . ' ' . $i_rSet7->fields['user_lastname'];
}
$i_rSet7->Close();
}
}
$i_rSet6->Close();
}
$g_vars['page']['test_name'] = '';
$i_gscaleid = 0;
$i_rSet1 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_testid, 1);
if (!$i_rSet1) {
showDBError(__FILE__, 1);
} else {
if (!$i_rSet1->EOF) {
$g_vars['page']['test_name'] = $i_rSet1->fields['test_name'];
$i_gscaleid = $i_rSet1->fields['gscaleid'];
}
$i_rSet1->Close();
}
$g_vars['page']['grades_times_total'] = 0;
$i_rSet2 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "gscales_grades WHERE gscaleid=" . $i_gscaleid . " ORDER BY gscale_gradeid");
if (!$i_rSet2) {
showDBError(__FILE__, 2);
} else {
while (!$i_rSet2->EOF) {
$i_gradeid = $i_rSet2->fields['gscale_gradeid'];
$g_vars['page']['grades'][$i_gradeid]['name'] = $i_rSet2->fields['grade_name'];
$g_vars['page']['grades'][$i_gradeid]['times'] = getRecordCount($srv_settings['table_prefix'] . 'results', 'testid=' . $i_testid . ' AND gscaleid=' . $i_gscaleid . ' AND gscale_gradeid=' . $i_gradeid);
$g_vars['page']['grades_times_total'] += $g_vars['page']['grades'][$i_gradeid]['times'];
$i_rSet2->MoveNext();
}
$i_rSet2->Close();
}
foreach ($g_vars['page']['grades'] as $i_gradeid => $i_grade) {
$g_vars['page']['grades'][$i_gradeid]['times_percents'] = $g_vars['page']['grades_times_total'] != 0 ? $g_vars['page']['grades'][$i_gradeid]['times'] * 100 / $g_vars['page']['grades_times_total'] : 0;
}
$g_vars['page']['test']['participant_count'] = 0;
$i_points_all = array();
$g_vars['page']['test']['points_max'] = 0;
$g_vars['page']['test']['points_low'] = IGT_MAX_FLOAT;
$g_vars['page']['test']['points_high'] = 0;
$i_points_total = 0;
$g_vars['page']['test']['points_total_max'] = 0;
$i_rSet3 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "results WHERE testid=" . $i_testid . " AND gscale_gradeid > 0");
if (!$i_rSet3) {
showDBError(__FILE__, 3);
} else {
while (!$i_rSet3->EOF) {
$g_vars['page']['test']['participant_count']++;
$i_points = $i_rSet3->fields['result_points'];
array_push($i_points_all, $i_points);
$g_vars['page']['test']['points_max'] = $i_rSet3->fields['result_pointsmax'];
if ($i_points > $g_vars['page']['test']['points_high']) {
$g_vars['page']['test']['points_high'] = $i_points;
}
if ($i_points < $g_vars['page']['test']['points_low']) {
$g_vars['page']['test']['points_low'] = $i_points;
}
$i_points_total += $i_points;
$g_vars['page']['test']['points_total_max'] += $g_vars['page']['test']['points_max'];
$i_rSet3->MoveNext();
}
$i_rSet3->Close();
}
$g_vars['page']['test']['points_average'] = $i_points_total / $g_vars['page']['test']['participant_count'];
$g_vars['page']['test']['points_average_percents'] = $i_points_total * 100 / $g_vars['page']['test']['points_total_max'];
$g_vars['page']['test']['points_high_percents'] = $g_vars['page']['test']['points_high'] * 100 / $g_vars['page']['test']['points_max'];
$g_vars['page']['test']['points_low_percents'] = $g_vars['page']['test']['points_low'] * 100 / $g_vars['page']['test']['points_max'];
$g_vars['page']['test']['variance'] = 0;
if ($g_vars['page']['test']['participant_count'] > 1) {
foreach ($i_points_all as $i_points) {
$g_vars['page']['test']['variance'] += ($i_points - $g_vars['page']['test']['points_average']) * ($i_points - $g_vars['page']['test']['points_average']);
}
$g_vars['page']['test']['variance'] = $g_vars['page']['test']['variance'] / ($g_vars['page']['test']['participant_count'] - 1);
}
$g_vars['page']['test']['std_deviation'] = sqrt($g_vars['page']['test']['variance']);
$g_vars['page']['questions'] = array();
//.........这里部分代码省略.........
示例13: writeQryTableHeaders
echo '<td width=32><a href="groups.php?pageno=' . $i_pageno_count . $i_url_pages_addon . '"><img src="images/button-last-big.gif" border=0 title="' . $lngstr['button_last_page'] . '"></a></td>';
} else {
echo '<td width=32><img src="images/button-next-big-inactive.gif" border=0 title="' . $lngstr['button_next_page'] . '"></td>';
echo '<td width=32><img src="images/button-last-big-inactive.gif" border=0 title="' . $lngstr['button_last_page'] . '"></td>';
}
}
echo '<td width=2><img src="images/toolbar-right.gif" width=2 height=32></td></tr></table>';
echo '</td></tr><tr><td>';
echo '<table class=rowtable2 cellpadding=5 cellspacing=1 border=0 width="100%">';
echo '<tr vAlign=top><td class=rowhdr1 title="' . $lngstr['label_hdr_select_hint'] . '" width=22><input type=checkbox name=toggleAll onclick="toggleCBs(this);"></td>';
writeQryTableHeaders('groups.php?action=' . $i_url_limit_addon, $i_tablefields, $i_order_no, $i_direction);
echo '<td class=rowhdr1 colspan=2>' . $lngstr['label_hdr_action'] . '</td></tr>';
//9917
$i_rSet1 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "groups" . $i_sql_order_addon, $i_limitcount, $i_limitfrom);
if (!$i_rSet1) {
showDBError(__FILE__, 1);
} else {
$i_counter = 0;
while (!$i_rSet1->EOF) {
$rowname = $i_counter % 2 ? "rowone" : "rowtwo";
echo '<tr id=tr_' . $i_pagewide_id . ' class=' . $rowname . ' onmouseover="rollTR(' . $i_pagewide_id . ',1);" onmouseout="rollTR(' . $i_pagewide_id . ',0);"><td align=center width=22' . ($i_rSet1->fields["groupid"] > SYSTEM_GROUP_MAX_INDEX ? '' : ' class=system') . '><input id=cb_' . $i_pagewide_id . ' type=checkbox name=box_groups[] value="' . $i_rSet1->fields["groupid"] . '" onclick="toggleCB(this);"></td><td align=right>' . $i_rSet1->fields["groupid"] . '</td><td>' . getTruncatedHTML($i_rSet1->fields["group_name"]) . '</td><td>' . $i_rSet1->fields["group_description"] . '</td>';
echo '<td align=center width=22><a href="groups.php?groupid=' . $i_rSet1->fields["groupid"] . $i_order_addon . $i_url_limit_addon . '&action=edit"><img width=20 height=20 border=0 src="images/button-edit.gif" title="' . $lngstr['label_action_group_edit'] . '"></a></td><td align=center width=22>' . ($i_rSet1->fields["groupid"] > SYSTEM_GROUP_MAX_INDEX ? '<a href="groups.php?groupid=' . $i_rSet1->fields["groupid"] . $i_order_addon . $i_url_limit_addon . '&action=delete" onclick="return confirmMessage(this, \'' . $lngstr['qst_delete_group'] . '\')"><img width=20 height=20 border=0 src="images/button-cross.gif" title="' . $lngstr['label_action_group_delete'] . '"></a>' : '<img width=20 height=20 border=0 src="images/button-cross-inactive.gif">') . '</td></tr>';
$i_counter++;
$i_pagewide_id++;
$i_rSet1->MoveNext();
}
$i_rSet1->Close();
}
echo '</table>';
echo '</td></tr></table></form>';
displayTemplate('_footer');
示例14: die
<link rel="stylesheet" type="text/css" href="cache.php?css=theme,default" />
<link rel="SHORTCUT ICON" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="cache.php?css=menu,treeview,results,context,alerts" />
<script type="text/javascript" language="javascript" src="cache.php?script=jquery,mobile,<?php
echo $DB->name();
?>
"></script>
<!--[if lt IE 8]>
<script type="text/javascript" language="javascript" src="cache.php?script=json2"></script>
<![endif]-->
</head>
<body class="mainbody">
<?php
if (!$DB->connect(DB_HOST, DB_USER, DB_PASS, getDbName())) {
include BASE_PATH . "/modules/splash.php";
die(getSplashScreen(showDBError()));
}
if (Session::get('session', 'init') != '1') {
// session just started, so we load information here
Session::set('db', 'user', $DB->getCurrentUser(), true);
Session::set('session', 'init', 1);
}
$KEY_CODES = getKeyCodes();
?>
<div id="editToolbar">
<div class="tb-header ui-widget-header"><span class="fname"></span></div>
<div class="tb-row">Type: <span class="ftype"></span></div>
<div class="tb-row">[ <?php
echo str_replace('{{KEY}}', $KEY_CODES['KEYCODE_SETNULL'][1], __('Press {{KEY}} to set NULL'));
?>
]</div>
示例15: showDBError
}
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');