-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_record.php
executable file
·39 lines (34 loc) · 1.16 KB
/
delete_record.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php // $Id: edit_answer.php,v 1.0 2010/05/28 09:26:00
/**
* This page prints a particular instance of decisiontree
*
* @author Andre Scherl
* @version $Id: edit_answer.php,v 1.0 2010/05/28 09:26:00
* @package decisiontree
*
* Copyright (C) 2011, Andre Scherl
* You should have received a copy of the GNU General Public License
* along with DASIS. If not, see <http://www.gnu.org/licenses/>.
*/
require_once("../../config.php");
require_once("lib.php");
global $DB;
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
$table = optional_param('table', 0, PARAM_TEXT); // decisiontree ID
$did = optional_param('did', 0, PARAM_INT);
if($id && $table && $did) {
echo "delete... ";
$DB->delete_records($table, array("id" => $id));
if($table == "decisiontree_questions") {
$DB->delete_records("decisiontree_answers", array("question" => $id));
}
echo "Okay";
}else{
error("Missing parameter");
}
if($table == "decisiontree_questions" || $table == "decisiontree_answers") {
redirect('edit_question.php?did='.$did);
}else{
redirect('edit_path.php?did='.$did);
}
?>