@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | $inputs = json_decode($params[0]->fr_data, true); |
4 | 4 | foreach ($params[0]->form->inputs as $input) { |
5 | - if (isset($inputs['input' . $input->fi_id])) { |
|
6 | - echo "{$input->fi_label}: " . htmlspecialchars($inputs['input' . $input->fi_id]) . "<br />"; |
|
5 | + if (isset($inputs['input'.$input->fi_id])) { |
|
6 | + echo "{$input->fi_label}: ".htmlspecialchars($inputs['input'.$input->fi_id])."<br />"; |
|
7 | 7 | } |
8 | 8 | } |
@@ -24,13 +24,13 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | public function name() |
81 | 81 | { |
82 | - return $this->code ? $this->code : $this->id . ' - ' . $this->user->name(); |
|
82 | + return $this->code ? $this->code : $this->id.' - '.$this->user->name(); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | { |
113 | 113 | |
114 | 114 | if ($this->id) { |
115 | - $this->search_index = $this->name . ' '; |
|
115 | + $this->search_index = $this->name.' '; |
|
116 | 116 | if ($this->category) { |
117 | - $this->search_index .= $this->category->name . ' '; |
|
117 | + $this->search_index .= $this->category->name.' '; |
|
118 | 118 | } |
119 | 119 | if ($this->options) { |
120 | 120 | foreach ($this->options as $option) { |
121 | 121 | if ($option->item_option_searchable && $option->value) { |
122 | 122 | if ($option->item_option_type != 'select') { |
123 | - $this->search_index .= $option->value . ' '; |
|
123 | + $this->search_index .= $option->value.' '; |
|
124 | 124 | } elseif (!empty($option->option->items[$option->value])) { |
125 | - $option->option->items[$option->value]->value . ' '; |
|
125 | + $option->option->items[$option->value]->value.' '; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'col' => 'item_id', |
145 | 145 | //'resultKey' => 'code', |
146 | 146 | 'resultKey' => 'item_option_id', |
147 | - 'join' => [Item\Option::table(), Item\Option::index() . ' = ' . Item\Param::colPrefix() . Item\Option::index()] |
|
147 | + 'join' => [Item\Option::table(), Item\Option::index().' = '.Item\Param::colPrefix().Item\Option::index()] |
|
148 | 148 | ], |
149 | 149 | 'offers' => [ |
150 | 150 | 'type' => 'many', |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $curPrice = $price; |
182 | 182 | } elseif ( |
183 | 183 | (!$price->type->roles && !$curPrice) || |
184 | - ($price->type->roles && !$curPrice && strpos($price->type->roles, "|" . \Users\User::$cur->role_id . "|") !== false) |
|
184 | + ($price->type->roles && !$curPrice && strpos($price->type->roles, "|".\Users\User::$cur->role_id."|") !== false) |
|
185 | 185 | ) { |
186 | 186 | $curPrice = $price; |
187 | 187 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $event->save(); |
32 | 32 | } |
33 | 33 | if ($cur->count != $this->count) { |
34 | - $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 4, 'info' => $this->item_offer_price_id . "|" . ($this->count - $cur->count)]); |
|
34 | + $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 4, 'info' => $this->item_offer_price_id."|".($this->count - $cur->count)]); |
|
35 | 35 | $event->save(); |
36 | 36 | } |
37 | 37 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | public static function itemName($item) |
218 | 218 | { |
219 | - return $item->pk() . '. ' . $item->name(); |
|
219 | + return $item->pk().'. '.$item->name(); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | public static $forms = [ |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $groups[$stage->group] = $stage; |
282 | 282 | } |
283 | 283 | } |
284 | - $discounts = Cart\Discount::getList(['where'=>['cart_id',$this->id]]); |
|
284 | + $discounts = Cart\Discount::getList(['where'=>['cart_id', $this->id]]); |
|
285 | 285 | foreach ($discounts as $discount) { |
286 | 286 | if (!isset($groups[$discount->group]) && $discount->auto) { |
287 | 287 | $discount->delete(); |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | { |
79 | 79 | $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]); |
80 | 80 | if ($warehouse) { |
81 | - $warehouse->count +=(float) $count; |
|
81 | + $warehouse->count += (float) $count; |
|
82 | 82 | $warehouse->save(); |
83 | 83 | } else { |
84 | 84 | $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]); |
85 | 85 | if ($warehouse) { |
86 | - $warehouse->count +=(float) $count; |
|
86 | + $warehouse->count += (float) $count; |
|
87 | 87 | $warehouse->save(); |
88 | 88 | } |
89 | 89 | } |
@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | |
92 | 92 | public function warehouseCount($cart_id = 0) |
93 | 93 | { |
94 | - \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
95 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` '; |
|
94 | + \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
95 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` '; |
|
96 | 96 | $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch(); |
97 | 97 | |
98 | - \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` '; |
|
99 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
|
98 | + \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` '; |
|
99 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id); |
|
100 | 100 | if ($cart_id) { |
101 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
101 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
102 | 102 | } |
103 | 103 | $on = ' |
104 | - ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
|
105 | - (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || |
|
106 | - (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
104 | + ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND ( |
|
105 | + (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || |
|
106 | + (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE)) |
|
107 | 107 | ) |
108 | 108 | '; |
109 | 109 | \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner'); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | foreach ($managers as $manager) { |
8 | 8 | $dataManager = new Ui\DataManager($manager); |
9 | 9 | $dataManagers[$manager] = $dataManager; |
10 | - $code = 'tab_' . str_replace('\\', '_', $manager); |
|
10 | + $code = 'tab_'.str_replace('\\', '_', $manager); |
|
11 | 11 | echo "<li role='presentation'><a href='#{$code}' aria-controls='{$code}' role='tab' data-toggle='tab'>{$dataManager->name}</a></li>"; |
12 | 12 | } |
13 | 13 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | </div> |
55 | 55 | <?php |
56 | 56 | foreach ($dataManagers as $manager => $dataManager) { |
57 | - $code = 'tab_' . str_replace('\\', '_', $manager); |
|
57 | + $code = 'tab_'.str_replace('\\', '_', $manager); |
|
58 | 58 | ?> |
59 | 59 | <div role="tabpanel" class="tab-pane fade" id="<?= $code; ?>"> |
60 | 60 | <?php |
@@ -74,8 +74,8 @@ |
||
74 | 74 | unset($items[$key]); |
75 | 75 | unset($item); |
76 | 76 | } |
77 | - echo 'Происходит процесс индексации: проиндексировано ' . $i * $count; |
|
78 | - Tools::redirect('/admin/ecommerce/reSearchIndex/' . $i); |
|
77 | + echo 'Происходит процесс индексации: проиндексировано '.$i * $count; |
|
78 | + Tools::redirect('/admin/ecommerce/reSearchIndex/'.$i); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 |