You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_block_infos.php 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. use common\helpers\GlobalParam;
  3. use domain\Producer\Producer\ProducerModule;
  4. use yii\helpers\Html;
  5. $producerModule = ProducerModule::getInstance();
  6. $producer = GlobalParam::getCurrentProducer();
  7. $countBlockInfos = 0;
  8. if($producer->order_infos && strlen($producer->order_infos)) {
  9. $countBlockInfos ++;
  10. }
  11. if($producer->option_payment_info && strlen($producer->option_payment_info)) {
  12. $countBlockInfos ++;
  13. }
  14. if($producerModule->hasSpecificDelays($producer)) {
  15. $countBlockInfos ++;
  16. }
  17. $classColumn = $countBlockInfos ? 'col-lg-'.(12 / $countBlockInfos) : 'col-lg-12';
  18. ?>
  19. <?php if($countBlockInfos): ?>
  20. <div class="row" id="block-infos">
  21. <?php if($producer->order_infos && strlen($producer->order_infos)): ?>
  22. <div class="<?= $classColumn ?> col-md-12">
  23. <div class="card">
  24. <div class="card-body">
  25. <h5 class="card-title">
  26. <i class="bi bi-info-circle"></i>
  27. Infos
  28. </h5>
  29. <div class="card-text">
  30. <?= nl2br(Html::encode($producer->order_infos)); ?>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <?php endif; ?>
  36. <?php if($producer->option_payment_info && strlen($producer->option_payment_info)): ?>
  37. <div class="<?= $classColumn ?> col-md-12">
  38. <div class="card">
  39. <div class="card-body">
  40. <h5 class="card-title">
  41. <i class="bi bi-wallet2"></i>
  42. Paiement
  43. </h5>
  44. <div class="card-text">
  45. <?= nl2br(Html::encode($producer->option_payment_info)); ?>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <?php endif; ?>
  51. <?php
  52. if ($producerModule->hasSpecificDelays($producer)): ?>
  53. <div class="<?= $classColumn ?> col-md-12">
  54. <div class="card">
  55. <div class="card-body">
  56. <h5 class="card-title">
  57. <i class="bi bi-clock"></i>
  58. Délais de commande
  59. </h5>
  60. <table class="table table-bordered">
  61. <?php foreach ($producerModule->getSpecificDelays($producer) as $day => $delay): ?>
  62. <?php if ($delay['order_delay'] && $delay['order_deadline']): ?>
  63. <tr>
  64. <td>
  65. <?php
  66. switch ($day) {
  67. case 'monday':
  68. echo 'Lundi';
  69. break;
  70. case 'tuesday':
  71. echo 'Mardi';
  72. break;
  73. case 'wednesday':
  74. echo 'Mercredi';
  75. break;
  76. case 'thursday':
  77. echo 'Jeudi';
  78. break;
  79. case 'friday':
  80. echo 'Vendredi';
  81. break;
  82. case 'saturday':
  83. echo 'Samedi';
  84. break;
  85. case 'sunday':
  86. echo 'Dimanche';
  87. break;
  88. }
  89. ?>
  90. </td>
  91. <td>
  92. <span><?= $delay['order_delay'] ?> jour<?= ($delay['order_delay'] > 1) ? 's' : '' ?></span>
  93. à l'avance,
  94. avant
  95. <span><?= ($delay['order_deadline'] == 24) ? 'minuit' : $delay['order_deadline'] . 'h'; ?></span>
  96. </td>
  97. </tr>
  98. <?php endif; ?>
  99. <?php endforeach; ?>
  100. </table>
  101. </div>
  102. </div>
  103. </div>
  104. <?php endif; ?>
  105. </div>
  106. <?php endif; ?>