diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php
index ab45916..018923f 100755
--- a/frontend/controllers/SiteController.php
+++ b/frontend/controllers/SiteController.php
@@ -2,6 +2,7 @@
namespace frontend\controllers;
+use common\modules\product\models\Category;
use Yii;
use yii\web\Controller;
use common\models\Page;
@@ -51,6 +52,176 @@ class SiteController extends Controller
]);
}
+ public function actionPriceparam ()
+ {
+ if (! $catalog = Category::find ()
+ ->where (['translit' => $_GET['translit']])
+ ->with ('parent')
+ ->one ()
+ )
+ {
+ throw new HttpException(404, 'Данной странице не существует!');
+ }
+
+ //var_dump();die;
+
+ $products = Products::find ()->where (['catalog_id' => $catalog->id])->all();
+ if (isset($_GET['count'])){
+
+ print (count($products));die;
+
+ }
+//var_dump($products);die();
+ set_time_limit (0);
+ header ("Content-Type: text/xml");
+ print '';
+ print "";
+ print "" . date ("Y-m-d h:m") . "";
+ print "Rukzachok";
+ print "";
+ print "";
+ print "";
+
+ print "";
+ print "" . $catalog->id . "";
+ print "";
+ print "" . $catalog->name . "";
+ print "";
+
+
+ print "";
+ print "";
+ foreach ($products as $product)
+ {
+ $color = Mod::find()->where ('
+ (onstock_status_id > 0 OR is_always_active > 0)
+ AND cost > 0
+ AND status = 1
+ ')->where(['product_id' => $product->id])->all();
+
+ $brend = Brends::find()->where(['id' => $product->brend_id])->one();
+ //$brends = Brends::find()->orderBy('sort ASC')->all();
+
+ //var_dump($brend);die;
+
+ foreach($color as $v) {
+
+ $col = $v['color'];
+ $pr = $v['cost'];
+ $old_pr = $v['old_cost'];
+ print "- ";
+ print "" . htmlspecialchars ($v['id']) . "";
+ print "" . htmlspecialchars ($product->catalog_id) . "";
+ print "".$brend['name']."";
+ print "
" . htmlspecialchars ($v['art']) . "
";
+ print "" . htmlspecialchars (substr($catalog->name, 0,-2)) ." ";
+ print "" . htmlspecialchars ($product->name) ." ";
+ print "". $col . " ";
+ print "" . htmlspecialchars ($product->body_ru) . "";
+ print "http://rukzachok.com.ua/products/" . htmlspecialchars ($_GET['translit']) . "/" . htmlspecialchars ($product->translit). "";
+ print "http://rukzachok.com.ua/upload/mod/big/" . $v['image'] . "";
+ print "" . $pr . "";
+ print "" . $old_pr . "";
+ print "";
+ print "В наличии";
+ print "";
+ print " ";
+
+ }
+ }
+
+
+ print "";
+
+ print "";
+
+
+ }
+
+ public function actionPrice()
+ {
+
+ if (! $catalog = Category::find ()
+ ->where (['translit' => $_GET['translit']])
+ ->with ('parent')
+ ->one ()
+ )
+ {
+ throw new HttpException(404, 'Данной странице не существует!');
+ }
+
+
+
+ $products = Products::find ()->where (['catalog_id' => $catalog->id])->all();
+ if (isset($_GET['count'])){
+
+ print (count($products));die;
+
+ }
+//var_dump($products);die();
+ set_time_limit (0);
+ header ("Content-Type: text/xml");
+ print '';
+ print "";
+ print "" . date ("Y-m-d h:m") . "";
+ print "Rukzachok";
+ print "";
+ print "";
+ print "";
+
+ print "";
+ print "" . $catalog->id . "";
+ print "";
+ print "" . $catalog->name . "";
+ print "";
+
+ print "";
+ print "";
+ foreach ($products as $product)
+ {
+ $color = Mod::find()->where ('
+ (onstock_status_id > 0 OR is_always_active > 0)
+ AND cost > 0
+ AND status = 1
+ ')->where(['product_id' => $product->id])->all();
+
+ $brend = Brends::find()->where(['id' => $product->brend_id])->one();
+ //$brends = Brends::find()->orderBy('sort ASC')->all();
+
+ //var_dump($brend);die;
+
+ foreach($color as $v) {
+
+ $col = $v['color'];
+ $pr = $v['cost'];
+ $old_pr = $v['old_cost'];
+
+ print "- ";
+ print "" . htmlspecialchars ($v['id']) . "";
+ print "" . htmlspecialchars ($product->catalog_id) . "";
+ print "".$brend['name']."";
+ print "
" . htmlspecialchars ($v['art']) . "
";
+ print "" . htmlspecialchars ($product->name) ." ". $col . " ";
+ print "" . htmlspecialchars ($product->body_ru) . "";
+ print "http://rukzachok.com.ua/products/" . htmlspecialchars ($_GET['translit']) . "/" . htmlspecialchars ($product->translit) . "";
+ print "http://rukzachok.com.ua/upload/mod/big/" . $v['image'] . "";
+ print "" . $pr . "";
+ print "" . $old_pr . "";
+ print "";
+ print "В наличии";
+ print "";
+ print " ";
+
+ }
+ }
+
+
+ print "";
+
+ print "";
+
+
+ }
}
\ No newline at end of file
--
libgit2 0.21.4