@@ -2,24 +2,24 @@ |
||
| 2 | 2 | <div class="col-md-4"> |
| 3 | 3 | <ul class="nav nav-pills nav-stacked"> |
| 4 | 4 | <?php |
| 5 | - $hiddenId = Tools::randomString(); |
|
| 6 | - foreach ($deliverys as $delivery) {
|
|
| 7 | - if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) {
|
|
| 8 | - $checked = 'checked'; |
|
| 9 | - } else {
|
|
| 10 | - $checked = ''; |
|
| 11 | - } |
|
| 12 | - echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | - echo $delivery->name; |
|
| 14 | - echo '</a></li>'; |
|
| 15 | - } |
|
| 16 | - $form->input('hidden', "delivery", '', [
|
|
| 17 | - 'value' => $cart->delivery_id, |
|
| 18 | - 'attributes' => [ |
|
| 19 | - 'id' => $hiddenId |
|
| 20 | - ], |
|
| 21 | - ]); |
|
| 22 | - ?> |
|
| 5 | + $hiddenId = Tools::randomString(); |
|
| 6 | + foreach ($deliverys as $delivery) {
|
|
| 7 | + if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) {
|
|
| 8 | + $checked = 'checked'; |
|
| 9 | + } else {
|
|
| 10 | + $checked = ''; |
|
| 11 | + } |
|
| 12 | + echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | + echo $delivery->name; |
|
| 14 | + echo '</a></li>'; |
|
| 15 | + } |
|
| 16 | + $form->input('hidden', "delivery", '', [
|
|
| 17 | + 'value' => $cart->delivery_id, |
|
| 18 | + 'attributes' => [ |
|
| 19 | + 'id' => $hiddenId |
|
| 20 | + ], |
|
| 21 | + ]); |
|
| 22 | + ?> |
|
| 23 | 23 | </ul> |
| 24 | 24 | </div> |
| 25 | 25 | <div class="col-md-8"> |
@@ -19,22 +19,22 @@ discard block |
||
| 19 | 19 | <div class="filter"> |
| 20 | 20 | <label><?= $option->name; ?></label> |
| 21 | 21 | <?php |
| 22 | - switch ($option->type) { |
|
| 23 | - case 'radio': |
|
| 22 | + switch ($option->type) { |
|
| 23 | + case 'radio': |
|
| 24 | 24 | foreach ($option->items as $item) { |
| 25 | - $this->widget('Ui\Form/' . $option->type, [ |
|
| 26 | - 'label' => $item->name, |
|
| 27 | - 'name' => "filters[options][{$option->id}]", |
|
| 28 | - !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false, |
|
| 29 | - 'options' => [ |
|
| 30 | - 'value' => $item->id, |
|
| 31 | - ] |
|
| 32 | - ]); |
|
| 33 | - } |
|
| 34 | - break; |
|
| 35 | - case 'select': |
|
| 25 | + $this->widget('Ui\Form/' . $option->type, [ |
|
| 26 | + 'label' => $item->name, |
|
| 27 | + 'name' => "filters[options][{$option->id}]", |
|
| 28 | + !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false, |
|
| 29 | + 'options' => [ |
|
| 30 | + 'value' => $item->id, |
|
| 31 | + ] |
|
| 32 | + ]); |
|
| 33 | + } |
|
| 34 | + break; |
|
| 35 | + case 'select': |
|
| 36 | 36 | foreach ($option->items as $item) { |
| 37 | - ?> |
|
| 37 | + ?> |
|
| 38 | 38 | <div class="radio"> |
| 39 | 39 | <label> |
| 40 | 40 | <input type="radio" name = 'filters[options][<?= $option->id; ?>]' value ="<?= $item->id; ?>" <?= !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : ''; ?>> |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | </label> |
| 43 | 43 | </div> |
| 44 | 44 | <?php |
| 45 | - } |
|
| 46 | - break; |
|
| 47 | - default: |
|
| 45 | + } |
|
| 46 | + break; |
|
| 47 | + default: |
|
| 48 | 48 | $this->widget('Ui\Form/' . $option->type, [ |
| 49 | - 'label' => $option->name, |
|
| 50 | - 'name' => "filters[options][{$option->id}]", |
|
| 51 | - 'options' => [ |
|
| 52 | - 'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '', |
|
| 53 | - ] |
|
| 54 | - ]); |
|
| 55 | - } |
|
| 56 | - ?> |
|
| 49 | + 'label' => $option->name, |
|
| 50 | + 'name' => "filters[options][{$option->id}]", |
|
| 51 | + 'options' => [ |
|
| 52 | + 'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '', |
|
| 53 | + ] |
|
| 54 | + ]); |
|
| 55 | + } |
|
| 56 | + ?> |
|
| 57 | 57 | </div> |
| 58 | 58 | <?php |
| 59 | 59 | } |
@@ -5,15 +5,15 @@ |
||
| 5 | 5 | <h3>Вход</h3> |
| 6 | 6 | <div class="form-group"> |
| 7 | 7 | <?php |
| 8 | - $socials = Users\Social::getList(['where' => ['active', 1]]); |
|
| 9 | - if ($socials) { |
|
| 10 | - echo 'Войти через: '; |
|
| 11 | - foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
| 12 | - $text = $social->image ? '<img src ="' . Statics::file($social->image->path, '25x25', 'q') . '">' : $social->name(); |
|
| 13 | - echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> "; |
|
| 14 | - } |
|
| 15 | - } |
|
| 16 | - ?> |
|
| 8 | + $socials = Users\Social::getList(['where' => ['active', 1]]); |
|
| 9 | + if ($socials) { |
|
| 10 | + echo 'Войти через: '; |
|
| 11 | + foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
| 12 | + $text = $social->image ? '<img src ="' . Statics::file($social->image->path, '25x25', 'q') . '">' : $social->name(); |
|
| 13 | + echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> "; |
|
| 14 | + } |
|
| 15 | + } |
|
| 16 | + ?> |
|
| 17 | 17 | </div> |
| 18 | 18 | <form action = '' method = 'POST' > |
| 19 | 19 | <div class ='row'> |
@@ -9,33 +9,33 @@ |
||
| 9 | 9 | ?> |
| 10 | 10 | <div id ='<?= $id; ?>' class="uiActiveForm" data-modelname="<?= $activeForm->modelName; ?>" data-formname="<?= $activeForm->formName; ?>" data-inputs='<?= json_encode($formInputs); ?>'> |
| 11 | 11 | <?php |
| 12 | - $form->action = $activeForm->action; |
|
| 13 | - $form->begin($activeForm->header, ['onsubmit' => $ajax ? 'inji.Ui.forms.submitAjax(this);return false;' : ''], ['activeForm' => $activeForm]); |
|
| 12 | + $form->action = $activeForm->action; |
|
| 13 | + $form->begin($activeForm->header, ['onsubmit' => $ajax ? 'inji.Ui.forms.submitAjax(this);return false;' : ''], ['activeForm' => $activeForm]); |
|
| 14 | 14 | |
| 15 | - if (empty($activeForm->form['noMapCell'])) { |
|
| 16 | - foreach ($activeForm->form['map'] as $row) { |
|
| 17 | - $colSize = 12 / count($row); |
|
| 18 | - echo "<div class ='row'>"; |
|
| 19 | - foreach ($row as $col) { |
|
| 20 | - echo "<div class = 'col-sm-{$colSize}'>"; |
|
| 21 | - if ($col) { |
|
| 22 | - $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params); |
|
| 23 | - } |
|
| 24 | - echo '</div>'; |
|
| 25 | - } |
|
| 26 | - echo '</div>'; |
|
| 27 | - } |
|
| 28 | - } else { |
|
| 29 | - foreach ($activeForm->form['map'] as $row) { |
|
| 30 | - foreach ($row as $col) { |
|
| 31 | - if ($col) { |
|
| 32 | - $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params); |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - } |
|
| 37 | - $form->end($activeForm->model ? ($activeForm->model->pk() ? 'Сохранить' : 'Создать') : 'Отправить', [], ['activeForm' => $activeForm]); |
|
| 38 | - ?> |
|
| 15 | + if (empty($activeForm->form['noMapCell'])) { |
|
| 16 | + foreach ($activeForm->form['map'] as $row) { |
|
| 17 | + $colSize = 12 / count($row); |
|
| 18 | + echo "<div class ='row'>"; |
|
| 19 | + foreach ($row as $col) { |
|
| 20 | + echo "<div class = 'col-sm-{$colSize}'>"; |
|
| 21 | + if ($col) { |
|
| 22 | + $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params); |
|
| 23 | + } |
|
| 24 | + echo '</div>'; |
|
| 25 | + } |
|
| 26 | + echo '</div>'; |
|
| 27 | + } |
|
| 28 | + } else { |
|
| 29 | + foreach ($activeForm->form['map'] as $row) { |
|
| 30 | + foreach ($row as $col) { |
|
| 31 | + if ($col) { |
|
| 32 | + $activeForm->drawCol($col, $activeForm->inputs[$col], $form, $params); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | + $form->end($activeForm->model ? ($activeForm->model->pk() ? 'Сохранить' : 'Создать') : 'Отправить', [], ['activeForm' => $activeForm]); |
|
| 38 | + ?> |
|
| 39 | 39 | </div> |
| 40 | 40 | <script> |
| 41 | 41 | inji.onLoad(function () { |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | } |
| 9 | 9 | ?>> |
| 10 | 10 | <?php |
| 11 | - } |
|
| 12 | - ?> |
|
| 11 | + } |
|
| 12 | + ?> |
|
| 13 | 13 | <?= !empty($header) ? "<h1>{$header}</h1>" : ''; ?> |
| 14 | 14 | |
| 15 | 15 | \ No newline at end of file |
@@ -5,10 +5,10 @@ |
||
| 5 | 5 | <div class="form-group"> |
| 6 | 6 | <button class ='btn btn-primary' |
| 7 | 7 | <?php |
| 8 | - foreach ($attributs as $attribute => $value) { |
|
| 9 | - echo " {$attribute} = '{$value}' "; |
|
| 10 | - } |
|
| 11 | - ?> |
|
| 8 | + foreach ($attributs as $attribute => $value) { |
|
| 9 | + echo " {$attribute} = '{$value}' "; |
|
| 10 | + } |
|
| 11 | + ?> |
|
| 12 | 12 | ><?= $btnText; ?></button> |
| 13 | 13 | </div> |
| 14 | 14 | <?php |