|
- <?php
-
-
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
-
-
-
- ?>
-
- <div class="product-form">
-
- <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
-
- <?= $form->field($model, 'active')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
- <?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'recipe')->textarea() ?>
- <?= $form->field($model, 'price')->textInput() ?>
- <?= $form->field($model, 'weight')->textInput() ?>
- <?= $form->field($model, 'quantity_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="'.Yii::$app->urlManagerProducer->getBaseUrl().'/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 distribution</h2>
- <div id="days-production">
- <?= $form->field($model, 'monday')->checkbox() ?>
- <?= $form->field($model, 'tuesday')->checkbox() ?>
- <?= $form->field($model, 'wednesday')->checkbox() ?>
- <?= $form->field($model, 'thursday')->checkbox() ?>
- <?= $form->field($model, 'friday')->checkbox() ?>
- <?= $form->field($model, 'saturday')->checkbox() ?>
- <?= $form->field($model, 'sunday')->checkbox() ?>
- </div>
- <div class="clr"></div>
-
- <?= $form->field($model, 'id_producer')->hiddenInput()->label('') ?>
-
- <?php
- if(!$model->isNewRecord) {
- echo $form->field($model, 'apply_distributions')
- ->checkbox()
- ->hint('Sélectionnez cette option si vous souhaitez que ces modifications soient répercutées dans les distributions à venir déjà initialisées.');
- }
- ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
- </div>
|