Esempio n. 1
0
    $_POST['organizationdescr'] = $addslashes($_POST['organizationdescr']);
    $_POST['submit'] = $addslashes($_POST['submit']);
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
    exit;
} else {
    if (isset($_POST['form_basiclti'])) {
        if (at_form_validate($blti_admin_form, $msg)) {
            $sql = "SELECT count(*) cnt FROM %sbasiclti_tools WHERE toolid = '%s'";
            $row = queryDB($sql, array(TABLE_PREFIX, $_POST['toolid']), TRUE);
            if ($row["cnt"] != 0) {
                $msg->addError('NEED_UNIQUE_TOOLID');
            } else {
                $sql = at_form_insert($_POST, $blti_admin_form);
                $sql = 'INSERT INTO %sbasiclti_tools ' . $sql;
                $result = queryDB($sql, array(TABLE_PREFIX));
                global $sqlout;
                write_to_log(AT_ADMIN_LOG_INSERT, 'basiclti_create', $result, $sqlout);
                $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
                header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
                exit;
            }
        }
    }
}
include AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
?>
<form method="post" action="<?php 
Esempio n. 2
0
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_instructor.php');
    exit;
} else {
    if (isset($_POST['form_basiclti']) && isset($_POST['submit'])) {
        if (at_form_validate($blti_instructor_form, $msg)) {
            $sql = "SELECT count(*) cnt FROM " . TABLE_PREFIX . "basiclti_tools WHERE toolid = '" . mysql_real_escape_string($_POST['toolid']) . "' AND course_id = " . $_SESSION['course_id'];
            $result = mysql_query($sql, $db) or die(mysql_error());
            $row = mysql_fetch_assoc($result);
            if ($row["cnt"] != 0) {
                $msg->addFeedback('NEED_UNIQUE_TOOLID');
            } else {
                $fields = array('course_id' => $_SESSION['course_id']);
                $sql = at_form_insert($_POST, $blti_instructor_form, $fields);
                $sql = 'INSERT INTO ' . TABLE_PREFIX . "basiclti_tools " . $sql;
                $result = mysql_query($sql, $db) or die(mysql_error());
                write_to_log(AT_ADMIN_LOG_INSERT, 'basiclti_create', mysql_affected_rows($db), $sql);
                $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
                header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_instructor.php');
                exit;
            }
        }
    }
}
include AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
?>
<form method="post" action="<?php 
echo $_SERVER['PHP_SELF'];