@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'manager' => [ |
44 | 44 | 'cols' => ['user:id', 'user_id', 'currency_id', 'amount'], |
45 | 45 | 'sortable' => ['user:id', 'user_id', 'currency_id', 'amount'], |
46 | - 'filters' => [ 'currency_id'], |
|
46 | + 'filters' => ['currency_id'], |
|
47 | 47 | ] |
48 | 48 | ]; |
49 | 49 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $amount = (float) $amount; |
68 | 68 | $query = \App::$cur->db->newQuery(); |
69 | - $string = 'UPDATE ' . \App::$cur->db->table_prefix . $this->table() . ' SET `' . $this->colPrefix() . 'amount`=`' . $this->colPrefix() . 'amount`+' . $amount . ' where `' . $this->index() . '` = ' . $this->id; |
|
69 | + $string = 'UPDATE '.\App::$cur->db->table_prefix.$this->table().' SET `'.$this->colPrefix().'amount`=`'.$this->colPrefix().'amount`+'.$amount.' where `'.$this->index().'` = '.$this->id; |
|
70 | 70 | $query->query($string); |
71 | 71 | $history = new Wallet\History(); |
72 | 72 | $history->wallet_id = $this->pk(); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | switch ($this->currency->round_type) { |
88 | 88 | case 'floor': |
89 | - $dif = (float) ('1' . str_repeat('0', $this->currency->round_precision)); |
|
89 | + $dif = (float) ('1'.str_repeat('0', $this->currency->round_precision)); |
|
90 | 90 | return floor($this->amount * $dif) / $dif; |
91 | 91 | default : |
92 | 92 | return $this->amount; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="dashboard-widgets"> |
2 | - <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4> |
|
2 | + <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', '.\Users\User::$cur->name() : ''; ?></h4> |
|
3 | 3 | <div class = "row"> |
4 | 4 | <?php |
5 | 5 | $rowSum = 0; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
12 | - $rowSum+=$widgetSize; |
|
12 | + $rowSum += $widgetSize; |
|
13 | 13 | ?> |
14 | 14 | <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div> |
15 | 15 | <?php |
@@ -22,15 +22,15 @@ |
||
22 | 22 | function editFileAction($templateName) |
23 | 23 | { |
24 | 24 | $template = \View\Template::get($templateName, \App::$primary); |
25 | - if (!empty($_GET['path']) && file_exists($template->path . '/' . Tools::parsePath($_GET['path']))) { |
|
25 | + if (!empty($_GET['path']) && file_exists($template->path.'/'.Tools::parsePath($_GET['path']))) { |
|
26 | 26 | $code = file_get_contents("php://input"); |
27 | 27 | if (!empty($code)) { |
28 | 28 | $result = new Server\Result(); |
29 | 29 | $result->successMsg = 'Файл сохранен'; |
30 | - $content = file_put_contents($template->path . '/' . Tools::parsePath($_GET['path']), $code); |
|
30 | + $content = file_put_contents($template->path.'/'.Tools::parsePath($_GET['path']), $code); |
|
31 | 31 | $result->send(); |
32 | 32 | } |
33 | - $content = file_get_contents($template->path . '/' . Tools::parsePath($_GET['path'])); |
|
33 | + $content = file_get_contents($template->path.'/'.Tools::parsePath($_GET['path'])); |
|
34 | 34 | $this->libs->loadLib('Ace'); |
35 | 35 | $this->view->page(['content' => 'template/edit', 'data' => compact('template', 'content')]); |
36 | 36 | } else { |
@@ -32,19 +32,19 @@ discard block |
||
32 | 32 | ?> |
33 | 33 | <div class="item <?= !$i ? 'active' : ''; ?>"> |
34 | 34 | <?php |
35 | - if ($item->link) { |
|
36 | - echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
37 | - } |
|
38 | - ?> |
|
35 | + if ($item->link) { |
|
36 | + echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
37 | + } |
|
38 | + ?> |
|
39 | 39 | <img src="<?= Statics::file($item->image->path); ?>" alt="<?= $item->name; ?>"> |
40 | 40 | <div class="carousel-caption"> |
41 | 41 | <?= $item->description; ?> |
42 | 42 | </div> |
43 | 43 | <?php |
44 | - if ($item->link) { |
|
45 | - echo "</a>"; |
|
46 | - } |
|
47 | - ?> |
|
44 | + if ($item->link) { |
|
45 | + echo "</a>"; |
|
46 | + } |
|
47 | + ?> |
|
48 | 48 | </div> |
49 | 49 | <?php |
50 | 50 | $i++; |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | </div> |
54 | 54 | |
55 | 55 | <?php |
56 | - if (!isset($arrows) || $arrows) { |
|
57 | - ?> |
|
56 | + if (!isset($arrows) || $arrows) { |
|
57 | + ?> |
|
58 | 58 | <!-- Controls --> |
59 | 59 | <a class="left carousel-control" href="#sliderWidget-<?= $slider->id; ?>" role="button" data-slide="prev"> |
60 | 60 | <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | <span class="sr-only">Next</span> |
66 | 66 | </a> |
67 | 67 | <?php |
68 | - } |
|
69 | - ?> |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | </div> |
71 | 71 | \ No newline at end of file |
@@ -9,6 +9,6 @@ |
||
9 | 9 | <a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-index='<?= $model::index(); ?>' data-path ='/' data-id='0'> Корень</a> |
10 | 10 | <div class="categoryTree"> |
11 | 11 | <?php |
12 | - $dataManager->drawCategorys(); |
|
13 | - ?> |
|
12 | + $dataManager->drawCategorys(); |
|
13 | + ?> |
|
14 | 14 | </div> |
15 | 15 | \ No newline at end of file |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | public function realType() |
57 | 57 | { |
58 | - if ($this->option && $this->option->type) { |
|
58 | + if ($this->option && $this->option->type) { |
|
59 | 59 | $type = $this->option->type; |
60 | 60 | |
61 | 61 | if ($type == 'select') { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'col' => 'item_offer_id', |
77 | 77 | //'resultKey' => 'code', |
78 | 78 | 'resultKey' => 'item_offer_option_id', |
79 | - 'join' => [Offer\Option::table(), Offer\Option::index() . ' = ' . Offer\Param::colPrefix() . Offer\Option::index()] |
|
79 | + 'join' => [Offer\Option::table(), Offer\Option::index().' = '.Offer\Param::colPrefix().Offer\Option::index()] |
|
80 | 80 | ], |
81 | 81 | 'item' => [ |
82 | 82 | 'model' => 'Ecommerce\Item', |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | { |
90 | 90 | $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]); |
91 | 91 | if ($warehouse) { |
92 | - $warehouse->count +=(float) $count; |
|
92 | + $warehouse->count += (float) $count; |
|
93 | 93 | $warehouse->save(); |
94 | 94 | } else { |
95 | 95 | $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]); |
96 | 96 | if ($warehouse) { |
97 | - $warehouse->count +=(float) $count; |
|
97 | + $warehouse->count += (float) $count; |
|
98 | 98 | $warehouse->save(); |
99 | 99 | } |
100 | 100 | } |
@@ -112,21 +112,21 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | if ($warehouseIds) { |
115 | - \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index(), $warehouseIds, 'IN'); |
|
115 | + \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index(), $warehouseIds, 'IN'); |
|
116 | 116 | } |
117 | - \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
118 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` '; |
|
117 | + \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
118 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` '; |
|
119 | 119 | $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch(); |
120 | 120 | |
121 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` '; |
|
122 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
121 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` '; |
|
122 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
123 | 123 | if ($cart_id) { |
124 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
124 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
125 | 125 | } |
126 | 126 | $on = ' |
127 | - ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
|
128 | - (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || |
|
129 | - (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
127 | + ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND ( |
|
128 | + (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || |
|
129 | + (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
130 | 130 | ) |
131 | 131 | '; |
132 | 132 | \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner'); |
@@ -38,25 +38,25 @@ |
||
38 | 38 | $return = new Server\Result(); |
39 | 39 | ob_start(); |
40 | 40 | $form->checkRequest($params, true); |
41 | - $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : ''); |
|
41 | + $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : ''); |
|
42 | 42 | $get = $_GET; |
43 | 43 | if (isset($get['notSave'])) { |
44 | 44 | unset($get['notSave']); |
45 | 45 | } |
46 | - $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get); |
|
46 | + $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get); |
|
47 | 47 | $form->draw($params, true); |
48 | 48 | $return->content = ob_get_contents(); |
49 | 49 | ob_end_clean(); |
50 | 50 | $return->send(); |
51 | 51 | } else { |
52 | 52 | $form->checkRequest($params); |
53 | - $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : ''); |
|
53 | + $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : ''); |
|
54 | 54 | $get = $_GET; |
55 | 55 | if (isset($get['notSave'])) { |
56 | 56 | unset($get['notSave']); |
57 | 57 | } |
58 | - $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get); |
|
59 | - $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ') . $form->header); |
|
58 | + $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get); |
|
59 | + $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ').$form->header); |
|
60 | 60 | $this->view->page(['content' => 'form', 'data' => compact('form', 'params')]); |
61 | 61 | } |
62 | 62 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | 'procent' => 'Процент', |
22 | 22 | 'amount' => 'Сумма', |
23 | 23 | ]; |
24 | -return $levelTypes[$level->params['type']->value] . ': ' . $level->params['amount']->value . ' ' . ($level->params['type']->value == 'procent' ? '%' : ($level->params['currency_id']->value ? \Money\Currency::get($level->params['currency_id']->value)->acronym() : '')); |
|
24 | +return $levelTypes[$level->params['type']->value].': '.$level->params['amount']->value.' '.($level->params['type']->value == 'procent' ? '%' : ($level->params['currency_id']->value ? \Money\Currency::get($level->params['currency_id']->value)->acronym() : '')); |
|
25 | 25 | }, |
26 | 26 | 'rewarder' => function($reward, $sums, $user, $rootUser, $level, $rewardGet) { |
27 | 27 | $wallets = \App::$cur->money->getUserWallets($user->id); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | return 0; |
64 | 64 | } |
65 | 65 | |
66 | - $text = 'Вознаграждение по программе "' . $reward->name . '"'; |
|
66 | + $text = 'Вознаграждение по программе "'.$reward->name.'"'; |
|
67 | 67 | if ($rootUser->id != $user->id) { |
68 | - $text .= ' от ' . $rootUser->name(); |
|
68 | + $text .= ' от '.$rootUser->name(); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if (!$rewardGet && $reward->block) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $block->wallet_id = $wallets[$level->params['currency_id']->value]->id; |
74 | 74 | $block->amount = $amount; |
75 | 75 | $block->comment = $text; |
76 | - $block->data = 'reward:' . $reward->id; |
|
76 | + $block->data = 'reward:'.$reward->id; |
|
77 | 77 | $dateGenerators = \App::$cur->money->getSnippets('expiredDateGenerator'); |
78 | 78 | if ($reward->block_date_expired && !empty($dateGenerators[$reward->block_date_expired])) { |
79 | 79 | $date = $dateGenerators[$reward->block_date_expired]($reward, $user); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } else { |
89 | 89 | $wallets[$level->params['currency_id']->value]->diff($amount, $text); |
90 | 90 | } |
91 | - \App::$cur->users->AddUserActivity($user->id, 4, $text . '<br />' . $amount . ' ' . $wallets[$level->params['currency_id']->value]->currency->acronym()); |
|
91 | + \App::$cur->users->AddUserActivity($user->id, 4, $text.'<br />'.$amount.' '.$wallets[$level->params['currency_id']->value]->currency->acronym()); |
|
92 | 92 | } |
93 | 93 | return $amount; |
94 | 94 | } |