@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | "submit" => [ |
| 43 | 43 | "type" => "submit", |
| 44 | 44 | "value" => "Login", |
| 45 | - "callback" => [$this, "callbackSubmit"] |
|
| 45 | + "callback" => [ $this, "callbackSubmit" ] |
|
| 46 | 46 | ], |
| 47 | 47 | ] |
| 48 | 48 | ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $user = $db->select("password") |
| 85 | 85 | ->from("User") |
| 86 | 86 | ->where("acronym = ?") |
| 87 | - ->execute([$acronym]) |
|
| 87 | + ->execute([ $acronym ]) |
|
| 88 | 88 | ->fetch(); |
| 89 | 89 | |
| 90 | 90 | // $user is null if user is not found |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | // $_SESSION["status"] = "Logga ut"; |
| 100 | 100 | // $_SESSION["status_url"] = "user/logout"; |
| 101 | - $_SESSION["status"] = [ |
|
| 101 | + $_SESSION[ "status" ] = [ |
|
| 102 | 102 | "text" => "Profil", |
| 103 | 103 | "url" => "user/profile", |
| 104 | 104 | "title" => "Profil", |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ], |
| 113 | 113 | ], |
| 114 | 114 | ]; |
| 115 | - $_SESSION["acronym"] = $acronym; |
|
| 115 | + $_SESSION[ "acronym" ] = $acronym; |
|
| 116 | 116 | // $this->form->addOutput("User logged in."); |
| 117 | 117 | return true; |
| 118 | 118 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | // "description" => "Here you can place a description.", |
| 31 | 31 | "placeholder" => "Sök", |
| 32 | 32 | "label" => "Sök", |
| 33 | - "callback" => [$this, "callbackSubmit"], |
|
| 33 | + "callback" => [ $this, "callbackSubmit" ], |
|
| 34 | 34 | ] |
| 35 | 35 | ] |
| 36 | 36 | ); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | ], |
| 33 | 33 | "submit" => [ |
| 34 | 34 | "type" => "submit", |
| 35 | - "callback" => [$this, "callbackSubmit"], |
|
| 35 | + "callback" => [ $this, "callbackSubmit" ], |
|
| 36 | 36 | ], |
| 37 | 37 | ] |
| 38 | 38 | ); |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | // ->fetchAll(); |
| 52 | 52 | // var_dump($user) |
| 53 | 53 | $db->connect() |
| 54 | - ->insert("Question", ["acronym", "question", "tags", "points", "created"]) |
|
| 55 | - ->execute([$this->acronym, $this->question, $this->tags, $this->points, $this->created]); |
|
| 54 | + ->insert("Question", [ "acronym", "question", "tags", "points", "created" ]) |
|
| 55 | + ->execute([ $this->acronym, $this->question, $this->tags, $this->points, $this->created ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $db = $di->get("dbqb"); |
| 48 | 48 | $db->connect() |
| 49 | - ->insert("Comments", ["questionId", "acronym", "comment", "points", "created"]) |
|
| 50 | - ->execute([$this->questionId, $this->acronym, $this->comment, $this->points, $this->created]); |
|
| 49 | + ->insert("Comments", [ "questionId", "acronym", "comment", "points", "created" ]) |
|
| 50 | + ->execute([ $this->questionId, $this->acronym, $this->comment, $this->points, $this->created ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $db = $di->get("dbqb"); |
| 64 | 64 | $db->connect() |
| 65 | - ->insert("AnswerComments", ["answerId", "acronym", "comment", "points", "created"]) |
|
| 66 | - ->execute([$this->answerId, $this->acronym, $this->comment, $this->points, $this->created]); |
|
| 65 | + ->insert("AnswerComments", [ "answerId", "acronym", "comment", "points", "created" ]) |
|
| 66 | + ->execute([ $this->answerId, $this->acronym, $this->comment, $this->points, $this->created ]); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | $res = $db->select("name") |
| 59 | 59 | ->from("Pictures") |
| 60 | 60 | ->where("acronym = ?") |
| 61 | - ->execute(["default"]) |
|
| 61 | + ->execute([ "default" ]) |
|
| 62 | 62 | ->fetchAll(); |
| 63 | 63 | |
| 64 | - $array = []; |
|
| 64 | + $array = [ ]; |
|
| 65 | 65 | foreach ($res as $val) { |
| 66 | 66 | // var_dump($val->name); |
| 67 | 67 | array_push($array, $val->name); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $pic = array_rand($array, 1); |
| 72 | 72 | // var_dump($array[$pic]); |
| 73 | - $this->picture = $array[$pic]; |
|
| 73 | + $this->picture = $array[ $pic ]; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $db = $di->get("dbqb"); |
| 106 | 106 | $db->connect() |
| 107 | - ->insert("User", ["acronym", "password", "picture", "points", "created"]) |
|
| 108 | - ->execute([$this->acronym, $this->password, $this->picture, $this->points, $this->created]); |
|
| 107 | + ->insert("User", [ "acronym", "password", "picture", "points", "created" ]) |
|
| 108 | + ->execute([ $this->acronym, $this->password, $this->picture, $this->points, $this->created ]); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | "submit" => [ |
| 52 | 52 | "type" => "submit", |
| 53 | 53 | "value" => "Ställ fråga", |
| 54 | - "callback" => [$this, "callbackSubmit"] |
|
| 54 | + "callback" => [ $this, "callbackSubmit" ] |
|
| 55 | 55 | ], |
| 56 | 56 | ] |
| 57 | 57 | ); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | "submit" => [ |
| 57 | 57 | "type" => "submit", |
| 58 | 58 | "value" => "Skicka", |
| 59 | - "callback" => [$this, "callbackSubmit"] |
|
| 59 | + "callback" => [ $this, "callbackSubmit" ] |
|
| 60 | 60 | ], |
| 61 | 61 | ] |
| 62 | 62 | ); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ($_SESSION["acronym"] ?? null) { |
|
| 3 | - $status = $_SESSION["status"]; |
|
| 2 | +if ($_SESSION[ "acronym" ] ?? null) { |
|
| 3 | + $status = $_SESSION[ "status" ]; |
|
| 4 | 4 | $questions = [ |
| 5 | 5 | "text" => "Frågor", |
| 6 | 6 | "url" => "user/questions", |