@@ -19,87 +19,87 @@ discard block |
||
19 | 19 | </thead> |
20 | 20 | <tbody> |
21 | 21 | <?php |
22 | - foreach ($carts as $cart) { |
|
23 | - $sums = []; |
|
24 | - foreach ($cart->cartItems as $cartItem) { |
|
25 | - $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0); |
|
26 | - if (empty($sums[$currency_id])) { |
|
27 | - $sums[$currency_id] = $cartItem->final_price * $cartItem->count; |
|
28 | - } else { |
|
29 | - $sums[$currency_id] += $cartItem->final_price * $cartItem->count; |
|
30 | - } |
|
31 | - } |
|
32 | - if ($cart->delivery && $cart->delivery->price) { |
|
33 | - $currency_id = $cart->delivery->currency_id; |
|
34 | - if (empty($sums[$currency_id])) { |
|
35 | - $sums[$currency_id] = $cart->delivery->price; |
|
36 | - } else { |
|
37 | - $sums[$currency_id] += $cart->delivery->price; |
|
38 | - } |
|
39 | - } |
|
40 | - foreach ($cart->extras as $extra) { |
|
41 | - $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency']; |
|
42 | - if (empty($sums[$currency_id])) { |
|
43 | - $sums[$currency_id] = $extra->price * $extra->count; |
|
44 | - } else { |
|
45 | - $sums[$currency_id] += $extra->price * $extra->count; |
|
46 | - } |
|
47 | - } |
|
48 | - ?> |
|
22 | + foreach ($carts as $cart) { |
|
23 | + $sums = []; |
|
24 | + foreach ($cart->cartItems as $cartItem) { |
|
25 | + $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0); |
|
26 | + if (empty($sums[$currency_id])) { |
|
27 | + $sums[$currency_id] = $cartItem->final_price * $cartItem->count; |
|
28 | + } else { |
|
29 | + $sums[$currency_id] += $cartItem->final_price * $cartItem->count; |
|
30 | + } |
|
31 | + } |
|
32 | + if ($cart->delivery && $cart->delivery->price) { |
|
33 | + $currency_id = $cart->delivery->currency_id; |
|
34 | + if (empty($sums[$currency_id])) { |
|
35 | + $sums[$currency_id] = $cart->delivery->price; |
|
36 | + } else { |
|
37 | + $sums[$currency_id] += $cart->delivery->price; |
|
38 | + } |
|
39 | + } |
|
40 | + foreach ($cart->extras as $extra) { |
|
41 | + $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency']; |
|
42 | + if (empty($sums[$currency_id])) { |
|
43 | + $sums[$currency_id] = $extra->price * $extra->count; |
|
44 | + } else { |
|
45 | + $sums[$currency_id] += $extra->price * $extra->count; |
|
46 | + } |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | <tr> |
50 | 50 | <td class="text-right">#<?= $cart->id; ?></td> |
51 | 51 | <td class="text-left"><?= $cart->status ? $cart->status->name : 'Наполняется'; ?></td> |
52 | 52 | <td class="text-right"><?= count($cart->cartItems); ?></td> |
53 | 53 | <td class="text-right"><?php |
54 | - if ($sums) { |
|
55 | - foreach ($sums as $currency_id => $sum) { |
|
56 | - if (!$sum) { |
|
57 | - continue; |
|
58 | - } |
|
59 | - echo number_format($sum, 2, '.', ' '); |
|
60 | - if (App::$cur->money) { |
|
61 | - $currency = Money\Currency::get($currency_id); |
|
62 | - if ($currency) { |
|
63 | - echo ' ' . $currency->acronym(); |
|
64 | - } else { |
|
65 | - echo ' р.'; |
|
66 | - } |
|
67 | - } else { |
|
68 | - echo ' р.'; |
|
69 | - } |
|
70 | - echo '<br />'; |
|
71 | - } |
|
72 | - } |
|
73 | - ?></td> |
|
54 | + if ($sums) { |
|
55 | + foreach ($sums as $currency_id => $sum) { |
|
56 | + if (!$sum) { |
|
57 | + continue; |
|
58 | + } |
|
59 | + echo number_format($sum, 2, '.', ' '); |
|
60 | + if (App::$cur->money) { |
|
61 | + $currency = Money\Currency::get($currency_id); |
|
62 | + if ($currency) { |
|
63 | + echo ' ' . $currency->acronym(); |
|
64 | + } else { |
|
65 | + echo ' р.'; |
|
66 | + } |
|
67 | + } else { |
|
68 | + echo ' р.'; |
|
69 | + } |
|
70 | + echo '<br />'; |
|
71 | + } |
|
72 | + } |
|
73 | + ?></td> |
|
74 | 74 | <td class="text-left"><?= $cart->complete_data; ?></td> |
75 | 75 | <td><?php |
76 | - if ($cart->payed) { |
|
77 | - echo 'Оплачено'; |
|
78 | - } elseif (!App::$cur->money) { |
|
79 | - echo 'Не оплачено'; |
|
80 | - } else { |
|
81 | - $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler'); |
|
82 | - $redirect = ['/ecommerce/cart/success']; |
|
83 | - if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) { |
|
84 | - $newRedirect = $handlers[$cart->payType->handler]['handler']($cart); |
|
85 | - } |
|
86 | - if (!empty($newRedirect[0])) { |
|
87 | - echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>'; |
|
88 | - } else { |
|
89 | - echo 'Не оплачено'; |
|
90 | - } |
|
91 | - } |
|
92 | - ?></td> |
|
76 | + if ($cart->payed) { |
|
77 | + echo 'Оплачено'; |
|
78 | + } elseif (!App::$cur->money) { |
|
79 | + echo 'Не оплачено'; |
|
80 | + } else { |
|
81 | + $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler'); |
|
82 | + $redirect = ['/ecommerce/cart/success']; |
|
83 | + if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) { |
|
84 | + $newRedirect = $handlers[$cart->payType->handler]['handler']($cart); |
|
85 | + } |
|
86 | + if (!empty($newRedirect[0])) { |
|
87 | + echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>'; |
|
88 | + } else { |
|
89 | + echo 'Не оплачено'; |
|
90 | + } |
|
91 | + } |
|
92 | + ?></td> |
|
93 | 93 | <td class="text-right"> |
94 | 94 | <?php |
95 | - if ($cart->cart_status_id < 2) { |
|
96 | - ?> |
|
95 | + if ($cart->cart_status_id < 2) { |
|
96 | + ?> |
|
97 | 97 | <a title="Продолжить покупки" href="/ecommerce/cart/continue/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-chevron-right"></i></a> |
98 | 98 | <a title="Удалить заказ" onclick="return confirm('Вы уверены?')" href="/ecommerce/cart/delete/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i></a> |
99 | 99 | <?php |
100 | - } |
|
101 | - if ($cart->cart_status_id >= 2) { |
|
102 | - ?> |
|
100 | + } |
|
101 | + if ($cart->cart_status_id >= 2) { |
|
102 | + ?> |
|
103 | 103 | <a title="Просмотр" href="/ecommerce/cart/orderDetail/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-info btn-sm"><i class="glyphicon glyphicon-eye-open"></i></a> |
104 | 104 | <a title="Заказать повторно" href="/ecommerce/cart/refill/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-primary btn-sm"><i class="glyphicon glyphicon-refresh"></i></a> |
105 | 105 | <?php |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | </td> |
109 | 109 | </tr> |
110 | 110 | <?php |
111 | - } |
|
112 | - ?> |
|
111 | + } |
|
112 | + ?> |
|
113 | 113 | </tbody> |
114 | 114 | </table> |
115 | 115 | </div> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if (App::$cur->money) { |
62 | 62 | $currency = Money\Currency::get($currency_id); |
63 | 63 | if ($currency) { |
64 | - echo ' ' . $currency->acronym(); |
|
64 | + echo ' '.$currency->acronym(); |
|
65 | 65 | } else { |
66 | 66 | echo ' р.'; |
67 | 67 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $newRedirect = $handlers[$cart->payType->handler]['handler']($cart); |
86 | 86 | } |
87 | 87 | if (!empty($newRedirect[0])) { |
88 | - echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>'; |
|
88 | + echo '<a class="btn btn-warning btn-sm" href = "'.$newRedirect[0].'">Оплатить</a>'; |
|
89 | 89 | } else { |
90 | 90 | echo 'Не оплачено'; |
91 | 91 | } |
@@ -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 |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | } |
47 | 47 | } |
48 | 48 | $fileObject->name = $fileinfo['filename']; |
49 | - $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); |
|
49 | + $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); |
|
52 | 52 | |
53 | - Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
|
53 | + Tools::createDir($sitePath.$type->type_dir.date('Y-m-d').'/'); |
|
54 | 54 | |
55 | - if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) |
|
55 | + if (!move_uploaded_file($file['tmp_name'], $sitePath.$fileObject->path)) |
|
56 | 56 | return false; |
57 | 57 | |
58 | 58 | $fileObject->type_id = $type->pk(); |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | } |
97 | 97 | } |
98 | 98 | $fileObject->name = $fileinfo['filename']; |
99 | - $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); |
|
99 | + $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); |
|
102 | 102 | |
103 | - Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
|
103 | + Tools::createDir($sitePath.$type->type_dir.date('Y-m-d').'/'); |
|
104 | 104 | |
105 | 105 | $file = @file_get_contents($url); |
106 | 106 | if ($file === false) { |
107 | 107 | return 0; |
108 | 108 | } |
109 | - file_put_contents($sitePath . $fileObject->path, $file); |
|
109 | + file_put_contents($sitePath.$fileObject->path, $file); |
|
110 | 110 | |
111 | 111 | $fileObject->type_id = $type->pk(); |
112 | 112 | $fileObject->original_name = $fileinfo['basename']; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | $args = func_get_args(); |
16 | 16 | $path = $this->module->getPath($args); |
17 | 17 | if($path){ |
18 | - $this->StaticLoader->giveFile($path); |
|
18 | + $this->StaticLoader->giveFile($path); |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | $args = func_get_args(); |
16 | 16 | $path = $this->module->getPath($args); |
17 | - if($path){ |
|
17 | + if ($path) { |
|
18 | 18 | $this->StaticLoader->giveFile($path); |
19 | 19 | } |
20 | 20 | } |
@@ -4,17 +4,17 @@ |
||
4 | 4 | <?= Ui\FastEdit::block($material, 'text', null, true); ?> |
5 | 5 | </div> |
6 | 6 | <?php |
7 | - if ($material->links) { |
|
8 | - echo '<ul class = "material-links">'; |
|
9 | - foreach ($material->links as $materialLink) { |
|
10 | - $href = $materialLink->linkedMaterial->alias; |
|
11 | - if ($href == '') { |
|
12 | - $href = '/'; |
|
13 | - } |
|
14 | - $name = $materialLink->name ? $materialLink->name : $materialLink->linkedMaterial->name; |
|
15 | - echo "<li><a href = '{$href}'>{$name}</a></li>"; |
|
16 | - } |
|
17 | - echo '</ul>'; |
|
18 | - } |
|
19 | - ?> |
|
7 | + if ($material->links) { |
|
8 | + echo '<ul class = "material-links">'; |
|
9 | + foreach ($material->links as $materialLink) { |
|
10 | + $href = $materialLink->linkedMaterial->alias; |
|
11 | + if ($href == '') { |
|
12 | + $href = '/'; |
|
13 | + } |
|
14 | + $name = $materialLink->name ? $materialLink->name : $materialLink->linkedMaterial->name; |
|
15 | + echo "<li><a href = '{$href}'>{$name}</a></li>"; |
|
16 | + } |
|
17 | + echo '</ul>'; |
|
18 | + } |
|
19 | + ?> |
|
20 | 20 | </div> |
21 | 21 | \ No newline at end of file |
@@ -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"> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <?php |
4 | 4 | $config = Config::app(App::$primary ? App::$primary : App::$cur); |
5 | 5 | $modules = array_flip(Module::getInstalled(App::$cur)); |
6 | - $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
|
6 | + $systemModules = array_slice(scandir(INJI_SYSTEM_DIR.'/modules'), 2); |
|
7 | 7 | foreach ($systemModules as $module) { |
8 | 8 | $info = Module::getInfo($module); |
9 | 9 | if (!$info || isset($modules[$module])) |
@@ -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 | } |
@@ -44,9 +44,9 @@ |
||
44 | 44 | 'SignatureValue' => $hash |
45 | 45 | ]; |
46 | 46 | if (empty($config['test'])) { |
47 | - \Tools::redirect('https://auth.robokassa.ru/Merchant/Index.aspx?' . http_build_query($data)); |
|
47 | + \Tools::redirect('https://auth.robokassa.ru/Merchant/Index.aspx?'.http_build_query($data)); |
|
48 | 48 | } else { |
49 | - \Tools::redirect('http://test.robokassa.ru/Index.aspx?' . http_build_query($data)); |
|
49 | + \Tools::redirect('http://test.robokassa.ru/Index.aspx?'.http_build_query($data)); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 |
@@ -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) |
@@ -21,8 +21,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -2,7 +2,7 @@ |
||
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 | }; |
@@ -12,13 +12,13 @@ discard block |
||
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 |
||
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 | } |