Completed
Push — master ( 6e0e1d...0afdc4 )
by Alexey
04:12
created
system/modules/Money/objects/MerchantHelper/WalletOne.php 2 patches
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,20 +28,24 @@  discard block
 block discarded – undo
28 28
 
29 29
         // Проверка наличия необходимых параметров в POST-запросе
30 30
 
31
-        if (!isset($data["WMI_SIGNATURE"]))
32
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE");
31
+        if (!isset($data["WMI_SIGNATURE"])) {
32
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE");
33
+        }
33 34
 
34
-        if (!isset($data["WMI_PAYMENT_NO"]))
35
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO");
35
+        if (!isset($data["WMI_PAYMENT_NO"])) {
36
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO");
37
+        }
36 38
 
37
-        if (!isset($data["WMI_ORDER_STATE"]))
38
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE");
39
+        if (!isset($data["WMI_ORDER_STATE"])) {
40
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE");
41
+        }
39 42
 
40 43
         // Извлечение всех параметров POST-запроса, кроме WMI_SIGNATURE
41 44
         $params = [];
42 45
         foreach ($data as $name => $value) {
43
-            if ($name !== "WMI_SIGNATURE")
44
-                $params[$name] = $value;
46
+            if ($name !== "WMI_SIGNATURE") {
47
+                            $params[$name] = $value;
48
+            }
45 49
         }
46 50
 
47 51
         // Сортировка массива по именам ключей в порядке возрастания
@@ -86,8 +90,9 @@  discard block
 block discarded – undo
86 90
         $config = static::getConfig();
87 91
         $merchantCurrency = static::getMerchantCurrency($currency);
88 92
         
89
-        if (!$description)
90
-            $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
93
+        if (!$description) {
94
+                    $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
95
+        }
91 96
 
92 97
         //Секретный ключ интернет-магазина
93 98
         $key = $config['secret'];
@@ -117,11 +122,12 @@  discard block
 block discarded – undo
117 122
         $fieldValues = "";
118 123
 
119 124
         foreach ($fields as $value) {
120
-            if (is_array($value))
121
-                foreach ($value as $v) {
125
+            if (is_array($value)) {
126
+                            foreach ($value as $v) {
122 127
                     //Конвертация из текущей кодировки (UTF-8)
123 128
                     //необходима только если кодировка магазина отлична от Windows-1251
124 129
                     $v = iconv("utf-8", "windows-1251", $v);
130
+            }
125 131
                     $fieldValues .= $v;
126 132
                 } else {
127 133
                 //Конвертация из текущей кодировки (UTF-8)
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
         function print_answer($result, $description)
23 23
         {
24
-            $print = "WMI_RESULT=" . strtoupper($result) . "&";
25
-            $print .= "WMI_DESCRIPTION=" . urlencode($description);
24
+            $print = "WMI_RESULT=".strtoupper($result)."&";
25
+            $print .= "WMI_DESCRIPTION=".urlencode($description);
26 26
             return $print;
27 27
         }
28 28
 
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
 
60 60
         // Формирование подписи для сравнения ее с параметром WMI_SIGNATURE
61 61
 
62
-        $signature = base64_encode(pack("H*", md5($values . $skey)));
62
+        $signature = base64_encode(pack("H*", md5($values.$skey)));
63 63
 
64 64
         //Сравнение полученной подписи с подписью W1
65 65
 
66 66
         if (!empty($data["WMI_SIGNATURE"]) && $signature == $data["WMI_SIGNATURE"]) {
67 67
             if (strtoupper($data["WMI_ORDER_STATE"]) == "ACCEPTED") {
68 68
                 // вызываем функцию обработки в случае успеха
69
-                $result['callback'] = print_answer("Ok", "Заказ #" . $data["WMI_PAYMENT_NO"] . " оплачен!");
69
+                $result['callback'] = print_answer("Ok", "Заказ #".$data["WMI_PAYMENT_NO"]." оплачен!");
70 70
                 $result['payId'] = $data["WMI_PAYMENT_NO"];
71 71
                 $result['status'] = 'success';
72 72
                 return $result;
73 73
             } else {
74 74
                 // Случилось что-то странное, пришло неизвестное состояние заказа
75
-                $result['callback'] = print_answer("Retry", "Неверное состояние " . $data["WMI_ORDER_STATE"]);
75
+                $result['callback'] = print_answer("Retry", "Неверное состояние ".$data["WMI_ORDER_STATE"]);
76 76
             }
77 77
         } else {
78 78
             // Подпись не совпадает, возможно вы поменяли настройки интернет-магазина
79
-            $result['callback'] = print_answer("Retry", "Неверная подпись " . (!empty($data["WMI_SIGNATURE"]) ? $data["WMI_SIGNATURE"] : 'empty'));
79
+            $result['callback'] = print_answer("Retry", "Неверная подпись ".(!empty($data["WMI_SIGNATURE"]) ? $data["WMI_SIGNATURE"] : 'empty'));
80 80
         }
81 81
         return $result;
82 82
     }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $merchantCurrency = static::getMerchantCurrency($currency);
88 88
         
89 89
         if (!$description)
90
-            $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
90
+            $description = "Оплата заказа на сайте ".idn_to_utf8(INJI_DOMAIN_NAME);
91 91
 
92 92
         //Секретный ключ интернет-магазина
93 93
         $key = $config['secret'];
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $fields["WMI_PAYMENT_AMOUNT"] = number_format($amount, 0, '.', '');
100 100
         $fields["WMI_CURRENCY_ID"] = $merchantCurrency->code;
101 101
         $fields["WMI_PAYMENT_NO"] = $payId;
102
-        $fields["WMI_DESCRIPTION"] = "BASE64:" . base64_encode($description);
102
+        $fields["WMI_DESCRIPTION"] = "BASE64:".base64_encode($description);
103 103
         $fields["WMI_EXPIRED_DATE"] = "2019-12-31T23:59:59";
104 104
         $fields["WMI_SUCCESS_URL"] = $success;
105 105
         $fields["WMI_FAIL_URL"] = $false;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         // вычисления отпечатка, сформированного выше сообщения,
136 136
         // по алгоритму MD5 и представление его в Base64
137 137
 
138
-        $signature = base64_encode(pack("H*", md5($fieldValues . $key)));
138
+        $signature = base64_encode(pack("H*", md5($fieldValues.$key)));
139 139
 
140 140
         //Добавление параметра WMI_SIGNATURE в словарь параметров формы
141 141
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
           print "<input type=\"submit\"/></form>";
157 157
          */
158
-        \Tools::redirect('https://www.walletone.com/checkout/default.aspx?' . http_build_query($fields));
158
+        \Tools::redirect('https://www.walletone.com/checkout/default.aspx?'.http_build_query($fields));
159 159
     }
160 160
 
161 161
 }
Please login to merge, or discard this patch.
system/modules/Money/snippets/expiredDateGenerator/dayStart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 return function($reward, $user) {
4 4
     return [
5
-        'date' => date('Y-m-d H:i:s',mktime(0, 0, 0, date('n'), date("j") + 1, date("Y"))),
5
+        'date' => date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date("j") + 1, date("Y"))),
6 6
         'type' => 'burn'
7 7
     ];
8 8
 };
Please login to merge, or discard this patch.
system/modules/Money/widgets/cabinet/rewards.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
         <h3>Уровни начислений</h3>
13 13
         <ul>
14 14
           <?php
15
-          foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
16
-              ?>
15
+            foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
16
+                ?>
17 17
 
18 18
               <li><?= !$level->level ? 'Личный' : $level->level; ?>. <?= $types[$level->type]['viewer']($level); ?></li>
19 19
               <?php
20
-          }
21
-          ?>
20
+            }
21
+            ?>
22 22
 
23 23
         </ul>
24 24
       </div>
@@ -34,20 +34,20 @@  discard block
 block discarded – undo
34 34
             <h4 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h4>
35 35
             <ul>
36 36
               <?php
37
-              foreach ($condition->items as $item) {
38
-                  $itemComplete = $item->checkComplete();
39
-                  switch ($item->type) {
40
-                      case 'event':
37
+                foreach ($condition->items as $item) {
38
+                    $itemComplete = $item->checkComplete();
39
+                    switch ($item->type) {
40
+                        case 'event':
41 41
                           $name = \Events\Event::get($item->value, 'event')->name();
42
-                          break;
43
-                  }
44
-                  ?>
42
+                            break;
43
+                    }
44
+                    ?>
45 45
                   <li> 
46 46
                     <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount(); ?></b>/<?= $item->count; ?> <br />
47 47
                   </li>
48 48
                   <?php
49
-              }
50
-              ?>
49
+                }
50
+                ?>
51 51
             </ul>
52 52
             <?php
53 53
         }
Please login to merge, or discard this patch.
system/modules/Money/widgets/cabinet/wallets.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <h3>Мои кошельки</h3>
2 2
 <div class="row">
3 3
   <?php
4
-  $blocked = App::$cur->money->getUserBlocks();
5
-  $wallets = App::$cur->money->getUserWallets();
6
-  $rates = Money\Currency\ExchangeRate::getList();
7
-  foreach ($wallets as $wallet) {
8
-      ?>
4
+    $blocked = App::$cur->money->getUserBlocks();
5
+    $wallets = App::$cur->money->getUserWallets();
6
+    $rates = Money\Currency\ExchangeRate::getList();
7
+    foreach ($wallets as $wallet) {
8
+        ?>
9 9
       <div class="col-sm-4">
10 10
         <h4><?= $wallet->currency->name(); ?></h4>
11 11
         <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br />
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         ?>
31 31
       </div>
32 32
       <?php
33
-  }
34
-  ?>
33
+    }
34
+    ?>
35 35
 </div>
36 36
 <?php
37 37
 $transfers = Money\Transfer::getList(['where' => [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
         <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br />
12 12
         <?php
13 13
         if (!empty($blocked[$wallet->currency_id])) {
14
-            echo "Заблокировано: {$blocked[$wallet->currency_id]} " . $wallet->currency->acronym() . "<br />";
14
+            echo "Заблокировано: {$blocked[$wallet->currency_id]} ".$wallet->currency->acronym()."<br />";
15 15
         }
16 16
         if ($wallet->currency->refill) {
17 17
             echo "<a href = '/money/refill?currency_id={$wallet->currency_id}'>Пополнить</a> ";
Please login to merge, or discard this patch.
system/modules/StaticLoader/StaticLoader.php 2 patches
Braces   +14 added lines, -12 removed lines patch added patch discarded remove patch
@@ -112,10 +112,11 @@  discard block
 block discarded – undo
112 112
 
113 113
                 $sizes = explode('x', $_GET['resize']);
114 114
                 $sizes[0] = intval($sizes[0]);
115
-                if (isset($sizes[1]))
116
-                    $sizes[1] = intval($sizes[1]);
117
-                else
118
-                    $sizes[1] = 0;
115
+                if (isset($sizes[1])) {
116
+                                    $sizes[1] = intval($sizes[1]);
117
+                } else {
118
+                                    $sizes[1] = 0;
119
+                }
119 120
 
120 121
                 if (!$sizes[0] || !$sizes[1]) {
121 122
                     header('HTTP/1.1 404 Not Found');
@@ -127,15 +128,16 @@  discard block
 block discarded – undo
127 128
                     $dir = App::$primary->path;
128 129
 
129 130
                     if (!empty($_GET['resize_crop'])) {
130
-                        if (in_array($_GET['resize_crop'], array('q', 'c')))
131
-                            $crop = $_GET['resize_crop'];
132
-                        else
133
-                            $crop = 'c';
131
+                        if (in_array($_GET['resize_crop'], array('q', 'c'))) {
132
+                                                    $crop = $_GET['resize_crop'];
133
+                        } else {
134
+                                                    $crop = 'c';
135
+                        }
136
+                    } elseif (!empty($_GET['resize_quadro'])) {
137
+                                            $crop = 'q';
138
+                    } else {
139
+                                            $crop = '';
134 140
                     }
135
-                    elseif (!empty($_GET['resize_quadro']))
136
-                        $crop = 'q';
137
-                    else
138
-                        $crop = '';
139 141
                     $pos = 'center';
140 142
                     if (!empty($_GET['resize_pos']) && in_array($_GET['resize_pos'], array('top', 'center'))) {
141 143
                         $pos = $_GET['resize_pos'];
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
         }
27 27
         $app = substr($path, 0, strpos($path, '/'));
28 28
        
29
-        if ($app && file_exists(INJI_SYSTEM_DIR . '/program/' . $app)) {
29
+        if ($app && file_exists(INJI_SYSTEM_DIR.'/program/'.$app)) {
30 30
             $path = substr($path, strpos($path, '/') + 1);
31 31
             if (\App::$cur->name != $app) {
32 32
                 $scriptApp = new App();
33 33
                 $scriptApp->name = $app;
34 34
                 $scriptApp->system = true;
35
-                $scriptApp->staticPath = "/" . $scriptApp->name . "/static";
36
-                $scriptApp->templatesPath = "/" . $scriptApp->name . "/static/templates";
37
-                $scriptApp->path = INJI_SYSTEM_DIR . '/program/' . $scriptApp->name;
38
-                $scriptApp->type = 'app' . ucfirst(strtolower($scriptApp->name));
35
+                $scriptApp->staticPath = "/".$scriptApp->name."/static";
36
+                $scriptApp->templatesPath = "/".$scriptApp->name."/static/templates";
37
+                $scriptApp->path = INJI_SYSTEM_DIR.'/program/'.$scriptApp->name;
38
+                $scriptApp->type = 'app'.ucfirst(strtolower($scriptApp->name));
39 39
                 $scriptApp->installed = true;
40 40
                 $scriptApp->params = [];
41 41
                 $scriptApp->config = Config::app($scriptApp);
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
         $type = substr($path, 0, strpos($path, '/'));
54 54
         switch ($type) {
55 55
             case 'libs':
56
-                return App::$cur->Libs->getPath(array_slice(explode('/', $path),2));
56
+                return App::$cur->Libs->getPath(array_slice(explode('/', $path), 2));
57 57
             case 'templates':
58 58
                 $path = substr($path, strpos($path, '/') + 1);
59
-                return $scriptApp->view->templatesPath . '/' . $path;
59
+                return $scriptApp->view->templatesPath.'/'.$path;
60 60
             case 'system':
61 61
                 $path = substr($path, strpos($path, '/') + 1);
62
-                return INJI_SYSTEM_DIR . '/static/' . $path;
62
+                return INJI_SYSTEM_DIR.'/static/'.$path;
63 63
             case 'moduleAsset':
64 64
                 $path = substr($path, strpos($path, '/') + 1);
65 65
                 if (!strpos($path, '/')) {
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                 }
73 73
                 $path = substr($path, strpos($path, '/') + 1);
74 74
                 if (is_callable([$module, 'staticCalled'])) {
75
-                    return $scriptApp->$module->staticCalled($path, $scriptApp->$module->path . '/static/');
75
+                    return $scriptApp->$module->staticCalled($path, $scriptApp->$module->path.'/static/');
76 76
                 }
77
-                return $scriptApp->$module->path . '/static/' . $path;
77
+                return $scriptApp->$module->path.'/static/'.$path;
78 78
             default:
79
-                return $scriptApp->path . '/static/' . $path;
79
+                return $scriptApp->path.'/static/'.$path;
80 80
         }
81 81
     }
82 82
 
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
                         $pos = $_GET['resize_pos'];
140 140
                     }
141 141
                     $dirnoslash = str_replace('/', '', substr($fileinfo['dirname'], strpos($fileinfo['dirname'], '/static')));
142
-                    $path = $dir . '/static/cache/' . $dirnoslash . $fileinfo['filename'] . '.' . $sizes[0] . 'x' . $sizes[1] . $crop . $pos . '.' . $fileinfo['extension'];
142
+                    $path = $dir.'/static/cache/'.$dirnoslash.$fileinfo['filename'].'.'.$sizes[0].'x'.$sizes[1].$crop.$pos.'.'.$fileinfo['extension'];
143 143
                     if (!file_exists($path)) {
144
-                        Tools::createDir($dir . '/static/cache/');
144
+                        Tools::createDir($dir.'/static/cache/');
145 145
                         copy($file, $path);
146 146
                         Tools::resizeImage($path, $sizes[0], $sizes[1], $crop, $pos);
147 147
                     }
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
         header("Cache-control: public");
167 167
         header("Accept-Ranges: bytes");
168 168
         header("Pragma: public");
169
-        header("Content-Length: " . filesize($file));
170
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file)) . ' GMT');
171
-        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60 * 60 * 24 * 256) . ' GMT');
169
+        header("Content-Length: ".filesize($file));
170
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($file)).' GMT');
171
+        header('Expires: '.gmdate('D, d M Y H:i:s', time() + 60 * 60 * 24 * 256).' GMT');
172 172
         if (filemtime($file) <= $modifiedSince && (!isset($_SERVER['HTTP_CACHE_CONTROL']) || $_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache')) {
173 173
             // Разгружаем канал передачи данных!
174 174
             header('HTTP/1.1 304 Not Modified');
@@ -179,19 +179,19 @@  discard block
 block discarded – undo
179 179
         header('Content-Description: File Transfer');
180 180
         //}
181 181
         if (isset($this->mimes[strtolower($fileinfo['extension'])])) {
182
-            header("Content-Type: " . $this->mimes[strtolower($fileinfo['extension'])]);
182
+            header("Content-Type: ".$this->mimes[strtolower($fileinfo['extension'])]);
183 183
         }
184 184
 
185 185
         if (isset($_GET['frustrate_dl']) || in_array($fileinfo['extension'], array('doc', 'docx', 'xls', 'xlsx'))) {
186 186
 
187
-            $fileName = $fileinfo['filename'] . '.' . $fileinfo['extension'];
187
+            $fileName = $fileinfo['filename'].'.'.$fileinfo['extension'];
188 188
             if (App::$cur->db->connect) {
189
-                $fileObj = Files\File::get([ 'path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
189
+                $fileObj = Files\File::get(['path', '%/'.$fileinfo['filename'].'.'.$fileinfo['extension'], 'LIKE']);
190 190
                 if ($fileObj) {
191 191
                     $fileName = $fileObj->original_name;
192 192
                 }
193 193
             }
194
-            header('Content-Disposition: attachment; filename="' . $fileName . '"');
194
+            header('Content-Disposition: attachment; filename="'.$fileName.'"');
195 195
         }
196 196
 
197 197
         header('Content-Transfer-Encoding: binary');
Please login to merge, or discard this patch.
system/modules/Ui/objects/Pages.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,10 +34,11 @@
 block discarded – undo
34 34
             $this->params['page'] = 1;
35 35
             if (!empty($this->data['page'])) {
36 36
                 $this->params['page'] = (int) $this->data['page'];
37
-                if ($this->params['page'] <= 0)
38
-                    $this->params['page'] = 1;
39
-                elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit']))
40
-                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
37
+                if ($this->params['page'] <= 0) {
38
+                                    $this->params['page'] = 1;
39
+                } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) {
40
+                                    $this->params['page'] = ceil($this->options['count'] / $this->params['limit']);
41
+                }
41 42
             }
42 43
 
43 44
             $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit'];
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Pages/pages.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <ul class="<?= $class; ?>"><?php
2
-  if ($pagesInstance->params['page'] > 1) {
3
-      $getArr['page'] = $pagesInstance->params['page'] - 1;
4
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&larr;</a></li>";
5
-  }
2
+    if ($pagesInstance->params['page'] > 1) {
3
+        $getArr['page'] = $pagesInstance->params['page'] - 1;
4
+        echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&larr;</a></li>";
5
+    }
6 6
 
7
-  for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8
-      if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9
-          echo '<li ';
10
-          if ($pagesInstance->params['page'] == $i)
11
-              echo 'class = "active"';
12
-          echo ">";
13
-          $getArr['page'] = $i;
14
-          echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
15
-      }
16
-      elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17
-          $getArr['page'] = round($pagesInstance->params['page'] / 2);
18
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
19
-      } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
20
-          $getArr['page'] = round(($pagesInstance->params['pages'] - $pagesInstance->params['page']) / 2) + $pagesInstance->params['page'];
21
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
22
-      }
23
-  }
24
-  if ($pagesInstance->params['page'] < $pagesInstance->params['pages']) {
25
-      $getArr['page'] = $pagesInstance->params['page'] + 1;
26
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&rarr;</a></li>";
27
-  }
28
-  ?></ul>
29 7
\ No newline at end of file
8
+    for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
9
+        if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
10
+            echo '<li ';
11
+            if ($pagesInstance->params['page'] == $i)
12
+                echo 'class = "active"';
13
+            echo ">";
14
+            $getArr['page'] = $i;
15
+            echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
16
+        }
17
+        elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
18
+            $getArr['page'] = round($pagesInstance->params['page'] / 2);
19
+            echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
20
+        } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
21
+            $getArr['page'] = round(($pagesInstance->params['pages'] - $pagesInstance->params['page']) / 2) + $pagesInstance->params['page'];
22
+            echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
23
+        }
24
+    }
25
+    if ($pagesInstance->params['page'] < $pagesInstance->params['pages']) {
26
+        $getArr['page'] = $pagesInstance->params['page'] + 1;
27
+        echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&rarr;</a></li>";
28
+    }
29
+    ?></ul>
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
   for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8 8
       if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9 9
           echo '<li ';
10
-          if ($pagesInstance->params['page'] == $i)
11
-              echo 'class = "active"';
10
+          if ($pagesInstance->params['page'] == $i) {
11
+                        echo 'class = "active"';
12
+          }
12 13
           echo ">";
13 14
           $getArr['page'] = $i;
14 15
           echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
15
-      }
16
-      elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
16
+      } elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17 17
           $getArr['page'] = round($pagesInstance->params['page'] / 2);
18 18
           echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
19 19
       } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <ul class="<?= $class; ?>"><?php
2 2
   if ($pagesInstance->params['page'] > 1) {
3 3
       $getArr['page'] = $pagesInstance->params['page'] - 1;
4
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&larr;</a></li>";
4
+      echo "<li><a href = '{$pagesInstance->options['url']}?".http_build_query($getArr)."'>&larr;</a></li>";
5 5
   }
6 6
 
7 7
   for ($i = 1; $i <= $pagesInstance->params['pages']; $i++) {
8
-      if (( $i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
8
+      if (($i >= $pagesInstance->params['page'] - 3 && $i <= $pagesInstance->params['page'] + 3) || $i == 1 || $i == $pagesInstance->params['pages']) {
9 9
           echo '<li ';
10 10
           if ($pagesInstance->params['page'] == $i)
11 11
               echo 'class = "active"';
12 12
           echo ">";
13 13
           $getArr['page'] = $i;
14
-          echo "<a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>{$i}</a></li>";
14
+          echo "<a href = '{$pagesInstance->options['url']}?".http_build_query($getArr)."'>{$i}</a></li>";
15 15
       }
16 16
       elseif ($i == $pagesInstance->params['page'] - 7 && $i > 1) {
17 17
           $getArr['page'] = round($pagesInstance->params['page'] / 2);
18
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
18
+          echo "<li><a href = '{$pagesInstance->options['url']}?".http_build_query($getArr)."'>...</a></li>";
19 19
       } elseif ($i == $pagesInstance->params['page'] + 7 && $i < $pagesInstance->params['pages']) {
20 20
           $getArr['page'] = round(($pagesInstance->params['pages'] - $pagesInstance->params['page']) / 2) + $pagesInstance->params['page'];
21
-          echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>...</a></li>";
21
+          echo "<li><a href = '{$pagesInstance->options['url']}?".http_build_query($getArr)."'>...</a></li>";
22 22
       }
23 23
   }
24 24
   if ($pagesInstance->params['page'] < $pagesInstance->params['pages']) {
25 25
       $getArr['page'] = $pagesInstance->params['page'] + 1;
26
-      echo "<li><a href = '{$pagesInstance->options['url']}?" . http_build_query($getArr) . "'>&rarr;</a></li>";
26
+      echo "<li><a href = '{$pagesInstance->options['url']}?".http_build_query($getArr)."'>&rarr;</a></li>";
27 27
   }
28 28
   ?></ul>
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Ui/widgets/Table/body.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@
 block discarded – undo
5 5
           <div class ='pull-right'>
6 6
             <div class="btn-group">
7 7
               <?php
8
-              $html = '';
9
-              foreach ($table->buttons as $button) {
10
-                  $html .= '<a class = "btn btn-primary btn-sm"';
11
-                  if (!empty($button['href'])) {
12
-                      $html .= " href = '{$button['href']}'";
13
-                  }
14
-                  if (!empty($button['onclick'])) {
15
-                      $html .= " onclick = '{$button['onclick']}'";
16
-                  }
17
-                  $html .= ">{$button['text']}</a> ";
18
-              }
19
-              echo $html;
20
-              ?>
8
+                $html = '';
9
+                foreach ($table->buttons as $button) {
10
+                    $html .= '<a class = "btn btn-primary btn-sm"';
11
+                    if (!empty($button['href'])) {
12
+                        $html .= " href = '{$button['href']}'";
13
+                    }
14
+                    if (!empty($button['onclick'])) {
15
+                        $html .= " onclick = '{$button['onclick']}'";
16
+                    }
17
+                    $html .= ">{$button['text']}</a> ";
18
+                }
19
+                echo $html;
20
+                ?>
21 21
             </div>
22 22
           </div>
23 23
       <?php } ?>
Please login to merge, or discard this patch.
system/modules/UserForms/UserForms.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
         if (!empty($_POST['UserForms'])) {
17 17
             foreach ($_POST['UserForms'] as $form_id => $inputs) {
18 18
                 $form = \UserForms\Form::get((int) $form_id);
19
-                if (!$form)
20
-                    continue;
19
+                if (!$form) {
20
+                                    continue;
21
+                }
21 22
                 $formRecive = new \UserForms\Recive();
22 23
                 $formRecive->user_id = (int) \Users\User::$cur->id;
23 24
                 $formRecive->form_id = (int) $form_id;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
                 $data = [];
25 25
                 $error = false;
26 26
                 foreach ($form->inputs as $input) {
27
-                    if (isset($inputs['input' . $input->id])) {
28
-                        $data['input' . $input->id] = htmlspecialchars($inputs['input' . $input->id]);
27
+                    if (isset($inputs['input'.$input->id])) {
28
+                        $data['input'.$input->id] = htmlspecialchars($inputs['input'.$input->id]);
29 29
                     } elseif ($input->required) {
30 30
                         $error = true;
31
-                        Msg::add('Вы не заполнили поле: ' . $input->label);
31
+                        Msg::add('Вы не заполнили поле: '.$input->label);
32 32
                     } else {
33
-                        $data['input' . $input->id] = '';
33
+                        $data['input'.$input->id] = '';
34 34
                     }
35 35
                 }
36 36
                 if (!$error) {
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
             if (!$error && !empty(App::$cur->config['site']['email'])) {
43 43
                 $text = '';
44 44
                 foreach ($form->inputs as $input) {
45
-                    if (isset($inputs['input' . $input->id])) {
46
-                        $text .="<b>{$input->label}:</b> " . htmlspecialchars($inputs['input' . $input->id]) . "<br />";
45
+                    if (isset($inputs['input'.$input->id])) {
46
+                        $text .= "<b>{$input->label}:</b> ".htmlspecialchars($inputs['input'.$input->id])."<br />";
47 47
                     }
48 48
                 }
49 49
                 if ($text) {
50
-                    $text = 'Дата получения по серверному времени: ' . date('Y-m-d H:i:s') . '<br />Заполненые поля:<br />' . $text;
51
-                    Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $form->name, $text);
50
+                    $text = 'Дата получения по серверному времени: '.date('Y-m-d H:i:s').'<br />Заполненые поля:<br />'.$text;
51
+                    Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $form->name, $text);
52 52
                 }
53 53
             }
54 54
             Tools::redirect($_SERVER['REQUEST_URI'], 'Ваша форма была успешно отправлена', 'success');
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
         $inputs = json_decode($item->data, true);
61 61
         $text = '';
62 62
         foreach ($item->form->inputs as $input) {
63
-            if (isset($inputs['input' . $input->id])) {
64
-                $text .= "{$input->label}: " . htmlspecialchars($inputs['input' . $input->id]) . "<br />";
63
+            if (isset($inputs['input'.$input->id])) {
64
+                $text .= "{$input->label}: ".htmlspecialchars($inputs['input'.$input->id])."<br />";
65 65
             }
66 66
         }
67 67
         return $text;
Please login to merge, or discard this patch.