Ejemplo n.º 1
0
 public function actionIndex()
 {
     $this->layout = '//layouts/admin';
     $this->pageTitle = 'Каталог';
     $this->breadcrumbs = array('Каталог');
     $model = new CatalogObjects('search');
     $model->unsetAttributes();
     if (isset($_REQUEST['CatalogObjects'])) {
         $model->attributes = $_REQUEST['CatalogObjects'];
     }
     $this->render('index', array('model' => $model));
 }
Ejemplo n.º 2
0
                                            <?php 
    }
}
?>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-8">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    Наименования в заказе
                                </div>
                                <div class="panel-body">
                                    <?php 
$objects = new CatalogObjects('search');
$objects->unsetAttributes();
if (isset($_GET['CatalogObjects'])) {
    $model->attributes = $_GET['CatalogObjects'];
}
$this->widget('CCustomGridView', array('id' => 'order-items-grid', 'dataProvider' => $objects->search(), 'filter' => $objects, 'columns' => array('id', array('name' => 'category_id', 'type' => 'raw', 'value' => 'CatalogCategories::model()->findByPk($data->category_id)->name'), 'name', 'price', array('class' => 'CCustomButtonColumn', 'template' => '{update}', 'buttons' => array('update' => array('url' => 'Support::doImplode(array($data->primaryKey, $data->name), "|")', 'label' => '<i class="fa fa-plus"></i>', 'options' => array('class' => 'btn btn-primary btn-circle append-order-item', 'title' => 'Добавить к заказу')))))));
?>
                                    <table class="table table-striped order-items-list" style="display:none;">
                                        <thead>
                                            <th style="width: 50%;">Название</th>
                                            <th>Количество</th>
                                            <th style="width: 100px;" class="text-center">Действие</th>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>