echo 'selected = "selected"'; } } ?> value="6024" data-id="10063" data-root="10063">Мотоциклы</option> <option <?php if (isset($this->params['myMod'][0]['queryCategory'][0])) { if (EbayCategory::findOne(['category_id' => $this->params['myMod'][0]['queryCategory'][0]])->category_root_parent == 100448) { echo 'selected = "selected"'; } } ?> value="42595" data-id="100448" data-root="100448">Снегоходы</option> <option <?php if (isset($this->params['myMod'][0]['queryCategory'][0])) { if (EbayCategory::findOne(['category_id' => $this->params['myMod'][0]['queryCategory'][0]])->category_root_parent == 43962) { echo 'selected = "selected"'; } } ?> value="6723" data-id="43962" data-root="43962">Квадроциклы</option> </select> <select class="form-control input-sm filter_brands"> <option value="null">Выберите марку</option> <?php // автомобили $modelArray = \common\models\EbayCategory::find()->where(['category_parent_id' => 6001])->asArray()->all(); $modelCarArray = array(); foreach ($modelArray as $value) {
private function addCatsToDB($cats, $rootParent) { foreach ($cats['CategoryArray']['Category'] as $row) { $ebay_cat = EbayCategory::findOne(['category_id' => $row['CategoryID']]); if (!empty($ebay_cat->category_id)) { continue; } $ebaycategory = new EbayCategory(); $ebaycategory->category_id = $row['CategoryID']; $ebaycategory->category_parent_id = $row['CategoryParentID'][0]; $ebaycategory->category_level = $row['CategoryLevel']; $ebaycategory->category_name = $row['CategoryName']; $ebaycategory->category_root_parent = $rootParent; $ebaycategory->save(); } }
use yii\helpers\Url; $this->title = 'BayEbay - Каталог'; $this->params['myMod'][] = $model; ?> <div class="row"> <?php if ($result !== false) { foreach ($result as $value1) { if (!isset($value1['galleryURL'])) { $value1['galleryURL'] = "imgs/image-not-found.jpg"; } echo "\n <div class=\"col-md-4\" style=\"height:400px;\">\n <div class=\"panel panel-default item_box\">\n <table class=\"table table-striped\">\n <tr>\n <td class=\"item_title\" style=\"height:80px;\"><h5 class=\"\"><a href=\"" . Url::to(['site/single', 'ebayitemid' => $value1['ebay_item_id']]) . "\" >" . $value1['title'] . "</a></h5></td>\n </tr>\n <tr>\n <td class=\"item_img\" align=\"center\"><img src=\"" . $value1['galleryURL'] . "\" class=\"img-responsive\" style=\"height:220px; width:100%;\" alt=\"" . $value1['title'] . "\"></td>\n </tr>\n <tr class=\"\">\n <td class=\"\">\n\n <span class=\"glyphicon glyphicon-rub btn-sm\"></span><span class=\"item_price\">" . $value1['price_shipping_sum'] . "</span>\n <button class=\"btn btn-default btn-sm pull-right addToCart\" data-id=\"" . $value1['ebay_item_id'] . "\">Купить сейчас <span class=\"glyphicon glyphicon-shopping-cart\" aria-hidden=\"true\"></span>\n </td>\n </tr>\n </table>\n </div>\n </div>\n "; } } elseif (isset($model->emptyResponse)) { if ($model->emptyResponse) { $ebay_cat = EbayCategory::findOne(['category_id' => $model->queryCategory]); echo '<div class="col-md-4">К сожалению, по вашему запросу <b>"' . $model->queryText . '"</b> в категории <b>"' . $ebay_cat->category_name . '"</b> ничего не найдено... Попробуйте изменить параметры поиска.</div>'; } } ?> </div> <?php if (!$model == false) { $modelPageCount = $model->pageCount; $pageOut = ""; $pageActive = ""; $pageStart = (int) $model->queryPage - 5; if ($pageStart <= 0) { $pageStart = 1; }