index.php
3.48 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
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use kartik\date\DatePicker;
use \yii\widgets\Pjax;
use \yii\bootstrap\Modal;
/* @var $this yii\web\View */
/* @var $searchModel common\models\CartBillsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Заказы');
$this->params['breadcrumbs'][] = $this->title;
$safe_bill_img0 = '/storage/checkbox0.gif';
$safe_bill_img1 = '/storage/checkbox1.gif';
\backend\assets\CartAsset::register($this);
Pjax::begin(['id' => 'gridViewContent']);
?>
<div class="cart-bills-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
['content' => function ($model) {
$url = \yii\helpers\Url::to(['view', 'id' => $model->id]);
return Html::a('<span class="glyphicon glyphicon-eye-open"> </span>', '#', [
'class' => 'cartModalViewButton',
'value' => $url,
]);
},
],
'id',
'account_id',
['label' =>'Информация',
'format' => 'raw',
'value' =>function( $model ) use ($safe_bill_img0, $safe_bill_img1) {
$info = '<b> Код 1С:</b>' . ' ' . $model->scode . '<br>';
$info .= '<b> Имя:</b>' . ' ' .$model->name . '<br>';
$info .= '<b> Тел.:</b>' . ' ' .$model->phone . '<br>';
$info .= '<b> Email:</b>' . ' ' .$model->email . '<br>';
$info .= '<b> Доставка:</b>' . ' ' .$model->delivery . '<br>';
$info .= '<b> Комментарий:</b>' . ' ' .$model->message . '<br>';
$info .= '<b> Страховка:</b>';
if ($model->safe_bill == '1') {
$info .= " <img src=$safe_bill_img1>";
}
else {
$info .= " <img src=$safe_bill_img0>";
}
return $info;
},
],
'sum',
[
'label' =>'Статус',
'attribute' => 'status',
'filter' => \yii\helpers\ArrayHelper::map( \common\models\DicStatuses::find()->where(['active' =>1])->all(), 'id','name' ),
],
'manager_name',
[
'label' =>'Дата',
'value' =>function ($data) {
return date('Y-m-d', $data->dt);
},
'attribute' => 'dt',
'filter' => DatePicker::widget([
'model' =>$searchModel,
'language' =>'ru',
'size' =>'xs',
'separator' =>'по',
'attribute' => 'dt',
'type' => DatePicker::TYPE_RANGE,
'attribute2' => 'date_to',
]),
],
],
]); ?>
<?php
// сюда будем всавлять контент модального окна
Modal::begin([
// 'header'=>'<h4>Прайс</h4>',
'id' => 'modal',
'size' => 'modal-lg',
]);
echo "<div class='modalContent'></div>";
Modal::end();
Pjax::end();
?>
</div>