@@ -12,8 +12,8 @@ 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 |
@@ -34,14 +34,14 @@ 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> |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'manager' => [ |
43 | 43 | 'cols' => ['user:id', 'user_id', 'currency_id', 'amount'], |
44 | 44 | 'sortable' => ['user:id', 'user_id', 'currency_id', 'amount'], |
45 | - 'filters' => [ 'currency_id'], |
|
45 | + 'filters' => ['currency_id'], |
|
46 | 46 | ] |
47 | 47 | ]; |
48 | 48 |
@@ -81,7 +81,8 @@ |
||
81 | 81 | } |
82 | 82 | if ($complete) { |
83 | 83 | $usersCompleted[$block->wallet->user_id] = true; |
84 | - } else { |
|
84 | + } |
|
85 | + else { |
|
85 | 86 | $usersCompleted[$block->wallet->user_id] = false; |
86 | 87 | } |
87 | 88 | } |
@@ -87,7 +87,8 @@ |
||
87 | 87 | foreach ($this->currencies as $merchantCurrency) { |
88 | 88 | if ($merchantCurrency->currency_id == $pay->currency_id) { |
89 | 89 | $allowCurrencies[] = ['type' => 'primary', 'currency' => $merchantCurrency->currency]; |
90 | - } else { |
|
90 | + } |
|
91 | + else { |
|
91 | 92 | $transfer = Currency\ExchangeRate::get([['currency_id', $merchantCurrency->currency_id], ['target_currency_id', $pay->currency_id]]); |
92 | 93 | if ($transfer) { |
93 | 94 | $allowCurrencies[] = ['type' => 'transfer', 'currency' => $merchantCurrency->currency, 'transfer' => $transfer]; |
@@ -51,7 +51,8 @@ discard block |
||
51 | 51 | if (!empty($_POST['code'])) { |
52 | 52 | if ($transfer->code != $_POST['code']) { |
53 | 53 | Msg::add('Код не совпадает', 'danger'); |
54 | - } else { |
|
54 | + } |
|
55 | + else { |
|
55 | 56 | $transfer->complete = 1; |
56 | 57 | $block = Money\Wallet\Block::get('Money\Transfer:' . $transfer->id, 'data'); |
57 | 58 | $block->delete(); |
@@ -94,7 +95,8 @@ discard block |
||
94 | 95 | ]); |
95 | 96 | $pay->save(); |
96 | 97 | Tools::redirect('/money/merchants/pay/' . $pay->id); |
97 | - } else { |
|
98 | + } |
|
99 | + else { |
|
98 | 100 | $currencies = Money\Currency::getList(['where' => ['refill', 1], 'forSelect' => true]); |
99 | 101 | $this->view->setTitle('Пополнение счета'); |
100 | 102 | $this->view->page(['data' => compact('currencies')]); |
@@ -114,17 +116,20 @@ discard block |
||
114 | 116 | $where = []; |
115 | 117 | if ($currency) { |
116 | 118 | $where[] = ['currency_id', $currency->id]; |
117 | - } else { |
|
119 | + } |
|
120 | + else { |
|
118 | 121 | $where[] = ['currency_id', implode(',', array_keys($wallets)), 'IN']; |
119 | 122 | } |
120 | 123 | if ($targetCurrency) { |
121 | 124 | $where[] = ['target_currency_id', $targetCurrency->id]; |
122 | - } else { |
|
125 | + } |
|
126 | + else { |
|
123 | 127 | $where[] = ['target_currency_id', implode(',', array_keys($wallets)), 'IN']; |
124 | 128 | } |
125 | 129 | if ($where) { |
126 | 130 | $rates = Money\Currency\ExchangeRate::getList(['where' => $where]); |
127 | - } else { |
|
131 | + } |
|
132 | + else { |
|
128 | 133 | $rates = []; |
129 | 134 | } |
130 | 135 | if (!empty($_GET['exchange']) && $currency && $targetCurrency && !empty($rates[$_GET['exchange']['rate_id']])) { |
@@ -133,7 +138,8 @@ discard block |
||
133 | 138 | if (empty($_GET['exchange']['give']['amount']) || !(float) $_GET['exchange']['give']['amount']) { |
134 | 139 | Msg::add('Укажите сумму которую вы хотите отдать'); |
135 | 140 | $error = true; |
136 | - } else { |
|
141 | + } |
|
142 | + else { |
|
137 | 143 | $amount = (float) $_GET['exchange']['give']['amount']; |
138 | 144 | } |
139 | 145 | if (!empty($amount) && $amount > $wallets[$currency->id]->amount) { |
@@ -165,7 +171,8 @@ discard block |
||
165 | 171 | Tools::redirect('/money/merchants/pay/' . $pay->id, 'Нет возможности оплатить счет в валюте ' . $pay->currency->name() . ' валютой ' . $wallet->currency->name()); |
166 | 172 | } |
167 | 173 | $sum = $pay->sum / $rate->rate; |
168 | - } else { |
|
174 | + } |
|
175 | + else { |
|
169 | 176 | $sum = $pay->sum; |
170 | 177 | } |
171 | 178 | if ($sum > $wallet->amount) { |
@@ -30,14 +30,16 @@ discard block |
||
30 | 30 | foreach ($_POST as $key => $text) { |
31 | 31 | if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) { |
32 | 32 | $postData[$key] = iconv('Windows-1251', 'UTF-8', $text); |
33 | - } else { |
|
33 | + } |
|
34 | + else { |
|
34 | 35 | $postData[$key] = $text; |
35 | 36 | } |
36 | 37 | } |
37 | 38 | foreach ($_GET as $key => $text) { |
38 | 39 | if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) { |
39 | 40 | $postData[$key] = iconv('Windows-1251', 'UTF-8', $text); |
40 | - } else { |
|
41 | + } |
|
42 | + else { |
|
41 | 43 | $postData[$key] = $text; |
42 | 44 | } |
43 | 45 | } |
@@ -72,7 +74,8 @@ discard block |
||
72 | 74 | } |
73 | 75 | $pays = Money\Pay::getList(['where' => $where, 'order' => ['date_create', 'DESC']]); |
74 | 76 | $this->view->page(['content' => 'pays', 'data' => compact('bread', 'pays')]); |
75 | - } else { |
|
77 | + } |
|
78 | + else { |
|
76 | 79 | $where = [['active', 1]]; |
77 | 80 | $where[] = [$pay->type, 1]; |
78 | 81 | $merchants = Money\Merchant::getList(['where' => $where]); |
@@ -28,14 +28,14 @@ |
||
28 | 28 | public function reciverAction($system = '', $status = '') { |
29 | 29 | $postData = []; |
30 | 30 | foreach ($_POST as $key => $text) { |
31 | - if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) { |
|
31 | + if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), true)) { |
|
32 | 32 | $postData[$key] = iconv('Windows-1251', 'UTF-8', $text); |
33 | 33 | } else { |
34 | 34 | $postData[$key] = $text; |
35 | 35 | } |
36 | 36 | } |
37 | 37 | foreach ($_GET as $key => $text) { |
38 | - if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) { |
|
38 | + if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), true)) { |
|
39 | 39 | $postData[$key] = iconv('Windows-1251', 'UTF-8', $text); |
40 | 40 | } else { |
41 | 41 | $postData[$key] = $text; |
@@ -23,10 +23,10 @@ |
||
23 | 23 | </td> |
24 | 24 | <td> |
25 | 25 | <?php |
26 | - foreach ($allowCurrencies as $allowCurrency) { |
|
27 | - $className = 'Money\MerchantHelper\\' . $merchant->object_name; |
|
28 | - $sum = $className::getFinalSum($pay, $allowCurrency); |
|
29 | - ?> |
|
26 | + foreach ($allowCurrencies as $allowCurrency) { |
|
27 | + $className = 'Money\MerchantHelper\\' . $merchant->object_name; |
|
28 | + $sum = $className::getFinalSum($pay, $allowCurrency); |
|
29 | + ?> |
|
30 | 30 | <b><?= $allowCurrency['currency']->name(); ?></b> |
31 | 31 | <a class="btn btn-primary" href ="/money/merchants/go/<?= $pay->id; ?>/<?= $merchant->id; ?>/<?= $allowCurrency['currency']->id; ?>">Оплатить <?= $sum; ?> <?= $allowCurrency['currency']->acronym(); ?></a> |
32 | 32 | <?php |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!empty($params[0])) { |
|
2 | +if (!empty($params[0])) { |
|
3 | 3 | $form_id = $params[0]; |
4 | 4 | } |
5 | -if (empty($form_id)) { |
|
5 | +if (empty($form_id)) { |
|
6 | 6 | echo('form not found'); |
7 | 7 | return; |
8 | 8 | } |
9 | 9 | $userForm = \UserForms\Form::get((int) $form_id); |
10 | -if (!$userForm) { |
|
10 | +if (!$userForm) { |
|
11 | 11 | echo('form not found'); |
12 | 12 | return; |
13 | 13 | } |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | $form->begin(); |
16 | 16 | ?> |
17 | 17 | <?php |
18 | -if ($userForm->description) { |
|
18 | +if ($userForm->description) { |
|
19 | 19 | echo "<p class = 'text-center'>{$userForm->description}</p>"; |
20 | 20 | } |
21 | -foreach ($userForm->inputs(['order' => ['weight']]) as $input) { |
|
21 | +foreach ($userForm->inputs(['order' => ['weight']]) as $input) { |
|
22 | 22 | $form->input($input->type, 'UserForms[' . (int) $form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]); |
23 | 23 | } |
24 | 24 | ?> |
@@ -71,7 +71,8 @@ |
||
71 | 71 | if (empty($_COOKIE['notification-device'])) { |
72 | 72 | $deviceKey = Tools::randomString(70); |
73 | 73 | setcookie("notification-device", $deviceKey, time() + 360000, "/"); |
74 | - } else { |
|
74 | + } |
|
75 | + else { |
|
75 | 76 | $deviceKey = $_COOKIE['notification-device']; |
76 | 77 | setcookie("notification-device", $_COOKIE['notification-device'], time() + 360000, "/"); |
77 | 78 | } |