Completed
Push — master ( 8cdaf4...db6695 )
by Marcus
02:35
created
src/Controller/Admin/Shop/Itemgroupadmin.php 1 patch
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,9 @@  discard block
 block discarded – undo
81 81
                 ];
82 82
                 $sql = DBTools::buildPSInsertQuery($aData, 'itemgroups_text');
83 83
                 $hResult = $this->db->prepare($sql);
84
-                foreach ($aData as $sKey => $sValue) $hResult->bindValue(':'.$sKey, $sValue);
84
+                foreach ($aData as $sKey => $sValue) {
85
+                    $hResult->bindValue(':'.$sKey, $sValue);
86
+                }
85 87
                 $hResult->execute();
86 88
                 header('Location: /_admin/itemgroupadmin.html?gid='.$iGID.'&action=editgroup');
87 89
                 die();
@@ -107,14 +109,20 @@  discard block
 block discarded – undo
107 109
                 $sGNo = filter_var($_REQUEST["no"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
108 110
                 $sImg = filter_var($_REQUEST["img"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
109 111
 
110
-                if (strlen($sName) < 3) $aErr["nametooshort"] = true;
111
-                if (strlen($sGNo) < 3) $aErr["grouptooshort"] = true;
112
+                if (strlen($sName) < 3) {
113
+                    $aErr["nametooshort"] = true;
114
+                }
115
+                if (strlen($sGNo) < 3) {
116
+                    $aErr["grouptooshort"] = true;
117
+                }
112 118
                 if (count($aErr) == 0) {
113 119
                     $sql = 'SELECT itmg_no FROM itemgroups_base WHERE itmg_no = :no';
114 120
                     $hResult = $this->db->prepare($sql);
115 121
                     $hResult->bindValue(':no', $sGNo);
116 122
                     $hResult->execute();
117
-                    if ($hResult->rowCount() > 0) $aErr["duplicateno"] = true;
123
+                    if ($hResult->rowCount() > 0) {
124
+                        $aErr["duplicateno"] = true;
125
+                    }
118 126
                 }
119 127
                 if (count($aErr) == 0) {
120 128
                     $aData = [
@@ -124,7 +132,9 @@  discard block
 block discarded – undo
124 132
                     ];
125 133
                     $sql = DBTools::buildPSInsertQuery($aData, 'itemgroups_base');
126 134
                     $hResult = $this->db->prepare($sql);
127
-                    foreach ($aData as $sKey => $sValue) $hResult->bindValue(':'.$sKey, $sValue);
135
+                    foreach ($aData as $sKey => $sValue) {
136
+                        $hResult->bindValue(':'.$sKey, $sValue);
137
+                    }
128 138
                     $hResult->execute();
129 139
                     $iLastInsertID = $this->db->lastInsertId();
130 140
                     header('Location: /_admin/itemgroupadmin.html?action=editgroup&added&gid='.$iLastInsertID);
@@ -161,7 +171,9 @@  discard block
 block discarded – undo
161 171
         $hResult->execute();
162 172
         $iNumRows = $hResult->rowCount();
163 173
 
164
-        if ($iNumRows > 0) return 'duplicateno';
174
+        if ($iNumRows > 0) {
175
+            return 'duplicateno';
176
+        }
165 177
 
166 178
         $aData = [
167 179
             'itmg_name' => filter_var($_REQUEST["name"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW),
@@ -194,7 +206,9 @@  discard block
 block discarded – undo
194 206
             ];
195 207
             $sql = DBTools::buildPSUpdateQuery($aData, 'itemgroups_text', 'itmgt_id');
196 208
             $hResult = $this->db->prepare($sql);
197
-            foreach ($aData as $sKey => $sValue) $hResult->bindValue(':' . $sKey, $sValue);
209
+            foreach ($aData as $sKey => $sValue) {
210
+                $hResult->bindValue(':' . $sKey, $sValue);
211
+            }
198 212
             $hResult->execute();
199 213
         }
200 214
 
@@ -237,11 +251,15 @@  discard block
 block discarded – undo
237 251
         $sql = 'SELECT * FROM itemgroups_base '
238 252
             . 'LEFT OUTER JOIN itemgroups_text ON itemgroups_base.itmg_id = itemgroups_text.itmgt_pid'
239 253
             . ' AND itemgroups_text.itmgt_lang = :lang';
240
-        if ($iGID != '') $sql .= ' WHERE itmg_id = :gid';
254
+        if ($iGID != '') {
255
+            $sql .= ' WHERE itmg_id = :gid';
256
+        }
241 257
         $sql .= ' ORDER BY itmg_no';
242 258
         $hResult = $this->db->prepare($sql);
243 259
         $hResult->bindValue(':lang', HelperConfig::$lang);
244
-        if ($iGID != '') $hResult->bindValue(':gid', $iGID);
260
+        if ($iGID != '') {
261
+            $hResult->bindValue(':gid', $iGID);
262
+        }
245 263
         $hResult->execute();
246 264
 
247 265
         $aGroups = $hResult->fetchAll();
Please login to merge, or discard this patch.
src/Shop/Items.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
             if (!is_array($mItemno)) {
87 87
                 $hResult->bindValue(':itemno', $mItemno, \PDO::PARAM_STR);
88 88
             }
89
-        }
90
-        elseif (isset($_REQUEST["searchtext"]) && strlen($_REQUEST["searchtext"]) > 2) {
89
+        } elseif (isset($_REQUEST["searchtext"]) && strlen($_REQUEST["searchtext"]) > 2) {
91 90
             $sSearchtext = filter_var(trim($_REQUEST["searchtext"]), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
92 91
             if (isset($_REQUEST["artnoexact"])) {
93 92
                 $hResult->bindValue(':searchtext', $sSearchtext, \PDO::PARAM_STR);
@@ -114,8 +113,9 @@  discard block
 block discarded – undo
114 113
                 $sql .= 'item_base.itm_no = :itemno';
115 114
             }
116 115
         } elseif (isset($_REQUEST["searchtext"]) && \strlen($_REQUEST["searchtext"]) > 2) {
117
-            if (isset($_REQUEST["artnoexact"])) $sql .= 'item_base.itm_no = :searchtext';
118
-            else {
116
+            if (isset($_REQUEST["artnoexact"])) {
117
+                $sql .= 'item_base.itm_no = :searchtext';
118
+            } else {
119 119
                 $sql .= '(item_base.itm_no LIKE :searchtextwild1 OR itm_name LIKE :searchtextwild2';
120 120
                 $sql .= ' OR itml_name_override LIKE :searchtextwild3 OR itml_text1 LIKE :searchtextwild4';
121 121
                 $sql .= ' OR itml_text2 LIKE :searchtextwild5)';
@@ -123,7 +123,9 @@  discard block
 block discarded – undo
123 123
         } else {
124 124
             if (is_array($mItemIndex)) {
125 125
                 $sql .= "(";
126
-                foreach ($mItemIndex as $sAIndex) $sql .= "itm_index LIKE '%".filter_var($sAIndex, FILTER_SANITIZE_SPECIAL_CHARS)."%' OR ";
126
+                foreach ($mItemIndex as $sAIndex) {
127
+                    $sql .= "itm_index LIKE '%".filter_var($sAIndex, FILTER_SANITIZE_SPECIAL_CHARS)."%' OR ";
128
+                }
127 129
                 $sql = \HaaseIT\Toolbox\Tools::cutStringend($sql, 4);
128 130
                 $sql .= ")";
129 131
             } else {
Please login to merge, or discard this patch.
src/Router.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,9 +116,13 @@
 block discarded – undo
116 116
                     If the last part of the path doesn't include a dot (.) and is not empty, apend a slash.
117 117
                     If there is already a slash at the end, the last part of the path array will be empty.
118 118
                      */
119
-                    if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') $this->sPath .= '/';
119
+                    if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') {
120
+                        $this->sPath .= '/';
121
+                    }
120 122
 
121
-                    if ($this->sPath[strlen($this->sPath) - 1] == '/') $this->sPath .= 'index.html';
123
+                    if ($this->sPath[strlen($this->sPath) - 1] == '/') {
124
+                        $this->sPath .= 'index.html';
125
+                    }
122 126
 
123 127
                     $this->P = new UserPage($this->serviceManager, $this->sPath);
124 128
                 }
Please login to merge, or discard this patch.
src/UserPage.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,9 @@
 block discarded – undo
56 56
                 $hResult->fetch();
57 57
 
58 58
                 if ($this->cb_pagetype !== 'shorturl') {
59
-                    if (!$bReturnRaw) $this->cb_pageconfig = json_decode($this->cb_pageconfig);
59
+                    if (!$bReturnRaw) {
60
+                        $this->cb_pageconfig = json_decode($this->cb_pageconfig);
61
+                    }
60 62
                     $this->oPayload = $this->getPayload();
61 63
                 }
62 64
             }
Please login to merge, or discard this patch.
src/Controller/Shop/Myorders.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -160,14 +160,11 @@
 block discarded – undo
160 160
 
161 161
                 if ($aRow["o_paymentmethod"] === 'prepay') {
162 162
                     $sPaymentmethod = $this->textcats->T("order_paymentmethod_prepay");
163
-                }
164
-                elseif ($aRow["o_paymentmethod"] === 'paypal') {
163
+                } elseif ($aRow["o_paymentmethod"] === 'paypal') {
165 164
                     $sPaymentmethod = $this->textcats->T("order_paymentmethod_paypal");
166
-                }
167
-                elseif ($aRow["o_paymentmethod"] === 'debit') {
165
+                } elseif ($aRow["o_paymentmethod"] === 'debit') {
168 166
                     $sPaymentmethod = $this->textcats->T("order_paymentmethod_debit");
169
-                }
170
-                elseif ($aRow["o_paymentmethod"] === 'invoice') {
167
+                } elseif ($aRow["o_paymentmethod"] === 'invoice') {
171 168
                     $sPaymentmethod = $this->textcats->T("order_paymentmethod_invoice");
172 169
                 } else {
173 170
                     $sPaymentmethod = ucwords($aRow["o_paymentmethod"]);
Please login to merge, or discard this patch.