/**
  * Updates an existing Gallery model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     if (CatalogProducts::findOne($model->table_id)->createdby == \Yii::$app->user->getId()) {
         if ($model->load(Yii::$app->request->post())) {
             if ($model->save()) {
                 $this->actionUpload($model);
                 return $this->redirect(['index', 'table_id' => $model->table_id]);
             } else {
                 return $this->render('update', ['model' => $model, 'table_id' => $model->table_id]);
             }
         } else {
             return $this->render('update', ['model' => $model, 'table_id' => $model->table_id]);
         }
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #2
0
            $count = 0;
        }
        ?>
                                                    <li><?php 
        echo Html::a($element_name, ['/catalog/site/index', 'parent' => $element_id]);
        ?>
</li>
                                            <?php 
    }
    ?>
                                        </ul>	
                                    </div>							
                                </div>
                                <div class="col1">
                                    <?php 
    echo Html::img(File::thumb(CatalogProducts::findOne($category_id)['image'], 300, 300));
    ?>
                                </div>
                            </div>
                        </div>
                    </li>
                    <?php 
}
?>
                </ul> 
            </div>
<!--            <div class="cart box_1">
                <a href="checkout.html">
                    <h3> <div class="total">
                            <span class="simpleCart_total"></span> (<span id="simpleCart_quantity" class="simpleCart_quantity"></span> items)</div>
                        <img src="images/cart.png" alt=""/></h3>
Beispiel #3
0
        <section class="products_container a_type_2 clearfix m_bottom_25">
            <?php 
    $parentid = 0;
    ?>
            <?php 
    foreach ($elements as $model) {
        ?>
            <?php 
        if ($parentid != $model->parent) {
            ?>
                <?php 
            $parentid = $model->parent;
            ?>
        </section>
                <h2><?php 
            echo CatalogProducts::findOne(['id' => $model->parent])->name;
            ?>
</h2>
                <hr class="m_bottom_10 divider_type_3">
        <section class="products_container a_type_2 clearfix m_bottom_25">
            <?php 
        }
        ?>
    
                <!--product item-->
                <div class="product_item w_xs_full">
                    <figure class="r_corners photoframe animate_ftb type_2 t_align_c tr_all_hover shadow relative">
                        <?php 
        echo Html::a(Html::img(Image::thumb($model->image, 242, 242), ['class' => 'tr_all_hover']), ['view-by-url', 'url' => $model->seo_url], ['class' => '_block relative pp_wrap m_bottom_15']);
        ?>
                        <figcaption>
Beispiel #4
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use common\modules\catalog\models\CatalogProducts;
use common\modules\filemanager\models\File;
$parentModel = CatalogProducts::findOne($model->parent);
$this->title = \Yii::$app->name . ' - ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => $parentModel->name, 'url' => ['index', 'parent' => $parentModel->id]];
$this->params['breadcrumbs'][] = $model->name;
?>

<div class="single">
    <div class="col-md-9 top-in-single">

            <div class="col-md-5 single-top">
                <?php 
echo Html::img(File::thumb($model->image, 255, 255), ['class' => 'img-responsive']);
?>
            </div>
            <div class="col-md-7 single-top-in">
                <div class="single-para">
                    <h4>
                        <?php 
echo $model->name;
?>
                    </h4>
                    <p>
                        <?php 
echo $model->introtext;
?>
Beispiel #5
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use common\modules\filemanager\models\File;
use common\modules\catalog\models\CatalogProducts;
$name = CatalogProducts::findOne(['id' => $parent])->name;
$this->title = \Yii::$app->name . ' - ' . $name;
$this->registerJs("\n\$('input').change(function () {\n//    alert(\$(this).val());\n\n\n});\n\n");
?>

<?php 
if (empty($elements)) {
    ?>
<div class="page_content_offset" style="padding-top:0px;">
    <div class="container">
        <h4>К сожалению, мы ничего не нашли :(</h4>
    </div>
</div>
<?php 
} else {
    ?>
<!--content-->
<div class="page_content_offset" style="padding-top:0px;">
    <div class="container">


        <hr class="m_bottom_10 divider_type_3">
        <div class="row clearfix m_bottom_15">
            <div class="col-lg-5 col-md-5 col-sm-4 col-xs-12 t_align_r t_xs_align_l">
Beispiel #6
0
<?php

use yii\helpers\Url;
use yii\widgets\LinkPager;
use common\modules\catalog\models\CatalogProducts;
$this->title = 'Отзывы';
$element = CatalogProducts::findOne($id);
if ($element->parent == 1) {
    $this->params['breadcrumbs'][] = ['label' => 'Каталог товаров', 'url' => ['/catalog/site/index-by-category', 'parent' => $element->parent, 'category' => $element->category]];
} else {
    $this->params['breadcrumbs'][] = ['label' => 'Каталог услуг', 'url' => ['/catalog/site/index-by-category', 'parent' => $element->parent, 'category' => $element->category]];
}
$this->params['breadcrumbs'][] = ['label' => $element->title, 'url' => ['/catalog/site/view', 'id' => $id]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="reviews">

    <div class="title"><?php 
echo $this->title;
?>
</div>

    <div class="reviews__add"><span class="reviews__add-icon"></span><a href="<?php 
echo Url::to(['/comments/site/create', 'table_id' => $id, 'table_name' => 'catalog']);
?>
" class="dashed">Добавить отзыв</a></div>

    <div class="review-list">
        <?php 
echo LinkPager::widget(['pagination' => $pagination]);
?>
 private function findFullName($model, $name)
 {
     if ($model->parent != 0) {
         $parent = CatalogProducts::findOne($model->parent);
         $name = $this->findFullName($parent, $parent->name . ' > ' . $name);
     }
     return $name;
 }