Exemplo n.º 1
0
if (empty($session->get('creatingOrder')) || $session->get('creatingOrder') == 0) {
    ?>
            <?php 
    echo Html::a('Создать заказ', ['create-order'], ['class' => 'btn btn-success']);
    ?>
        <?php 
}
?>
    </p>
    
    <p>
        <?php 
$form = ActiveForm::begin();
?>
        <?php 
echo $form->field($model, 'updated_at')->label('Удалить из истории заявки ранее чем')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd 23:59:59', 'options' => ['class' => 'form-control', 'style' => 'width: 300px; margin-left: 10px;', 'placeholder' => 'Дата']]);
?>
        <?php 
echo Html::submitButton('Удалить', ['class' => 'btn btn-success']);
?>
        <?php 
ActiveForm::end();
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'updated_at:datetime', ['class' => DataColumn::className(), 'label' => 'Товаров', 'value' => 'countProducts'], ['label' => 'Cумма (руб.)', 'attribute' => 'totalPriceForOrder', 'format' => 'text'], ['attribute' => 'status', 'value' => 'statusName', 'filter' => Orders::getStatusArray()], 'count_repeat', ['class' => ActionHistoryColumn::className()]]]);
?>

</div>
Exemplo n.º 2
0
use yii\grid\DataColumn;
use app\modules\main\models\Orders;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\main\models\OrdersSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $user app\modules\user\models\User */
$this->title = 'История заказов агента ' . $user->username . '';
$this->params['breadcrumbs'][] = $this->title;
$this->params['menu'] = 6;
$session = Yii::$app->session;
?>
<div class="orders-index">

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'updated_at', ['class' => DataColumn::className(), 'label' => 'Товаров', 'value' => 'countProducts'], ['label' => 'Cумма', 'attribute' => 'totalPriceForOrder'], ['attribute' => 'status', 'value' => 'statusName', 'filter' => Orders::getStatusArray()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {confirmOrder}', 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-list-alt"></span>', ['/main/orderedproduct/confirm-checkout-by-admin', 'id' => $model->id], ['title' => 'Товары в заказе']);
}, 'confirmOrder' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-circle-arrow-up"></span>', ['status-confirm', 'id' => $model->id], ['title' => 'Подтвердить заказ', 'data' => ['method' => 'post']]);
}]]]]);
?>

</div>