view.php
6.67 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
<?php
/**
* @var \common\models\Service $model;
* @var \common\models\Service[] $others;
* @var \artbox\core\forms\Module $moduleComment;
* @var \artbox\core\forms\Module $moduleQuestion;
* @var \yii\web\View $this
* @var \artbox\core\components\SeoComponent $seo;
*/
use artbox\core\helpers\Url;
use common\models\Service;
$seo = \Yii::$app->get('seo');
$this->params['entity'] = Service::className();
$this->params['entity_id'] = $model->id;
$moduleComment = \Yii::$app->getModule('comments');
$moduleComment->inputOptions = array_merge($moduleComment->inputOptions, ['entity_id' => [
'type' => 'hiddenInput',
'options' => ['value' => $model->id],
],
'entity' => [
'type' => 'hiddenInput',
'options' => ['value' => Service::className()],
]]);
$moduleQuestion = \Yii::$app->getModule('questions');
$moduleQuestion->inputOptions += ['service_id' => [
'type' => 'hiddenInput',
'options' => ['value' => $model->id],
]];
if ($model->parent !== null){
if ($model->parent->parent !== null){
$this->params['breadcrumbs'][] = [
'label' => $model->parent->parent->title,
'url' => Url::to(['alias' => $model->parent->parent->language->alias]),
];
}
$this->params['breadcrumbs'][] = [
'label' => $model->parent->title,
'url' => Url::to(['alias' => $model->parent->language->alias]),
];
}
$this->params[ 'breadcrumbs' ][] = (!empty($seo->h1)) ? $seo->h1 :$model->title;
?>
<section class="section-service-page">
<div class="container">
<div class="row">
<div class="hidden-xs col-xs-12 col-sm-4 col-md-4 col-lg-3">
<div class="style service-list-wr">
<ul>
<?php foreach ($others as $service){?>
<li class="<?=(($model->id == $service->id and $model->level != 2) ? 'active' : '')?>
<?=(($model->parent_id == $service->id and $model->level == 2) ? 'active2' : '')?>
<?=(!empty($service->services) ? 'has-list' : '')?>">
<a href="<?=Url::to(['alias' => $service->language->alias])?>"><?=$service->title?></a>
<?php
if (($model->id == $service->id or $model->parent_id == $service->id) and !empty($service->services)) {?>
<ul>
<?php foreach ($service->services as $item){?>
<li class="<?=($model->id == $item->id ? 'active' : '')?>"><a href="<?=Url::to(['alias' => $item->language->alias])?>"><?=$item->title?></a></li>
<?php }?>
</ul>
<?php } ?>
</li>
<?php }?>
</ul>
</div>
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-9">
<div class="row">
<div class="col-xs-12">
<h1 class="title-pages"><?=(!empty($seo->h1)) ? $seo->h1 :$model->title?></h1>
</div>
</div>
<div class="row">
<div class="col-xs-12 service-text-table-wrapp editor-text">
<?=$model->body?>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="section-comments-answers fix-map-margin">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4 fix-form-c-a-wr">
<div class="title-c-a"><?=\Yii::t('app','Callbacks');?></div>
<div class="service-comments-wr style">
<?php foreach ($model->comments as $comment){?>
<div class="service-comments style">
<div class="style comments-h-autor"><?=$comment->name?></div>
<div class="style comments-h-text"><?=$comment->comment?></div>
<div class="style comments-h-date"><?=date('d.m.Y', $comment->created_at)?></div>
</div>
<?php }?>
</div>
<div class="style service-links-c-a"><a href="<?=Url::to(['site/comments'])?>">
<?=\Yii::t('app','All callbacks');?></a></div>
<div class="style service-c-a-btns">
<span class="btn_"><?=\Yii::t('app','Give feedback');?></span>
</div>
<div class="style hidden-form-c-a-wr hidden">
<div class="style hidden-form-c-a">
<div class="title-forms-c-a style"><?=\Yii::t('app','Give feedback');?></div>
<?php $moduleComment->renderForm($this)?>
</div>
</div>
</div>
<div class="hidden-xs hidden-sm col-sm-1"></div>
<div class="col-xs-12 col-sm-8 col-md-7 service-ansver-mob-line">
<div class="title-c-a"><?=\Yii::t('app','Quest/Answer');?></div>
<?php foreach ($model->questions as $question){?>
<div class="service-comments-wr style">
<div class="service-comments style service-ansvers">
<div class="style comments-h-autor"><?=$question->name?></div>
<div class="style comments-h-text"><?=$question->question?> </div>
<div class="service-ansvers-text-wr style">
<?php if ($question->doctor !== null){?>
<div class="service-ansvers-title"><?=$question->doctor->position?><span><?=$question->doctor->name?></span></div>
<?php }?>
<div class="service-ansvers-txt">
<?=$question->answer?>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="style service-links-c-a service-links-a">
<a href="<?=Url::to(['site/questions'])?>"><?=\Yii::t('app','All questions');?></a></div>
<div class="style service-c-a-btns">
<span class="btn_"><?=\Yii::t('app','Asc question');?></span>
</div>
<div class="style hidden-form-c-a-wr hidden">
<div class="style hidden-form-c-a">
<div class="title-forms-c-a style"><?=\Yii::t('app','Asc question');?></div>
<?php $moduleQuestion->renderForm($this)?>
</div>
</div>
</div>
</div>
</div>
</section>