_form.php
4.29 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
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model common\models\Accounts */
/* @var $form yii\widgets\ActiveForm */
?>
<script>
var app = angular.module("BackendApp", []);
app.controller("SampleAppCtrl", function ($scope) {
$scope.hideElem1 = true;
$scope.hideElem2 = false;
$scope.buttons = [
{status: true, data:'Основные данные'},
{status: false, data:'Юридическое лицо'}
];
$scope.ShowMe =function(item){
$scope.buttons.forEach(function(element){
element.status = false;
});
item.status = true;
}
});
</script>
<div ng-controller="SampleAppCtrl" class="Accounts-form">
<?php $form = ActiveForm::begin(); ?>
<div >
<button ng-repeat="item in buttons" ng-click="ShowMe(item)" type="button" ng-class="item.status ? 'btn btn-primary btn-lg active' : 'btn btn-default btn-lg'" class=>{{item.data}}</button>
</div>
<div ng-show="buttons[0].status" >
<?= $form->field($model, 'if_manager')->checkbox() ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phones')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'pass')->passwordInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phones2')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phones3')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'city')->dropDownList(ArrayHelper::map($cities, 'id', 'name'), ['prompt' => 'Выберие город']) ?>
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'comment')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'dt')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'is_active')->checkbox() ?>
<?= $form->field($model, 'is_scribe')->checkbox() ?>
<?= $form->field($model, 'margin_id')->dropDownList(ArrayHelper::map($margin, 'id', 'name'), ['prompt' => 'Выберие Тип цены']) ?>
<?= $form->field($model, 'set_manager_id')->dropDownList(ArrayHelper::map($users, 'id', 'name'), ['prompt' => 'Выберие Персонального менеджера']) ?>
<?= $form->field($model, 'scode')->textInput() ?>
</div>
<div ng-show="buttons[1].status">
<?= $form->field($model, 'is_firm')->textInput() ?>
<?= $form->field($model, 'company')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_inn')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_bank')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_ur_adr')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_fiz_adr')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_code_eg')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_rs')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_mfo')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'firm_site')->textInput(['maxlength' => true]) ?>
</div>
<!-- --><?//= $form->field($model, 'country')->textInput() ?>
<!-- -->
<!-- --><?//= $form->field($model, 'rating')->textInput() ?>
<!-- -->
<!-- --><?//= $form->field($model, 'last_loginin')->textInput(['maxlength' => true]) ?>
<!-- -->
<!-- --><?//= $form->field($model, 'balance')->textInput() ?>
<!---->
<!-- --><?//= $form->field($model, 'office_id')->textInput() ?>
<!---->
<!-- --><?//= $form->field($model, 'car')->textInput() ?>
<!---->
<!-- --><?//= $form->field($model, 'mod')->textInput() ?>
<!---->
<!-- --><?//= $form->field($model, 'snumb')->textInput(['maxlength' => true]) ?>
<!---->
<!-- --><?//= $form->field($model, 'deliveries')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>