|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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, 'nom')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'recette')->textarea() ?>
- <?= $form->field($model, 'prix')->textInput() ?>
- <?= $form->field($model, 'poids')->textInput() ?>
- <?= $form->field($model, 'quantite_max')
- ->hint('Renseignez ce champs si vous souhaitez limiter la quantité commandable pour ce produit.')
- ->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>Jours de production</h2>
- <div id="jours-production">
- <?= $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>
- <div class="clr"></div>
-
- <?= $form->field($model, 'id_etablissement')->hiddenInput()->label('') ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
- </div>
|