-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsave_badge.php
More file actions
27 lines (24 loc) · 806 Bytes
/
save_badge.php
File metadata and controls
27 lines (24 loc) · 806 Bytes
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
<?php
namespace gameme\PHPGamification;
/*
use Exception;
use gameme\PHPGamification;
use gameme\PHPGamification\Model;
use gameme\PHPGamification\Model\Event;
*/
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
$_POST["editval"] = str_replace("\n", "", $_POST["editval"]);
$_POST["editval"] = str_replace("\r", "", $_POST["editval"]);
if($_POST["editval"] != ''){
$sql = "UPDATE %sgm_badges set %s = '%s' WHERE id=%d";
if($_SESSION['course_id'] > 0){
$result = queryDB($sql, array(TABLE_PREFIX, $_POST["column"], $_POST["editval"], $_POST["id"], $_SESSION['course_id']));
}else{
$result = queryDB($sql, array(TABLE_PREFIX, $_POST["column"], $_POST["editval"], $_POST["id"], 0));
}
}
if(!empty($result)){
return true;
}
?>