2 /****************************************************************************/
\r
4 /****************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************************/
\r
14 define('AT_INCLUDE_PATH', '../../../../include/');
\r
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 authenticate(AT_PRIV_GLOSSARY);
\r
19 if ($_POST['submit_no']) {
\r
20 $msg->addFeedback('CANCELLED');
\r
21 header('Location: index.php');
\r
25 if ($_POST['submit_yes']) {
\r
27 $_POST['gid'] = intval($_POST['gid']);
\r
29 $sql = "DELETE FROM ".TABLE_PREFIX."glossary WHERE word_id=$_POST[gid] AND course_id=$_SESSION[course_id]";
\r
30 $result = mysql_query($sql, $db);
\r
32 $sql = "UPDATE ".TABLE_PREFIX."glossary SET related_word_id=0 WHERE related_word_id=$_POST[gid] AND course_id=$_SESSION[course_id]";
\r
33 $result = mysql_query($sql, $db);
\r
35 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
\r
36 header('Location: index.php');
\r
38 } else if ($_POST['submit_no']) {
\r
40 $msg->addFeedback('CANCELLED');
\r
41 header('Location: index.php');
\r
45 require(AT_INCLUDE_PATH.'header.inc.php');
\r
47 $_GET['gid'] = intval($_GET['gid']);
\r
49 if ($_GET['gid'] == 0) {
\r
50 $msg->printErrors('ITEM_NOT_FOUND');
\r
51 require(AT_INCLUDE_PATH.'footer.inc.php');
\r
55 $hidden_vars['word'] = $_GET['t'];
\r
56 $hidden_vars['gid'] = $_GET['gid'];
\r
58 $sql = "SELECT * from ".TABLE_PREFIX."glossary WHERE word_id = '$hidden_vars[gid]'";
\r
59 $result = mysql_query($sql, $db);
\r
60 while ($row = mysql_fetch_assoc($result)){
\r
61 $title = $row['word'];
\r
64 $msg->addConfirm(array('DELETE', htmlentities_utf8($title)), $hidden_vars);
\r
65 $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
\r
67 $msg->printConfirm();
\r
69 require(AT_INCLUDE_PATH.'footer.inc.php');
\r