-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate_helpme.php
More file actions
35 lines (32 loc) · 1.35 KB
/
update_helpme.php
File metadata and controls
35 lines (32 loc) · 1.35 KB
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
<?php
/************************************************************************/
/* ATutor */
/************************************************************************/
/* Copyright (c) 2013 */
/* ATutorSpaces */
/* https://atutorspaces.com */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
define('AT_INCLUDE_PATH', '../../include/');
require_once(AT_INCLUDE_PATH.'vitals.inc.php');
if(isset($_GET['next_helpme'])){
$help_id = intval($_GET['next_helpme']);
}else{
$help_id = intval($_GET['help_id']);
}
if(isset($_GET['user_id'])){
$member_id = intval($_GET['user_id']);
} else {
$member_id = $_SESSION['member_id'];
}
if($_GET['help_id'] > 0){
$sql = "REPLACE INTO %shelpme_user (`user_id`, `help_id`) VALUES (%d,%d)";
queryDB( $sql, array(TABLE_PREFIX, $member_id, $help_id));
} else{
$sql = "DELETE from %shelpme_user WHERE user_id = %d";
queryDB( $sql, array(TABLE_PREFIX, $member_id));
}
unset($_SESSION['message']);
?>