show.php
5.82 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Delivery;
use yii\bootstrap\Modal;
use kartik\date\DatePicker;
// $this->title = 'Заказ №'.$model->id;
// $this->params['breadcrumbs'][] = $this->title;
?>
<div class="show_style">
<?php if(!empty($_GET['success'])):?>
<div class="alert alert-success">
Заказ успешно сохранен!
</div>
<?php endif;?>
<?php $form = ActiveForm::begin([
'id' => 'reg-form',
'layout' => 'horizontal',
'options' => ['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'],
],
'action' => [
'orders/show',
'id' => $model->id
]
]); ?>
<div class="row">
<div class="col-sm-6">
<div class="form-group .new_styles_ddd">
<h5>Заказ №<?=$model->id?></h5>
<label class="control-label col-sm-3">Дата</label>
<?=$model->date_time?>
</div>
<?= $form->field($model, 'date_dedline')
->widget(DatePicker::className(), [
'pluginOptions' => [
'format' => 'dd-M-yyyy',
'todayHighlight' => true
]]) ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'phone') ?>
<?= $form->field($model, 'phone2') ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'numbercard') ?>
<?= $form->field($model, 'body')->textArea(['rows' => '3']) ?>
</div>
<div class="col-sm-6">
<?= $form->field($model, 'delivery')->dropDownList(ArrayHelper::map(Delivery::find()->asArray()->all(), 'id', 'title')) ?>
<?= $form->field($model, 'declaration') ?>
<?= $form->field($model, 'stock') ?>
<?= $form->field($model, 'consignment') ?>
<?=$form->field($model, 'payment')->dropDownList(['Оплатить наличными'=>'Оплатить наличными','Оплатить на карту Приват Банка'=>'Оплатить на карту Приват Банка','Оплатить по безналичному расчету'=>'Оплатить по безналичному расчету','Оплатить Правекс-телеграф'=>'Оплатить Правекс-телеграф','Наложенным платежом'=>'Наложенным платежом'],['prompt'=>'...']); ?>
<?= $form->field($model, 'insurance') ?>
<?= $form->field($model, 'amount_imposed') ?>
<?= $form->field($model, 'shipping_by') ?>
<?= $form->field($model, 'city') ?>
<?= $form->field($model, 'adress') ?>
<?= $form->field($model, 'total') ?>
<?=$form->field($model, 'status')->dropDownList(['Нет'=>'Нет','Обработан'=>'Обработан','На комплектации'=>'На комплектации','Укомплектован'=>'Укомплектован','Доставка'=>'Доставка','Выполнен'=>'Выполнен','Резерв оплачен'=>'Резерв оплачен','Резерв неоплачен'=>'Резерв неоплачен'],['prompt'=>'...']); ?>
<?= $form->field($model, 'comment')->textArea(['rows' => '3']) ?>
</div></div><div class="both"></div>
<hr />
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id',
'value'=>'id',
'contentOptions'=>['style'=>'width: 70px;']
],
[
'attribute' => 'sku',
'value'=>'sku',
'contentOptions'=>['style'=>'width: 50px;']
],
[
'attribute' => 'product_name',
'value'=>'product_name',
'contentOptions'=>['style'=>'max-width: 300px;']
],
// [
// 'attribute' => 'size',
// 'value'=>'mod.size',
// 'contentOptions'=>['style'=>'width: 100px;']
// ],
// [
// 'attribute' => 'size',
// 'value'=>'mod.color',
// 'contentOptions'=>['style'=>'width: 100px;']
// ],
[
'attribute' => 'price',
'value'=>'price',
'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'=>'Удалить?',
]);
}
],
],
],
]) ?>
<div class="form-group">
<?= Html::submitButton(' Сохранить ', ['class' => 'btn btn-primary btn-lg btn-block', 'name' => 'login-button']) ?>
</div>
<?php ActiveForm::end(); ?>
<div class="row">
<div class="col-sm-6">
<h1>Добавить товар в заказ</h1>
<?php $form = ActiveForm::begin([
'enableClientScript' => false,
'id' => 'add_mod',
'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_orderproducts, 'sku') ?>
<?= $form->field($model_orderproducts, 'count') ?>
<?= $form->field($model_orderproducts, 'order_id')->hiddenInput(['value'=>$model->id])->label(false); ?>
<div class="form-group">
<?= Html::submitButton(' Добавить товар ', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div></div>
</div>