_form.php 3.91 KB
<?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 */
?>

<div ng-app="HideApp"  ng-controller="SampleAppCtrl" class="Accounts-form">
    <script>
        var app = angular.module("HideApp", []);

        app.controller("SampleAppCtrl", function ($scope) {
            $scope.hideElem1 = false;
            $scope.hideElem2 = true;
        });

    </script>
    <?php $form = ActiveForm::begin(); ?>
    <div>
        <input type="checkbox" ng-model="hideElem1" /> Hide Element 1<br />
        <input type="checkbox" ng-model="hideElem2" /> Hide Element 2
    </div>
    <div  ng-hide="hideElem1" >
        <?= $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-hide="hideElem2">
        <?= $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>