|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
- /* @var $this yii\web\View */
- /* @var $model app\models\Produit */
- /* @var $form yii\widgets\ActiveForm */
- ?>
-
- <div class="produit-form">
-
- <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
-
- <?= $form->field($model, 'actif')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
- <?= $form->field($model, 'order')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'nom')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'diminutif')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'recette')->textarea() ?>
- <?= $form->field($model, 'saison')->dropDownList(['all' => 'Toutes les saisons', 'printemps' => 'Printemps', 'ete' => 'Été', 'automne' => 'Automne', 'hiver' => 'Hiver']) ; ?>
- <?= $form->field($model, 'prix')->textInput() ?>
- <?= $form->field($model, 'poids')->textInput() ?>
- <?= $form->field($model, 'quantite_max')->textInput() ?>
-
- <?= $form->field($model, 'illustration')->fileInput() ?>
- <?php
- if(strlen($model->illustration)) {
- echo '<img src="../../frontend/web/uploads/'.$model->illustration.'" width="200px" /><br />' ;
- echo '<input type="checkbox" name="delete_illustration" id="delete_illustration" /> <label for="delete_illustration">Supprimer l\'illustration</label><br /><br />' ;
- }
- ?>
-
- <?= $form->field($model, 'photo')->fileInput() ?>
- <?php
- if(strlen($model->photo)) {
- echo '<img src="../../frontend/web/uploads/'.$model->photo.'" width="200px" /><br />' ;
- echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
- }
- ?>
-
- <h2>Production</h2>
- <?= $form->field($model, 'lundi')->checkbox() ?>
- <?= $form->field($model, 'mardi')->checkbox() ?>
- <?= $form->field($model, 'mercredi')->checkbox() ?>
- <?= $form->field($model, 'jeudi')->checkbox() ?>
- <?= $form->field($model, 'vendredi')->checkbox() ?>
- <?= $form->field($model, 'samedi')->checkbox() ?>
- <?= $form->field($model, 'dimanche')->checkbox() ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
- </div>
|