51e0a262
Yarik
test
|
1
|
<?php
|
b2743529
Виталий
tokar commit
|
2
3
4
5
6
7
8
|
/**
* @var Job[] $job
*/
use common\models\Job;
use yii\helpers\Html;
use yii\jui\DatePicker;
use yii\widgets\ActiveForm;
|
3272f030
Administrator
Merge remote-trac...
|
9
|
//HUUIISAODASIDSIA
|
b2743529
Виталий
tokar commit
|
10
11
|
$this->title = 'Трудовой стаж';
$this->params['breadcrumbs'][] = $this->title;
|
51e0a262
Yarik
test
|
12
|
?>
|
b2743529
Виталий
tokar commit
|
13
|
<div class="login-left-column-title"><?= $this->title ?></div>
|
51e0a262
Yarik
test
|
14
|
<?php
|
b2743529
Виталий
tokar commit
|
15
16
|
$form = ActiveForm::begin ();
$current = array_shift ($job);
|
51e0a262
Yarik
test
|
17
|
?>
|
b2743529
Виталий
tokar commit
|
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
|
<div class="current_job_container">
<div class="login-left-column-title-two style">Текущее место работы:</div>
<div class="current_job_inputs">
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]name')
->label ('Название')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]link')
->label ('Ссылка на компанию на сайте МФП')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]position')
->label ('Должность')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
|
ccab742d
Виталий
tokar commit
|
50
|
<?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']])
|
b2743529
Виталий
tokar commit
|
51
|
->label ('Дата начала работы')
|
ccab742d
Виталий
tokar commit
|
52
|
->widget (DatePicker::className (), ['options' => ['class' => 'testclass'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]);
|
b2743529
Виталий
tokar commit
|
53
54
|
?>
</div>
|
e9013fc3
Yarik
test
|
55
|
</div>
|
b2743529
Виталий
tokar commit
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]total_count')
->label ('Количество проектов, в которых принимали участие')
->textInput (['class'=> 'custom-input-2','type'=>'number']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]complete_count')
->label ('из них реализовано')
->textInput (['class'=> 'custom-input-2','type'=>'number']);
?>
</div>
</div>
|
e9013fc3
Yarik
test
|
75
|
</div>
|
b2743529
Виталий
tokar commit
|
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
|
</div>
<div class="prev_job_container">
<p>Предыдущие места работы</p>
<?php
foreach ($job as $index => $job_model)
{
?>
<div class='prev_job_inputs'>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']name')
->label ('Название')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']link')
->label ('Ссылка на компанию на сайте МФП')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']])
->label ('Дата начала работы')
->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']date_end')
->label ('Дата окончания работы')
->widget (DatePicker::className (), ['language' => 'ru', 'dateFormat' => 'dd-MM-yyyy']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']position')
->label ('Должность')
->textInput (['class'=> 'custom-input-2']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']total_count')
->label ('Количество проектов, в которых принимали участие')
->textInput (['class'=> 'custom-input-2','type'=>'number']);
?>
</div>
</div>
<div class="input-blocks-wrapper">
<div class="input-blocks">
<?= $form->field ($job_model, '['. ($index + 1) .']complete_count')
->label ('из них реализовано')
->textInput (['class'=> 'custom-input-2','type'=>'number']);
?>
</div>
</div>
|
0f6274a7
Yarik
test
|
147
|
<?= Html::button('Удалить', ['class' => 'remove_job_button']) ?>
|
b2743529
Виталий
tokar commit
|
148
149
150
151
|
</div>
<?php } ?>
</div>
|
e9013fc3
Yarik
test
|
152
|
<?php
|
b2743529
Виталий
tokar commit
|
153
154
155
|
echo Html::button('Добавить место работы', ['id' => 'add_job_button']);
echo Html::submitButton('Обновить');
$form->end ();
|
e9013fc3
Yarik
test
|
156
|
?>
|
e9013fc3
Yarik
test
|
157
158
159
160
161
162
|
<script>
$(function() {
var regexp = /^[\w]+\[(\d+)\].*$/;
$(document).on('click', '#add_job_button', function() {
var inputs = $('.prev_job_inputs').last();
var name = $(inputs).find('input, textarea').first().attr('name');
|
588209fc
Yarik
test
|
163
164
165
166
167
168
169
|
var result = regexp.exec(name);
var lastindex;
if(result != null) {
lastindex = result[1];
} else {
lastindex = 1;
}
|
e9013fc3
Yarik
test
|
170
171
172
|
$.get('/accounts/get-form', { lastindex: lastindex }, function(data) {
$('.prev_job_container').append($(data).find('.ajax-loaded').first().html());
$(data).filter('script').appendTo('body');
|
e9013fc3
Yarik
test
|
173
|
});
|
e9013fc3
Yarik
test
|
174
|
});
|
588209fc
Yarik
test
|
175
176
177
|
$(document).on('click', '.remove_job_button', function() {
$(this).parents('.prev_job_inputs').remove();
});
|
e9013fc3
Yarik
test
|
178
179
|
});
</script>
|