|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
-
- use common\helpers\GlobalParam;
- use domain\Producer\Producer\ProducerModule;
- use yii\helpers\Html;
-
- $producerModule = ProducerModule::getInstance();
- $producer = GlobalParam::getCurrentProducer();
-
- $countBlockInfos = 0;
- if($producer->order_infos && strlen($producer->order_infos)) {
- $countBlockInfos ++;
- }
- if($producer->option_payment_info && strlen($producer->option_payment_info)) {
- $countBlockInfos ++;
- }
- if($producerModule->hasSpecificDelays($producer)) {
- $countBlockInfos ++;
- }
-
- $classColumn = $countBlockInfos ? 'col-lg-'.(12 / $countBlockInfos) : 'col-lg-12';
- ?>
-
- <?php if($countBlockInfos): ?>
- <div class="row" id="block-infos">
- <?php if($producer->order_infos && strlen($producer->order_infos)): ?>
- <div class="<?= $classColumn ?> col-md-12">
- <div class="card">
- <div class="card-body">
- <h5 class="card-title">
- <i class="bi bi-info-circle"></i>
- Infos
- </h5>
- <div class="card-text">
- <?= nl2br(Html::encode($producer->order_infos)); ?>
- </div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <?php if($producer->option_payment_info && strlen($producer->option_payment_info)): ?>
- <div class="<?= $classColumn ?> col-md-12">
- <div class="card">
- <div class="card-body">
- <h5 class="card-title">
- <i class="bi bi-wallet2"></i>
- Paiement
- </h5>
- <div class="card-text">
- <?= nl2br(Html::encode($producer->option_payment_info)); ?>
- </div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <?php
- if ($producerModule->hasSpecificDelays($producer)): ?>
- <div class="<?= $classColumn ?> col-md-12">
- <div class="card">
- <div class="card-body">
- <h5 class="card-title">
- <i class="bi bi-clock"></i>
- Délais de commande
- </h5>
- <table class="table table-bordered">
- <?php foreach ($producerModule->getSpecificDelays($producer) as $day => $delay): ?>
- <?php if ($delay['order_delay'] && $delay['order_deadline']): ?>
- <tr>
- <td>
- <?php
- switch ($day) {
- case 'monday':
- echo 'Lundi';
- break;
- case 'tuesday':
- echo 'Mardi';
- break;
- case 'wednesday':
- echo 'Mercredi';
- break;
- case 'thursday':
- echo 'Jeudi';
- break;
- case 'friday':
- echo 'Vendredi';
- break;
- case 'saturday':
- echo 'Samedi';
- break;
- case 'sunday':
- echo 'Dimanche';
- break;
- }
- ?>
- </td>
- <td>
- <span><?= $delay['order_delay'] ?> jour<?= ($delay['order_delay'] > 1) ? 's' : '' ?></span>
- à l'avance,
- avant
- <span><?= ($delay['order_deadline'] == 24) ? 'minuit' : $delay['order_deadline'] . 'h'; ?></span>
- </td>
- </tr>
- <?php endif; ?>
- <?php endforeach; ?>
- </table>
- </div>
- </div>
- </div>
- <?php endif; ?>
- </div>
- <?php endif; ?>
|