Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Rankning implements ContainerInjectableInterface |
||
9 | { |
||
10 | use ContainerInjectableTrait; |
||
11 | |||
12 | public function __construct($di) |
||
13 | { |
||
14 | $this->di = $di; |
||
15 | } |
||
16 | |||
17 | public function upp($id) |
||
18 | { |
||
19 | $db = $this->di->get("db"); |
||
20 | $db->connect(); |
||
21 | $sql = "UPDATE inlagg SET rankning = rankning + 1 WHERE id=?;"; |
||
22 | $db->execute($sql, [$id]); |
||
23 | |||
24 | return; |
||
25 | } |
||
26 | |||
27 | public function ner($id) |
||
28 | { |
||
29 | $db = $this->di->get("db"); |
||
30 | $db->connect(); |
||
31 | $sql = "UPDATE inlagg SET rankning = rankning - 1 WHERE id=?;"; |
||
32 | $db->execute($sql, [$id]); |
||
33 | |||
34 | return; |
||
35 | } |
||
36 | |||
37 | public function acceptera($id) |
||
45 | } |
||
46 | |||
47 | public function uppdatera($id, $kategori, $varde) |
||
48 | { |
||
49 | $db = $this->di->get("db"); |
||
50 | $db->connect(); |
||
51 | $sql = "UPDATE anvandare2 SET " .$kategori. " = " .$kategori. " + " . $varde . " WHERE anvandarid = ?;"; |
||
52 | $db->execute($sql, [$id]); |
||
53 | return; |
||
54 | } |
||
55 | |||
56 | public function vemsInlagg($id) |
||
63 | } |
||
64 | } |
||
65 |