You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 line
1.4KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. /* @var $this yii\web\View */
  5. /* @var $model common\models\User */
  6. $this->title = 'Paramètres';
  7. $this->params['breadcrumbs'][] = 'Paramètres';
  8. ?>
  9. <div class="user-update">
  10. <h1><?= Html::encode($this->title) ?></h1>
  11. <div class="user-form">
  12. <?php $form = ActiveForm::begin(); ?>
  13. <div class="">
  14. <?= $form->field($model, 'code_postal') ?>
  15. <?= $form->field($model, 'ville') ?>
  16. <?php //$form->field($model, 'description')->textarea(['rows' => 10]) ?>
  17. <?= $form->field($model, 'photo')->fileInput() ?>
  18. <?php
  19. if (strlen($model->photo)) {
  20. if(Yii::$app->getRequest()->serverName == 'localhost')
  21. $base_url = '../../frontend/web/' ;
  22. else
  23. $base_url = 'http://www.laboiteapain.net/' ;
  24. echo '<img src="'.$base_url.'uploads/' . $model->photo . '" width="400px" /><br />';
  25. echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />';
  26. }
  27. ?>
  28. <div class="form-group">
  29. <?= Html::submitButton('Mettre à jour', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  30. </div>
  31. </div>
  32. <?php ActiveForm::end(); ?>
  33. </div>
  34. </div>