Blame view

frontend/views/accounts/_projects_form.php 4.78 KB
aa182b5c   Yarik   test
1
2
  <?php
      /**
b16ed95f   Yarik   test
3
       * @var Project          $project
aa182b5c   Yarik   test
4
       * @var Specialization[] $specialization
b16ed95f   Yarik   test
5
6
       * @var Payment[]        $payment
       * @var string[]         $projects
aa182b5c   Yarik   test
7
8
9
10
11
       */
      use common\models\Payment;
      use common\models\Project;
      use common\models\Specialization;
      use common\widgets\ImageUploader;
b16ed95f   Yarik   test
12
      use kartik\select2\Select2;
aa182b5c   Yarik   test
13
14
      use mihaildev\ckeditor\CKEditor;
      use yii\helpers\Html;
b16ed95f   Yarik   test
15
      use yii\web\JsExpression;
aa182b5c   Yarik   test
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
      use yii\widgets\ActiveForm;
  
      $this->title = 'Мой профиль';
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
  <h1><?= $this->title ?></h1>
  
  <?php
      $form = ActiveForm::begin();
  ?>
  
  <?= $form->field($project, 'name')
           ->textInput() ?>
  
  <?= $form->field($project, 'link')
           ->textInput() ?>
  
  <?= $form->field($project, 'project_pid')
b16ed95f   Yarik   test
34
           ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?>
aa182b5c   Yarik   test
35
  
d36bdac6   Administrator   17.02.16
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  <div class="input-blocks-wrapper">
      <ul class="content-menu-first">
          <?php foreach($specializations as $specialization):?>
              <li data-img="<?= $specialization->image?>">
                  <span data-menu-bg="<?= $specialization->background ?>"  style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name?></a>
                  <ul>
                      <?php  foreach($specialization->children as $child_first):?>
  
                          <?php if($child_first instanceof Specialization):?>
                              <li>
                                  <a href="#"><?= $child_first->specialization_name?></a>
                                  <ul>
                                      <?php foreach($child_first->children as $child_second):?>
                                          <?php if($child_first instanceof Specialization): ?>
5fd01fb4   Administrator   17.02.16
50
51
52
53
54
                                              <li>
                                                  <a href="#">
                                                      <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]")->checkbox(['value' => $child_second->specialization_id, 'label' => $child_second->specialization_name, 'uncheck' => null, 'checked' => 'checked']) ?>
                                                  </a>
                                              </li>
d36bdac6   Administrator   17.02.16
55
56
57
58
59
60
61
62
63
64
65
66
                                          <?php endif;?>
                                      <?php endforeach; ?>
                                  </ul>
                              </li>
                          <?php endif; ?>
                      <?php endforeach; ?>
  
                  </ul>
              </li>
          <?php endforeach; ?>
      </ul>
  </div>
aa182b5c   Yarik   test
67
68
69
  
  <div class="form-inline">
      Адрес:
b16ed95f   Yarik   test
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
      <?= $form->field($project, 'city')
               ->widget(Select2::classname(), [
                   'options'       => [ 'placeholder' => 'Выбор города ...' ],
                   'pluginOptions' => [
                       'allowClear'         => true,
                       'minimumInputLength' => 3,
                       'ajax'               => [
                           'url'      => \yii\helpers\Url::to([ 'site/city' ]),
                           'dataType' => 'json',
                           'data'     => new JsExpression('function(params) { return {q:params.term}; }'),
                       ],
                       'escapeMarkup'       => new JsExpression('function (markup) { return markup; }'),
                       'templateResult'     => new JsExpression('function(city) { return city.text; }'),
                       'templateSelection'  => new JsExpression('function (city) { return city.text; }'),
                   ],
               ]); ?>
aa182b5c   Yarik   test
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
      <?= $form->field($project, 'street', [ 'template' => "{label}{input}{hint}{error}" ])
               ->textInput() ?>
      <?= $form->field($project, 'house', [ 'template' => "{label}{input}{hint}{error}" ])
               ->textInput() ?>
  </div>
  
  <?= $form->field($project, 'budget')
           ->textInput() ?>
  
  <?= $form->field($project, 'contractual')
           ->checkbox() ?>
  
  <?= $form->field($project, 'payment_variant')
           ->radioList([
               1 => 'Без предоплаты',
               2 => 'Предоплата возможна',
           ]) ?>
  
  <?= $form->field($project, 'paymentInput')
           ->checkboxList($payment) ?>
  
  <?= $form->field($project, 'deadline', [ 'template' => "{label}{input} дней\n{hint}\n{error}" ])
           ->input('number') ?>
  
  <?= $form->field($project, 'description')
           ->widget(CKEditor::className()) ?>
  
  <?= $form->field($project, 'file')
           ->fileInput([ 'multiple' => 'multiple' ]) ?>
  
  <?= $form->field($project, 'date_end')
           ->dropDownList([
b95371cf   Yarik   test
118
119
120
               1 => 'Неделя',
               2 => '2 неделю',
               3 => 'Месяц',
aa182b5c   Yarik   test
121
122
123
124
125
126
127
           ]) ?>
  
  <?= Html::submitButton('Добавить') ?>
  
  <?php
      $form->end();
  ?>