show.php
3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\ActiveForm;
$this->title = 'Заказ №'.$model->id;
$this->params['breadcrumbs'][] = $this->title;
?>
<h1>Заказ №<?=$model->id?></h1>
<?if(!empty($_GET['success'])):?>
<div class="alert alert-success">
Заказ успешно сохранен!
</div>
<?endif;?>
<?php $form = ActiveForm::begin([
'id' => 'reg-form',
'options' => ['class' => 'form-vertical','enctype' => 'multipart/form-data'],
'fieldConfig' => [
//'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
//'labelOptions' => ['class' => 'col-lg-2 control-label'],
],
]); ?>
<?= $form->field($model, 'surname') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'patronymic') ?>
<?= $form->field($model, 'phone') ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'adress') ?>
<?= $form->field($model, 'body')->textArea(['rows' => '6']) ?>
<?= $form->field($model, 'total') ?>
<?=$form->field($model, 'status')->dropDownList(['Нет'=>'Нет','Обработан'=>'Обработан','На комплектации'=>'На комплектации','Укомплектован'=>'Укомплектован','Доставка'=>'Доставка','Выполнен'=>'Выполнен','Резерв оплачен'=>'Резерв оплачен','Резерв неоплачен'=>'Резерв неоплачен'],['prompt'=>'...']); ?>
<?= $form->field($model, 'comment')->textArea(['rows' => '6']) ?>
<div class="form-group">
<?= Html::submitButton(' Сохранить ', ['class' => 'btn btn-primary btn-lg btn-block', 'name' => 'login-button']) ?>
</div>
<?php ActiveForm::end(); ?>
<hr />
<?= Html::a('Добавить товар', ['/admin/orders/add','order_id'=>$model->id], ['class'=>'btn btn-success']) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id',
'value'=>'id',
'contentOptions'=>['style'=>'width: 70px;']
],
[
'attribute' => 'art',
'value'=>'art',
'contentOptions'=>['style'=>'width: 50px;']
],
[
'attribute' => 'product_name',
'value'=>'product_name',
//'contentOptions'=>['style'=>'max-width: 300px;']
],
[
'attribute' => 'name',
'value'=>'name',
//'contentOptions'=>['style'=>'max-width: 300px;']
],
[
'attribute' => 'cost',
'value'=>'cost',
'contentOptions'=>['style'=>'width: 100px;']
],
[
'attribute' => 'count',
'value'=>'count',
'contentOptions'=>['style'=>'width: 30px;']
],
[
'attribute' => 'sum_cost',
'value'=>'sum_cost',
'contentOptions'=>['style'=>'width: 100px;']
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{delete}',
'contentOptions'=>['style'=>'width: 20px;'],
'buttons' => [
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/admin/orders/delete_product','id'=>$model->id,'order_id'=>$_GET['id']],
[
'title' => "Удалить",'data-confirm'=>'Удалить?',
]);
}
],
],
],
]) ?>