Exemplo n.º 1
0
$this->title = 'Заказы';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Order', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'first_name', 'last_name', 'city', 'phone', ['label' => 'Продукты', 'format' => 'raw', 'value' => function ($model) {
    return Order::getOrderProducts($model);
}], ['attribute' => 'status', 'format' => 'raw', 'value' => function ($model) {
    return Order::getOrderStatesGoodly($model);
}], ['attribute' => 'total_price', 'format' => 'raw', 'value' => function ($model) {
    return $model->total_price . ' грн.';
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 2
0
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'first_name', 'last_name', 'city', 'phone', 'department', 'note', ['attribute' => 'status', 'format' => 'raw', 'value' => Order::getOrderStatesGoodly($model)], 'created_at', 'updated_at', 'created_at_date', 'updated_at_date']]);
?>
    
    <article>
        <h2>Товар</h2>
        <?php 
echo Order::getOrderProducts($model);
?>
    </article>
</div>