|
- <?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, '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() ?>
-
- <?= $form->field($model, 'id_etablissement')->hiddenInput()->label('') ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
- </div>
|