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.

_form.php 2.0KB

8 years ago
8 years ago
8 years ago
8 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, 'nom')->textInput(['maxlength' => 255]) ?>
  12. <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
  13. <?= $form->field($model, 'recette')->textarea() ?>
  14. <?= $form->field($model, 'prix')->textInput() ?>
  15. <?= $form->field($model, 'poids')->textInput() ?>
  16. <?= $form->field($model, 'quantite_max')
  17. ->hint('Renseignez ce champs si vous souhaitez limiter la quantité commandable pour ce produit.')
  18. ->textInput() ?>
  19. <?= $form->field($model, 'photo')->fileInput() ?>
  20. <?php
  21. if(strlen($model->photo)) {
  22. echo '<img src="../../frontend/web/uploads/'.$model->photo.'" width="200px" /><br />' ;
  23. echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
  24. }
  25. ?>
  26. <h2>Jours de production</h2>
  27. <div id="jours-production">
  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. </div>
  36. <div class="clr"></div>
  37. <?= $form->field($model, 'id_etablissement')->hiddenInput()->label('') ?>
  38. <div class="form-group">
  39. <?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  40. </div>
  41. <?php ActiveForm::end(); ?>
  42. </div>