|
- <?php
-
-
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
-
-
-
- ?>
-
- <div class="user-form">
-
- <?php $form = ActiveForm::begin(); ?>
-
- <?= $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>
|