Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

52 Zeilen
2.1KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. /* @var $this yii\web\View */
  5. /* @var $model app\models\Produit */
  6. /* @var $form yii\widgets\ActiveForm */
  7. ?>
  8. <div class="produit-form">
  9. <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
  10. <?= $form->field($model, 'actif')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
  11. <?= $form->field($model, 'order')->textInput(['maxlength' => 255]) ?>
  12. <?= $form->field($model, 'nom')->textInput(['maxlength' => 255]) ?>
  13. <?= $form->field($model, 'diminutif')->textInput(['maxlength' => 255]) ?>
  14. <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
  15. <?= $form->field($model, 'recette')->textarea() ?>
  16. <?= $form->field($model, 'saison')->dropDownList(['all' => 'Toutes les saisons', 'printemps' => 'Printemps', 'ete' => 'Été', 'automne' => 'Automne', 'hiver' => 'Hiver']) ; ?>
  17. <?= $form->field($model, 'prix')->textInput() ?>
  18. <?= $form->field($model, 'poids')->textInput() ?>
  19. <?= $form->field($model, 'quantite_max')->textInput() ?>
  20. <?= $form->field($model, 'photo')->fileInput() ?>
  21. <?php
  22. if(strlen($model->photo)) {
  23. echo '<img src="../../frontend/web/uploads/'.$model->photo.'" width="200px" /><br />' ;
  24. echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
  25. }
  26. ?>
  27. <h2>Production</h2>
  28. <?= $form->field($model, 'lundi')->checkbox() ?>
  29. <?= $form->field($model, 'mardi')->checkbox() ?>
  30. <?= $form->field($model, 'mercredi')->checkbox() ?>
  31. <?= $form->field($model, 'jeudi')->checkbox() ?>
  32. <?= $form->field($model, 'vendredi')->checkbox() ?>
  33. <?= $form->field($model, 'samedi')->checkbox() ?>
  34. <?= $form->field($model, 'dimanche')->checkbox() ?>
  35. <?= $form->field($model, 'id_etablissement')->hiddenInput()->label('') ?>
  36. <div class="form-group">
  37. <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  38. </div>
  39. <?php ActiveForm::end(); ?>
  40. </div>