@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | <tr> |
| 18 | 18 | <td class="text-left" style="width: 50%;"> |
| 19 | 19 | <?php |
| 20 | - foreach ($orderDeatilCols as $col => $label) { |
|
| 21 | - echo "<b>{$label}</b> " . $cart->$col . "<br>"; |
|
| 22 | - } |
|
| 23 | - ?> |
|
| 20 | + foreach ($orderDeatilCols as $col => $label) { |
|
| 21 | + echo "<b>{$label}</b> " . $cart->$col . "<br>"; |
|
| 22 | + } |
|
| 23 | + ?> |
|
| 24 | 24 | </td> |
| 25 | 25 | <td class="text-left"> |
| 26 | 26 | <b>Способ оплаты</b> <?= $cart->payType ? $cart->payType->name : '' ?><br> |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | <tr> |
| 40 | 40 | <td class="text-left"> |
| 41 | 41 | <?php |
| 42 | - if ($cart->infos) { |
|
| 43 | - foreach ($cart->infos as $info) { |
|
| 44 | - echo "<b>{$info->field->name()}</b> " . $info->value . "<br>"; |
|
| 45 | - } |
|
| 46 | - } |
|
| 47 | - ?> |
|
| 42 | + if ($cart->infos) { |
|
| 43 | + foreach ($cart->infos as $info) { |
|
| 44 | + echo "<b>{$info->field->name()}</b> " . $info->value . "<br>"; |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | + ?> |
|
| 48 | 48 | </td> |
| 49 | 49 | </tr> |
| 50 | 50 | </tbody> |
@@ -65,45 +65,45 @@ discard block |
||
| 65 | 65 | </thead> |
| 66 | 66 | <tbody> |
| 67 | 67 | <?php |
| 68 | - $sums = []; |
|
| 69 | - foreach ($cart->cartItems as $cartItem) { |
|
| 70 | - $item = $cartItem->item; |
|
| 71 | - $itemName = $item->name(); |
|
| 72 | - if (!isset($sums[$cartItem->price->currency_id])) { |
|
| 73 | - $sums[$cartItem->price->currency_id] = $cartItem->price->price; |
|
| 74 | - } else { |
|
| 75 | - $sums[$cartItem->price->currency_id] += $cartItem->price->price; |
|
| 76 | - } |
|
| 77 | - ?> |
|
| 68 | + $sums = []; |
|
| 69 | + foreach ($cart->cartItems as $cartItem) { |
|
| 70 | + $item = $cartItem->item; |
|
| 71 | + $itemName = $item->name(); |
|
| 72 | + if (!isset($sums[$cartItem->price->currency_id])) { |
|
| 73 | + $sums[$cartItem->price->currency_id] = $cartItem->price->price; |
|
| 74 | + } else { |
|
| 75 | + $sums[$cartItem->price->currency_id] += $cartItem->price->price; |
|
| 76 | + } |
|
| 77 | + ?> |
|
| 78 | 78 | <tr> |
| 79 | 79 | <td class="text-left"><?= $itemName; ?></td> |
| 80 | 80 | <td class="text-right"><?= $cartItem->count; ?></td> |
| 81 | 81 | <td class="text-right"><?= $cartItem->price->price; ?> |
| 82 | 82 | <?php |
| 83 | - if (App::$cur->money) { |
|
| 84 | - $currency = Money\Currency::get($cartItem->price->currency_id); |
|
| 85 | - if ($currency) { |
|
| 86 | - echo $currency->acronym(); |
|
| 87 | - } else { |
|
| 88 | - echo 'руб.'; |
|
| 89 | - } |
|
| 90 | - } else { |
|
| 91 | - echo 'руб.'; |
|
| 92 | - } |
|
| 93 | - ?></td> |
|
| 83 | + if (App::$cur->money) { |
|
| 84 | + $currency = Money\Currency::get($cartItem->price->currency_id); |
|
| 85 | + if ($currency) { |
|
| 86 | + echo $currency->acronym(); |
|
| 87 | + } else { |
|
| 88 | + echo 'руб.'; |
|
| 89 | + } |
|
| 90 | + } else { |
|
| 91 | + echo 'руб.'; |
|
| 92 | + } |
|
| 93 | + ?></td> |
|
| 94 | 94 | <td class="text-right"><?= ($cartItem->price->price * $cartItem->count); ?> |
| 95 | 95 | <?php |
| 96 | - if (App::$cur->money) { |
|
| 97 | - $currency = Money\Currency::get($cartItem->price->currency_id); |
|
| 98 | - if ($currency) { |
|
| 99 | - echo $currency->acronym(); |
|
| 100 | - } else { |
|
| 101 | - echo 'руб.'; |
|
| 102 | - } |
|
| 103 | - } else { |
|
| 104 | - echo 'руб.'; |
|
| 105 | - } |
|
| 106 | - ?></td> |
|
| 96 | + if (App::$cur->money) { |
|
| 97 | + $currency = Money\Currency::get($cartItem->price->currency_id); |
|
| 98 | + if ($currency) { |
|
| 99 | + echo $currency->acronym(); |
|
| 100 | + } else { |
|
| 101 | + echo 'руб.'; |
|
| 102 | + } |
|
| 103 | + } else { |
|
| 104 | + echo 'руб.'; |
|
| 105 | + } |
|
| 106 | + ?></td> |
|
| 107 | 107 | <td class="text-right" style="white-space: nowrap;"> |
| 108 | 108 | <a onclick = 'inji.Ecommerce.Cart.addItem(<?= $item->getPrice()->id; ?>, 1); |
| 109 | 109 | return false;' data-original-title="Добавить в корзину" href="#" data-toggle="tooltip" title="" class="btn btn-primary"><i class="glyphicon glyphicon-shopping-cart"></i></a> |
@@ -117,24 +117,24 @@ discard block |
||
| 117 | 117 | <td colspan="2"></td> |
| 118 | 118 | <td class="text-right"><b>Сумма</b></td> |
| 119 | 119 | <td class="text-right"><?php |
| 120 | - foreach ($sums as $currency_id => $sum) { |
|
| 121 | - if (!$sum) { |
|
| 122 | - continue; |
|
| 123 | - } |
|
| 124 | - echo number_format($sum, 2, '.', ' '); |
|
| 125 | - if (App::$cur->money) { |
|
| 126 | - $currency = Money\Currency::get($currency_id); |
|
| 127 | - if ($currency) { |
|
| 128 | - echo ' ' . $currency->acronym(); |
|
| 129 | - } else { |
|
| 130 | - echo ' руб.'; |
|
| 131 | - } |
|
| 132 | - } else { |
|
| 133 | - echo ' руб.'; |
|
| 134 | - } |
|
| 135 | - echo '<br />'; |
|
| 136 | - } |
|
| 137 | - ?></td> |
|
| 120 | + foreach ($sums as $currency_id => $sum) { |
|
| 121 | + if (!$sum) { |
|
| 122 | + continue; |
|
| 123 | + } |
|
| 124 | + echo number_format($sum, 2, '.', ' '); |
|
| 125 | + if (App::$cur->money) { |
|
| 126 | + $currency = Money\Currency::get($currency_id); |
|
| 127 | + if ($currency) { |
|
| 128 | + echo ' ' . $currency->acronym(); |
|
| 129 | + } else { |
|
| 130 | + echo ' руб.'; |
|
| 131 | + } |
|
| 132 | + } else { |
|
| 133 | + echo ' руб.'; |
|
| 134 | + } |
|
| 135 | + echo '<br />'; |
|
| 136 | + } |
|
| 137 | + ?></td> |
|
| 138 | 138 | <td></td> |
| 139 | 139 | </tr> |
| 140 | 140 | <?php |
@@ -160,24 +160,24 @@ discard block |
||
| 160 | 160 | <td colspan="2"></td> |
| 161 | 161 | <td class="text-right"><b>Итого</b></td> |
| 162 | 162 | <td class="text-right"><?php |
| 163 | - foreach ($sums as $currency_id => $sum) { |
|
| 164 | - if (!$sum) { |
|
| 165 | - continue; |
|
| 166 | - } |
|
| 167 | - echo number_format($sum, 2, '.', ' '); |
|
| 168 | - if (App::$cur->money) { |
|
| 169 | - $currency = Money\Currency::get($currency_id); |
|
| 170 | - if ($currency) { |
|
| 171 | - echo ' ' . $currency->acronym(); |
|
| 172 | - } else { |
|
| 173 | - echo ' руб.'; |
|
| 174 | - } |
|
| 175 | - } else { |
|
| 176 | - echo ' руб.'; |
|
| 177 | - } |
|
| 178 | - echo '<br />'; |
|
| 179 | - } |
|
| 180 | - ?></td> |
|
| 163 | + foreach ($sums as $currency_id => $sum) { |
|
| 164 | + if (!$sum) { |
|
| 165 | + continue; |
|
| 166 | + } |
|
| 167 | + echo number_format($sum, 2, '.', ' '); |
|
| 168 | + if (App::$cur->money) { |
|
| 169 | + $currency = Money\Currency::get($currency_id); |
|
| 170 | + if ($currency) { |
|
| 171 | + echo ' ' . $currency->acronym(); |
|
| 172 | + } else { |
|
| 173 | + echo ' руб.'; |
|
| 174 | + } |
|
| 175 | + } else { |
|
| 176 | + echo ' руб.'; |
|
| 177 | + } |
|
| 178 | + echo '<br />'; |
|
| 179 | + } |
|
| 180 | + ?></td> |
|
| 181 | 181 | <td></td> |
| 182 | 182 | </tr> |
| 183 | 183 | </tfoot> |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | </thead> |
| 195 | 195 | <tbody> |
| 196 | 196 | <?php |
| 197 | - $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]); |
|
| 198 | - foreach ($statuses as $status) { |
|
| 199 | - ?> |
|
| 197 | + $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]); |
|
| 198 | + foreach ($statuses as $status) { |
|
| 199 | + ?> |
|
| 200 | 200 | <tr> |
| 201 | 201 | <td class="text-left"><?= $status->date_create; ?></td> |
| 202 | 202 | <td class="text-left"><?= $status->type->name; ?></td> |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | </thead> |
| 87 | 87 | <tbody> |
| 88 | 88 | <?php |
| 89 | - if (class_exists('Money\Currency')) { |
|
| 90 | - $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']); |
|
| 91 | - } else { |
|
| 92 | - $defaultCurrency = ''; |
|
| 93 | - } |
|
| 94 | - foreach ($cart->cartItems as $cartItem) { |
|
| 95 | - $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png'; |
|
| 96 | - ?> |
|
| 89 | + if (class_exists('Money\Currency')) { |
|
| 90 | + $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']); |
|
| 91 | + } else { |
|
| 92 | + $defaultCurrency = ''; |
|
| 93 | + } |
|
| 94 | + foreach ($cart->cartItems as $cartItem) { |
|
| 95 | + $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png'; |
|
| 96 | + ?> |
|
| 97 | 97 | <tr class="cart_item_id<?= $cartItem->id; ?> item" data-cart_item_id = '<?php echo $cartItem->id; ?>' data-priceam = '<?php echo $cartItem->price->price; ?>' data-item_offer_price_id = '<?php echo $cartItem->price->id; ?>'> |
| 98 | 98 | <td class="text-center image"> |
| 99 | 99 | <a href="/ecommerce/view/<?php echo $cartItem->item->id; ?>"> |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | </tbody> |
| 125 | 125 | <tfoot> |
| 126 | 126 | <?php |
| 127 | - $colspan = $cart->hasDiscount() ? 5 : 4; |
|
| 128 | - ?> |
|
| 127 | + $colspan = $cart->hasDiscount() ? 5 : 4; |
|
| 128 | + ?> |
|
| 129 | 129 | <tr class="order_page-sum"> |
| 130 | 130 | <td colspan="<?= $colspan; ?>" class="text-right">Сумма:</td> |
| 131 | 131 | <td colspan="2" class="text-right"><?= $cart->itemsSum(); ?></td> |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | <tr class="order_page-deliverySum"> |
| 145 | 145 | <td colspan="<?= $colspan; ?>" class="text-right"><?= $cart->delivery->name; ?>:</td> |
| 146 | 146 | <td colspan="2" class="text-right"><?php |
| 147 | - if ($cart->delivery && $cart->delivery->price_text) { |
|
| 148 | - echo $cart->delivery->price_text; |
|
| 149 | - } else { |
|
| 150 | - echo $cart->deliverySum(); |
|
| 151 | - } |
|
| 152 | - ?></td> |
|
| 147 | + if ($cart->delivery && $cart->delivery->price_text) { |
|
| 148 | + echo $cart->delivery->price_text; |
|
| 149 | + } else { |
|
| 150 | + echo $cart->deliverySum(); |
|
| 151 | + } |
|
| 152 | + ?></td> |
|
| 153 | 153 | </tr> |
| 154 | 154 | <?php |
| 155 | 155 | } |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | <div class="clearfix"></div> |
| 166 | 166 | <div class="order_page-finish"> |
| 167 | 167 | <?php |
| 168 | - $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']); |
|
| 169 | - ?> |
|
| 168 | + $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']); |
|
| 169 | + ?> |
|
| 170 | 170 | <div class="order_page-orderBtn"> |
| 171 | 171 | <button name ="action" value ="order" data-loading-text="Подождите.." class="btn btn-primary">Подтверждение заказа</button> |
| 172 | 172 | </div> |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <div class="ecommerce"> |
| 2 | 2 | <div class="cart-order_page"> |
| 3 | 3 | <?php |
| 4 | - $form = new Ui\Form; |
|
| 5 | - $form->action = "/ecommerce/buyCard"; |
|
| 6 | - $form->begin(); |
|
| 7 | - ?> |
|
| 4 | + $form = new Ui\Form; |
|
| 5 | + $form->action = "/ecommerce/buyCard"; |
|
| 6 | + $form->begin(); |
|
| 7 | + ?> |
|
| 8 | 8 | <div class="row"> |
| 9 | 9 | <div class="col-sm-4"> |
| 10 | 10 | <div class="order_page-info"> |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | </thead> |
| 35 | 35 | <tbody class="cartitems"> |
| 36 | 36 | <?php |
| 37 | - $first = true; |
|
| 38 | - foreach (\Ecommerce\Card::getList() as $card) { |
|
| 39 | - $checked = $first; |
|
| 40 | - $first = false; |
|
| 41 | - ?> |
|
| 37 | + $first = true; |
|
| 38 | + foreach (\Ecommerce\Card::getList() as $card) { |
|
| 39 | + $checked = $first; |
|
| 40 | + $first = false; |
|
| 41 | + ?> |
|
| 42 | 42 | <tr> |
| 43 | 43 | <td> |
| 44 | 44 | <input id ="cardId" type="radio" name ="card_id" value ="<?= $card->id; ?>" <?= $checked ? 'checked' : ''; ?> /> |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | <td> |
| 51 | 51 | <ul> |
| 52 | 52 | <?php |
| 53 | - foreach ($card->levels as $level) { |
|
| 54 | - ?> |
|
| 53 | + foreach ($card->levels as $level) { |
|
| 54 | + ?> |
|
| 55 | 55 | <li><?= $level->name; ?> - <?= $level->discount->name; ?></li> |
| 56 | 56 | <?php |
| 57 | 57 | } |
@@ -17,20 +17,20 @@ |
||
| 17 | 17 | <h1><?= $item->name(); ?></h1> |
| 18 | 18 | <ul class="item-options"> |
| 19 | 19 | <?php |
| 20 | - foreach ($item->options as $param) { |
|
| 21 | - if (!$param->item_option_view || !$param->value) |
|
| 22 | - continue; |
|
| 23 | - if ($param->item_option_type == 'select') { |
|
| 24 | - if (empty($param->option->items[$param->value])) |
|
| 25 | - continue; |
|
| 26 | - $value = $param->option->items[$param->value]->value; |
|
| 27 | - } else { |
|
| 28 | - $value = $param->value; |
|
| 29 | - } |
|
| 30 | - $paramName = $param->item_option_name; |
|
| 31 | - echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | - } |
|
| 33 | - ?> |
|
| 20 | + foreach ($item->options as $param) { |
|
| 21 | + if (!$param->item_option_view || !$param->value) |
|
| 22 | + continue; |
|
| 23 | + if ($param->item_option_type == 'select') { |
|
| 24 | + if (empty($param->option->items[$param->value])) |
|
| 25 | + continue; |
|
| 26 | + $value = $param->option->items[$param->value]->value; |
|
| 27 | + } else { |
|
| 28 | + $value = $param->value; |
|
| 29 | + } |
|
| 30 | + $paramName = $param->item_option_name; |
|
| 31 | + echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | + } |
|
| 33 | + ?> |
|
| 34 | 34 | </ul> |
| 35 | 35 | <div class="item-actions"> |
| 36 | 36 | <div class="item-price"> |
@@ -2,15 +2,15 @@ |
||
| 2 | 2 | <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4> |
| 3 | 3 | <div class = "row"> |
| 4 | 4 | <?php |
| 5 | - $rowSum = 0; |
|
| 6 | - foreach ($sections as $section) { |
|
| 7 | - if (empty($section['widget'])) { |
|
| 8 | - continue; |
|
| 9 | - } |
|
| 5 | + $rowSum = 0; |
|
| 6 | + foreach ($sections as $section) { |
|
| 7 | + if (empty($section['widget'])) { |
|
| 8 | + continue; |
|
| 9 | + } |
|
| 10 | 10 | |
| 11 | - $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
|
| 12 | - $rowSum+=$widgetSize; |
|
| 13 | - ?> |
|
| 11 | + $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
|
| 12 | + $rowSum+=$widgetSize; |
|
| 13 | + ?> |
|
| 14 | 14 | <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div> |
| 15 | 15 | <?php |
| 16 | 16 | if ($rowSum >= 3) { |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <h1>Установка модулей</h1> |
| 2 | 2 | <form> |
| 3 | 3 | <?php |
| 4 | - $config = Config::app(App::$primary ? App::$primary : App::$cur); |
|
| 5 | - $modules = array_flip(Module::getInstalled(App::$cur)); |
|
| 6 | - $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
|
| 7 | - foreach ($systemModules as $module) { |
|
| 8 | - $info = Module::getInfo($module); |
|
| 9 | - if (!$info || isset($modules[$module])) |
|
| 10 | - continue; |
|
| 11 | - ?> |
|
| 4 | + $config = Config::app(App::$primary ? App::$primary : App::$cur); |
|
| 5 | + $modules = array_flip(Module::getInstalled(App::$cur)); |
|
| 6 | + $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
|
| 7 | + foreach ($systemModules as $module) { |
|
| 8 | + $info = Module::getInfo($module); |
|
| 9 | + if (!$info || isset($modules[$module])) |
|
| 10 | + continue; |
|
| 11 | + ?> |
|
| 12 | 12 | <div class ="form-group"> |
| 13 | 13 | <div class="checkbox"> |
| 14 | 14 | <label> |
@@ -42,10 +42,10 @@ |
||
| 42 | 42 | <div class="col-lg-10"> |
| 43 | 43 | <select class="form-control" name = 'user_role_id'> |
| 44 | 44 | <?php |
| 45 | - foreach ($roles as $role) { |
|
| 46 | - echo "<option value = '{$role['role_id']}'>{$role['role_name']}</option>"; |
|
| 47 | - } |
|
| 48 | - ?> |
|
| 45 | + foreach ($roles as $role) { |
|
| 46 | + echo "<option value = '{$role['role_id']}'>{$role['role_name']}</option>"; |
|
| 47 | + } |
|
| 48 | + ?> |
|
| 49 | 49 | </select> |
| 50 | 50 | </div> |
| 51 | 51 | </div> |
@@ -41,14 +41,14 @@ |
||
| 41 | 41 | <div class="col-lg-10"> |
| 42 | 42 | <select class="form-control" name = 'user_role_id'> |
| 43 | 43 | <?php |
| 44 | - foreach ($roles as $role) { |
|
| 45 | - if ($role['role_id'] == $user->user_role_id) |
|
| 46 | - $selected = 'selected = "selected"'; |
|
| 47 | - else |
|
| 48 | - $selected = ''; |
|
| 49 | - echo "<option {$selected} value = '{$role['role_id']}'>{$role['role_name']}</option>"; |
|
| 50 | - } |
|
| 51 | - ?> |
|
| 44 | + foreach ($roles as $role) { |
|
| 45 | + if ($role['role_id'] == $user->user_role_id) |
|
| 46 | + $selected = 'selected = "selected"'; |
|
| 47 | + else |
|
| 48 | + $selected = ''; |
|
| 49 | + echo "<option {$selected} value = '{$role['role_id']}'>{$role['role_name']}</option>"; |
|
| 50 | + } |
|
| 51 | + ?> |
|
| 52 | 52 | </select> |
| 53 | 53 | </div> |
| 54 | 54 | </div> |
@@ -167,14 +167,14 @@ |
||
| 167 | 167 | <h5 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h5> |
| 168 | 168 | <ul> |
| 169 | 169 | <?php |
| 170 | - foreach ($condition->items as $item) { |
|
| 171 | - $itemComplete = $item->checkComplete($userId); |
|
| 172 | - switch ($item->type) { |
|
| 173 | - case 'event': |
|
| 170 | + foreach ($condition->items as $item) { |
|
| 171 | + $itemComplete = $item->checkComplete($userId); |
|
| 172 | + switch ($item->type) { |
|
| 173 | + case 'event': |
|
| 174 | 174 | $name = \Events\Event::get($item->value, 'event')->name(); |
| 175 | - break; |
|
| 176 | - } |
|
| 177 | - ?> |
|
| 175 | + break; |
|
| 176 | + } |
|
| 177 | + ?> |
|
| 178 | 178 | <li> |
| 179 | 179 | <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount($userId); ?></b>/<?= $item->count; ?> <br /> |
| 180 | 180 | </li> |