diff --git a/src/controllers/DomainController.php b/src/controllers/DomainController.php index 3db0e441..57053846 100644 --- a/src/controllers/DomainController.php +++ b/src/controllers/DomainController.php @@ -500,12 +500,18 @@ public function actionCheckDomain() break; } } - $results[] = new Domain([ - 'domain' => $domain, +// $results[] = new Domain([ +// 'domain' => $domain, +// 'is_available' => (bool) 1, +// 'zone' => substr($domain, strpos($domain, '.') + 1), +// 'resource' => $tariff, +// ]); + $results[] = [ + 'domain' => $model->domain, 'is_available' => (bool) 1, - 'zone' => substr($domain, strpos($domain, '.') + 1), + 'zone' => substr($domain, strrpos($domain, '.') + 1), 'resource' => $tariff, - ]); + ]; } $domainCheckDataProvider->setModels($results); } @@ -514,6 +520,7 @@ public function actionCheckDomain() 'model' => $model, 'dropDownZonesOptions' => $dropDownZones, 'domainCheckDataProvider' => $domainCheckDataProvider, + 'results' => $results, ]); } diff --git a/src/views/domain/checkDomain.php b/src/views/domain/checkDomain.php index 3dab8b25..c4aec91e 100644 --- a/src/views/domain/checkDomain.php +++ b/src/views/domain/checkDomain.php @@ -115,88 +115,146 @@ function Plugin(element, options) { JS ); ?> -
-
-

-
- -
- 'check-domain', - 'method' => 'get', - 'options' => [ - 'data-pjax' => false, - ], - 'fieldConfig' => [ - 'template' => "{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}", - ], +
+
+
+ +
+ 'check-domain', + 'method' => 'get', + 'options' => [ + 'data-pjax' => false, + ], + 'fieldConfig' => [ + 'template' => "{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}", + ], // 'enableAjaxValidation' => true, // 'validationUrl' => Url::toRoute(['validate-form', 'scenario' => $model->scenario]), - ]) ?> -
-
-
- field($model, 'domain')->textInput(['placeholder' => Yii::t('app', 'Domain search...'), 'class' => 'form-control input-lg']); ?> + ]) ?> +
+
+
+ field($model, 'domain')->textInput(['placeholder' => Yii::t('app', 'Domain search...'), 'class' => 'form-control input-lg']); ?> +
+
+ +
+
+ field($model, 'zone')->dropDownList($dropDownZonesOptions, ['class' => 'form-control input-lg']); ?> +
+
+ +
'btn btn-default btn-lg btn-block']); ?>
+
+ +
- -
-
- field($model, 'zone')->dropDownList($dropDownZonesOptions, ['class' => 'form-control input-lg']); ?> + +
+ +
+
+
+
+
+ +
+
+ +
+
+ + . +
+
+ + 34.00€ + /year + + is_available === false) : ?> + ', ['#'], ['class' => 'btn btn-app']) ?> + + ' . Yii::t('app', 'Add to cart'), ['add-to-cart-registration', 'name' => $line['domain']], ['data-pjax' => 0, 'class' => 'btn btn-app']) ?> + +
+
+
+ $domainCheckDataProvider, +// 'layout' => "{items}\n{pager}", +// 'rowOptions' => function ($model, $key, $index, $grid) { +// return ['class' => 'check-item', 'data-domain' => $model->domain]; +// }, +// 'options' => [ +// 'class' => 'domainsCheck', +// ], +// 'columns' => [ +// 'domain', +// 'zone', +// [ +// 'attribute' => 'is_available', +// 'value' => function ($model) { +// return $model->is_available ? 'REG NOW!' : 'sorry bro :('; +// }, +// ], +// 'actions' => [ +// 'class' => 'yii\grid\ActionColumn', +// 'template' => '{buy}', +// 'header' => Yii::t('app', 'Action'), +// 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle;'], +// 'buttons' => [ +// 'buy' => function ($url, $model, $key) { +// if ($model->is_available === false) { +// return Html::tag('sapn', Yii::t('app', 'Is not free!')); +// } else { +// return Html::a(Yii::t('app', 'Buy domain'), ['add-to-cart-registration', 'name' => $model->domain], ['data-pjax' => 0]); +// } +// }, +// ], +// ], +// ], +// ]); + ?>
- -
'btn btn-default btn-lg btn-block']); ?>
- +
- - +
- -
+
-
-
-

-
- -
- $domainCheckDataProvider, - 'layout' => "{items}\n{pager}", - 'rowOptions' => function ($model, $key, $index, $grid) { - return ['class' => 'check-item', 'data-domain' => $model->domain]; - }, - 'options' => [ - 'class' => 'domainsCheck', - ], - 'columns' => [ - 'domain', - 'zone', - [ - 'attribute' => 'is_available', - 'value' => function ($model) { - return $model->is_available ? 'REG NOW!' : 'sorry bro :('; - }, - ], - 'actions' => [ - 'class' => 'yii\grid\ActionColumn', - 'template' => '{buy}', - 'header' => Yii::t('app', 'Action'), - 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle;'], - 'buttons' => [ - 'buy' => function ($url, $model, $key) { - if ($model->is_available === false) { - return Html::tag('sapn', Yii::t('app', 'Is not free!')); - } else { - return Html::a(Yii::t('app', 'Buy domain'), ['add-to-cart-registration', 'name' => $model->domain], ['data-pjax' => 0]); - } - }, - ], - ], - ], - ]); ?> -
- -
\ No newline at end of file + \ No newline at end of file