@@ -271,10 +271,11 @@ discard block |
||
271 | 271 | $item->sales ++; |
272 | 272 | $item->save(); |
273 | 273 | |
274 | - if (empty($_GET['count'])) |
|
275 | - $count = 1; |
|
276 | - else |
|
277 | - $count = (float) $_GET['count']; |
|
274 | + if (empty($_GET['count'])) { |
|
275 | + $count = 1; |
|
276 | + } else { |
|
277 | + $count = (float) $_GET['count']; |
|
278 | + } |
|
278 | 279 | |
279 | 280 | $cart = $this->ecommerce->getCurCart(); |
280 | 281 | |
@@ -313,8 +314,9 @@ discard block |
||
313 | 314 | |
314 | 315 | function delcartitemAction($cci_id = 0) |
315 | 316 | { |
316 | - if (empty($_SESSION['cart']['cart_id'])) |
|
317 | - exit('У вас нет корзины'); |
|
317 | + if (empty($_SESSION['cart']['cart_id'])) { |
|
318 | + exit('У вас нет корзины'); |
|
319 | + } |
|
318 | 320 | $cartItem = \Ecommerce\Cart\Item::get((int) $cci_id); |
319 | 321 | if (!$cartItem || $cartItem->cart_id != $_SESSION['cart']['cart_id']) { |
320 | 322 | exit('Этот элемент корзины не относится к вашей корзине'); |
@@ -2,9 +2,9 @@ |
||
2 | 2 | <div class="cart-order_page"> |
3 | 3 | <h2>Быстрое оформление заказа</h2> |
4 | 4 | <?php |
5 | - if (!$cart || !$cart->cartItems) |
|
6 | - echo "<h1>Ваша корзина пуста</h1>"; |
|
7 | - else { |
|
5 | + if (!$cart || !$cart->cartItems) { |
|
6 | + echo "<h1>Ваша корзина пуста</h1>"; |
|
7 | + } else { |
|
8 | 8 | $sums = []; |
9 | 9 | $cartDelivery = $cart->delivery; |
10 | 10 | $deliveryPrice = 0; |
@@ -275,8 +275,9 @@ |
||
275 | 275 | break; |
276 | 276 | } |
277 | 277 | } |
278 | - if (!$price) |
|
279 | - return false; |
|
278 | + if (!$price) { |
|
279 | + return false; |
|
280 | + } |
|
280 | 281 | |
281 | 282 | if ($count <= 0) { |
282 | 283 | $count = 1; |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | $i = 0; |
41 | 41 | foreach ($html->find('ul li ul li ul li a') as $element) { |
42 | 42 | $item = Item::get(['ci_imported', 'http://florange.ru' . $element->href]); |
43 | - if ($item) |
|
44 | - continue; |
|
43 | + if ($item) { |
|
44 | + continue; |
|
45 | + } |
|
45 | 46 | |
46 | 47 | $elem = file_get_html('http://florange.ru' . $element->href); |
47 | 48 | |
@@ -57,10 +58,11 @@ discard block |
||
57 | 58 | foreach ($elem->find('.description p') as $p) { |
58 | 59 | if ($p->find('strong') && $p->find('strong', 0)->innertext != 'Выберите стиль:') { |
59 | 60 | //$item['head'][] = $p->find('strong', 0)->innertext; |
60 | - } elseif ($p->find('strong') && $p->find('strong', 0)->innertext == 'Выберите стиль:') |
|
61 | - break; |
|
62 | - else |
|
63 | - $prices[$i++]['ciprice_about'] = $p->innertext; |
|
61 | + } elseif ($p->find('strong') && $p->find('strong', 0)->innertext == 'Выберите стиль:') { |
|
62 | + break; |
|
63 | + } else { |
|
64 | + $prices[$i++]['ciprice_about'] = $p->innertext; |
|
65 | + } |
|
64 | 66 | } |
65 | 67 | $i = 0; |
66 | 68 | foreach ($elem->find('.description .tabcontent') as $t) { |
@@ -101,12 +103,12 @@ discard block |
||
101 | 103 | $html = file_get_html('http://florange.ru/production/style/pushup/'); |
102 | 104 | |
103 | 105 | foreach ($html->find('.leftside .nav>li>a') as $element) { |
104 | - if (strpos($element->href, '/style/')) |
|
105 | - continue; |
|
106 | + if (strpos($element->href, '/style/')) { |
|
107 | + continue; |
|
108 | + } |
|
106 | 109 | $catalogs[] = ['name' => $element->innertext, 'href' => 'http://florange.ru' . $element->href]; |
107 | 110 | } |
108 | - } |
|
109 | - else { |
|
111 | + } else { |
|
110 | 112 | $html = file_get_html('http://florange.ru/production/style/pushup/'); |
111 | 113 | $element = $html->find('.leftside .nav>li>a', $parent); |
112 | 114 | $html = file_get_html('http://florange.ru' . $element->href); |
@@ -22,16 +22,19 @@ discard block |
||
22 | 22 | |
23 | 23 | $sitePath = App::$primary->path; |
24 | 24 | |
25 | - if (!is_uploaded_file($file['tmp_name'])) |
|
26 | - return 0; |
|
25 | + if (!is_uploaded_file($file['tmp_name'])) { |
|
26 | + return 0; |
|
27 | + } |
|
27 | 28 | |
28 | 29 | $fileinfo = pathinfo($file['name']); |
29 | - if (empty($fileinfo['extension'])) |
|
30 | - return 0; |
|
30 | + if (empty($fileinfo['extension'])) { |
|
31 | + return 0; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
33 | - if (!$type) |
|
34 | - return 0; |
|
35 | + if (!$type) { |
|
36 | + return 0; |
|
37 | + } |
|
35 | 38 | |
36 | 39 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
37 | 40 | return 0; |
@@ -47,13 +50,15 @@ discard block |
||
47 | 50 | } |
48 | 51 | $fileObject->name = $fileinfo['filename']; |
49 | 52 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
50 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
51 | - unlink($sitePath . $fileObject->path); |
|
53 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
54 | + unlink($sitePath . $fileObject->path); |
|
55 | + } |
|
52 | 56 | |
53 | 57 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
54 | 58 | |
55 | - if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) |
|
56 | - return false; |
|
59 | + if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) { |
|
60 | + return false; |
|
61 | + } |
|
57 | 62 | |
58 | 63 | $fileObject->type_id = $type->pk(); |
59 | 64 | $fileObject->original_name = $file['name']; |
@@ -76,12 +81,14 @@ discard block |
||
76 | 81 | $sitePath = App::$primary->path; |
77 | 82 | |
78 | 83 | $fileinfo = pathinfo($url); |
79 | - if (empty($fileinfo['extension'])) |
|
80 | - return 0; |
|
84 | + if (empty($fileinfo['extension'])) { |
|
85 | + return 0; |
|
86 | + } |
|
81 | 87 | |
82 | 88 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
83 | - if (!$type) |
|
84 | - return 0; |
|
89 | + if (!$type) { |
|
90 | + return 0; |
|
91 | + } |
|
85 | 92 | |
86 | 93 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
87 | 94 | return 0; |
@@ -97,8 +104,9 @@ discard block |
||
97 | 104 | } |
98 | 105 | $fileObject->name = $fileinfo['filename']; |
99 | 106 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
100 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
101 | - unlink($sitePath . $fileObject->path); |
|
107 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
108 | + unlink($sitePath . $fileObject->path); |
|
109 | + } |
|
102 | 110 | |
103 | 111 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
104 | 112 |
@@ -7,16 +7,18 @@ |
||
7 | 7 | $code = 'main'; |
8 | 8 | } |
9 | 9 | $menu = \Menu\Menu::get($code, 'code'); |
10 | -if ($menu) |
|
10 | +if ($menu) { |
|
11 | 11 | foreach ($menu->items(['order' => ['weight', 'ASC']]) as $item) { |
12 | 12 | $href = $item->href; |
13 | +} |
|
13 | 14 | if ($item->type == 'materialCategory') { |
14 | 15 | $category = \Materials\Category::get($item->aditional); |
15 | 16 | $href = $category->alias ? "/materials/{$category->alias}" : "/materials/category/{$category->id}"; |
16 | 17 | } |
17 | - if (urldecode($_SERVER['REQUEST_URI']) == $href) |
|
18 | - $active = ' class = "active" '; |
|
19 | - else |
|
20 | - $active = ''; |
|
18 | + if (urldecode($_SERVER['REQUEST_URI']) == $href) { |
|
19 | + $active = ' class = "active" '; |
|
20 | + } else { |
|
21 | + $active = ''; |
|
22 | + } |
|
21 | 23 | echo "<li {$active}><a href = '{$href}'>{$item->name}</a></li>"; |
22 | 24 | } |
@@ -6,8 +6,9 @@ |
||
6 | 6 | $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
7 | 7 | foreach ($systemModules as $module) { |
8 | 8 | $info = Module::getInfo($module); |
9 | - if (!$info || isset($modules[$module])) |
|
10 | - continue; |
|
9 | + if (!$info || isset($modules[$module])) { |
|
10 | + continue; |
|
11 | + } |
|
11 | 12 | ?> |
12 | 13 | <div class ="form-group"> |
13 | 14 | <div class="checkbox"> |
@@ -25,8 +25,9 @@ |
||
25 | 25 | |
26 | 26 | $result['payId'] = $data["InvId"]; |
27 | 27 | |
28 | - if (strtolower($data['SignatureValue']) == $hashGenerated) |
|
29 | - $result['status'] = 'success'; |
|
28 | + if (strtolower($data['SignatureValue']) == $hashGenerated) { |
|
29 | + $result['status'] = 'success'; |
|
30 | + } |
|
30 | 31 | |
31 | 32 | return $result; |
32 | 33 | } |
@@ -28,20 +28,24 @@ discard block |
||
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 |
||
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 |
||
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) |