-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsget.php
More file actions
40 lines (37 loc) · 1.37 KB
/
jsget.php
File metadata and controls
40 lines (37 loc) · 1.37 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
36
37
38
39
40
<?php
include_once("connection.php");
include_once("function.php");
include_once("stickerfunctions.php");
if(!empty($_GET)){
if ($_GET['block'] == 0){
$block = "";
} elseif($_GET['block'] == 1){
$block = "block";
}
echo $block;
$returninfo = addsticker($_GET['studentid'],$_GET['classid'],$_GET['stickercolor']);
if($returninfo == "stickered"){
updateused($_GET['studentid'],$_GET['stickercolor']. "stickers","remove",$_GET['block']);
} elseif ($returninfo == "unstickered"){
updateused($_GET['studentid'],$_GET['stickercolor']. "stickers","add",$_GET['block']);
}
$studentid = $_GET['studentid'];
$stickertype = $block . $_GET['stickercolor'] . "stickers";
$getused = $db_stickers->query("SELECT $stickertype FROM usedstickers WHERE studentid=$studentid");
$usedstickers = array();
while($data_result = $getused->fetch_row()) {
array_push($usedstickers, $data_result);
}
$usedstickers = $usedstickers[0][0];
if($usedstickers < 0){
$returninfo = addsticker($_GET['studentid'],$_GET['classid'],$_GET['stickercolor']);
if($returninfo == "stickered"){
updateused($_GET['studentid'],$_GET['stickercolor']. "stickers","remove",$_GET['block']);
} elseif ($returninfo == "unstickered"){
updateused($_GET['studentid'],$_GET['stickercolor']. "stickers","add",$_GET['block']);
}
$returninfo = null;
}
echo $returninfo;
}
?>