Show sourcecode
The following files exists in this folder. Click to view.
changeowned.php
classes/
createcard.php
database.php
forgot.php
incl/
index.php
leaderboard.php
lineup.php
login.php
logout.php
newpass.php
otherlineup.php
playerinfo.php
projekt.zip
skapatabeller.php
verify.php
changeowned.php
60 lines UTF-8 Windows (CRLF)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
$title = "Ändra samling";
$pageId = "changeowned";
$pageStyle = '
figure {
border-radius: 10px;
border-color:#333;
box-shadow: 10px 10px 5px #888;
}';
require_once("classes/collection.php");
$changecollection = new Collection($dbconn);
include("incl/protected.php");
include("incl/header.php");
$userid = $_SESSION['userid'];
if (isset($_POST['submit'])) {
foreach ($_POST as $playerid => $value) {
if ($value === 'on') {
$playerid = htmlspecialchars($playerid, ENT_QUOTES,'UTF-8');
$changecollection->removefromcollection($userid, $playerid);
} else {
continue;
}
}
header("Location: " . $_SERVER['REQUEST_URI']); // Redirect to the same page
exit;
}
if (isset($_POST['add'])) {
foreach ($_POST as $playerid => $value) {
if ($value === 'on') {
$playerid = htmlspecialchars($playerid, ENT_QUOTES,'UTF-8');
$changecollection->addtocollection($playerid, $userid);
}
}
header("Location: " . $_SERVER['REQUEST_URI']); // Redirect to the same page
exit;
}
?>
<main>
<section>
<article>
<h2>Ta bort spelare från samling</h2>
<form action="" method="post">
<?php
$changecollection->showownedplayers($userid);
?>
<button type="submit" name="submit">Ta bort</button>
</form>
</article>
<article>
<h2>Lägg till spelare till samling</h2>
<form action="" method="post">
<?php
$changecollection->show_notownedplayers($userid);
?>
<button type="submit" name="add">Lägg till</button>
</form>
</article>
</section>
</main>
<?php include("incl/footer.php"); ?>