|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
-
-
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
- \backend\assets\VuejsUserFormAsset::register($this);
-
- ?>
-
- <div class="user-form" id="app-user-form">
-
- <div class="col-md-8">
- <?php $form = ActiveForm::begin([
- 'enableClientValidation' => false
- ]); ?>
-
- <?= $form->field($model, 'type')
- ->dropDownList([
- User::TYPE_INDIVIDUAL => 'Particulier',
- User::TYPE_LEGAL_PERSON => 'Personne morale'
- ], [
- 'v-model' => 'type'
- ]) ; ?>
- <?= $form->field($model, 'name_legal_person', ['options' => ['v-show' => "type == 'legal-person'"]])->textInput() ?>
- <?= $form->field($model, 'lastname')->textInput() ?>
- <?= $form->field($model, 'name')->textInput() ?>
- <?= $form->field($model, 'phone')->textInput() ?>
- <?= $form->field($model, 'email')->textInput() ?>
- <?= $form->field($model, 'address')->textarea() ?>
- <?= $form->field($model, 'points_sale')->checkboxlist(
- ArrayHelper::map($pointsSaleArray, 'id', function ($pointSale) use ($model) {
- $commentUserPointSale = isset($pointSale->userPointSale[0]) ? $pointSale->userPointSale[0]->comment : '';
- $html = Html::encode($pointSale->name);
- if ($pointSale->restricted_access) {
- $html .= '<input type="text" placeholder="Commentaire" class="form-control" name="User[comment_point_sale_' . $pointSale->id . ']" value="' . (($model->id) ? Html::encode($commentUserPointSale) : '') . '" />';
- }
- return $html;
- }), [
- 'encode' => false
- ]);
- ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
- </div>
-
- <div class="col-md-4">
- <h2>Mot de passe</h2>
- <?php $form = ActiveForm::begin(); ?>
- <div class="form-group">
- <?= Html::submitButton('Envoyer un nouveau mot de passe', ['class' => 'btn btn-primary', 'name' => 'submit_new_password', 'value' => 1]) ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
-
- </div>
|