Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

229 lines
10KB

  1. <?php
  2. /* @var $this yii\web\View */
  3. use yii\helpers\Html ;
  4. $this->title = 'Tableau de bord';
  5. ?>
  6. <div class="site-index">
  7. <?php if(Yii::$app->request->get('erreur_produits_points_vente')): ?>
  8. <div class="alert alert-danger">Vous devez saisir vos produits et vos points de vente
  9. avant d'initialiser vos jours de production.</div>
  10. <?php endif; ?>
  11. <div class="col-md-4">
  12. <!-- commandes -->
  13. <div class="">
  14. <div class="panel panel-default">
  15. <div class="panel-heading">
  16. <h3 class="panel-title">
  17. Commandes
  18. <?= Html::a('Voir', ['commande/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
  19. </h3>
  20. </div>
  21. <div class="panel-body">
  22. <?php if(count($productions)): ?>
  23. <p>Prochaines productions : </p>
  24. <table class="table table-bordered table-condensed">
  25. <thead>
  26. <tr>
  27. <th>Date</th>
  28. <th>Commandes</th>
  29. <th></th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php foreach($productions as $p): ?>
  34. <tr>
  35. <td><?= date('d/m/Y',strtotime($p['date'])); ?></td>
  36. <td><?= count($p->commande); ?></td>
  37. <td>
  38. <?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['commande/index','date' => $p['date']], ['class' => 'btn btn-default btn-xs']) ; ?>
  39. <?php if(count($p->commande)): ?><?= Html::a('<span class="glyphicon glyphicon-download-alt"></span>', ['commande/report','date' => $p['date'],'global' => 1], ['class' => 'btn btn-default btn-xs']) ; ?><?php endif; ?>
  40. </td>
  41. </tr>
  42. <?php endforeach; ?>
  43. </tbody>
  44. </table>
  45. <?php else: ?>
  46. <div class="alert alert-warning">Aucune production de programmée.</div>
  47. <?php endif; ?>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- Clients -->
  52. <div class="">
  53. <div class="panel panel-default">
  54. <div class="panel-heading">
  55. <h3 class="panel-title">
  56. <?= $nb_clients; ?> client<?php if($nb_clients > 1): ?>s<?php endif; ?>
  57. <?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
  58. <?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
  59. </h3>
  60. </div>
  61. <div class="panel-body">
  62. <?php if($nb_clients): ?>
  63. <p>Dernières inscriptions :</p>
  64. <table class="table table-bordered table-condensed">
  65. <thead>
  66. <tr>
  67. <th>Prénom, nom</th>
  68. <th>Inscription</th>
  69. <th></th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <?php foreach($clients as $c): ?>
  74. <tr>
  75. <td><?= Html::encode($c['prenom'].' '.$c['nom']) ?></td>
  76. <td><?= date('d/m/Y', $c['created_at']); ?></td>
  77. <td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $c['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
  78. </tr>
  79. <?php endforeach; ?>
  80. </tbody>
  81. </table>
  82. <?php else: ?>
  83. <div class="alert alert-warning">Aucun client.</div>
  84. <?php endif; ?>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- Paramètres -->
  89. <div class="">
  90. <div class="panel panel-default">
  91. <div class="panel-heading">
  92. <h3 class="panel-title">
  93. Paramètres
  94. <?= Html::a('Configurer',['etablissement/update'],['class' => 'btn btn-default btn-xs']) ; ?>
  95. </h3>
  96. </div>
  97. <div class="panel-body">
  98. <table class="table table-bordered table-condensed">
  99. <thead>
  100. <tr>
  101. <th>Configuration</th>
  102. <th>Valeur</th>
  103. </tr>
  104. </thead>
  105. <tbody>
  106. <tr>
  107. <td>Boulangerie activée</td>
  108. <td>
  109. <?php if($etablissement->actif): ?>
  110. <span class="label label-success">Active</span>
  111. <?php else: ?>
  112. <span class="label label-danger">Hors-ligne</span>
  113. <?php endif; ?>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td>Boulangerie protégée par un code</td>
  118. <td>
  119. <?php if(strlen($etablissement->code)): ?>
  120. <span class="label label-success">Oui</span><br />
  121. <strong><?= Html::encode($etablissement->code) ?></strong>
  122. <?php else: ?>
  123. <span class="label label-danger">Non</span>
  124. <?php endif; ?>
  125. </td>
  126. </tr>
  127. <tr>
  128. <td>Délai de commande</td>
  129. <td><?= $etablissement->delai_commande ?> jour<?php if($etablissement->delai_commande > 1): ?>s<?php endif; ?></td>
  130. </tr>
  131. <tr>
  132. <td>Heure limite de commande</td>
  133. <td><?= $etablissement->heure_limite_commande ?>h</td>
  134. </tr>
  135. <tr>
  136. <td>Système de Crédit Pain activé</td>
  137. <td>
  138. <?php if($etablissement->credit_pain): ?>
  139. <span class="label label-success">Oui</span><br />
  140. <?php else: ?>
  141. <span class="label label-danger">Non</span>
  142. <?php endif; ?>
  143. </td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. </div>
  148. </div>
  149. </div>
  150. <!-- Facturation -->
  151. <div class="" id="facturation">
  152. <div class="panel panel-default">
  153. <div class="panel-heading">
  154. <h3 class="panel-title">
  155. Facturation
  156. <?= Html::a('Voir',['etablissement/facturation'],['class' => 'btn btn-default btn-xs']) ; ?>
  157. </h3>
  158. </div>
  159. <div class="panel-body">
  160. <div class="col-md-6 mois-en-cours">
  161. <h2>Chiffre d'affaire<br />du mois en cours</h2>
  162. <div class="montant"><span><?= number_format($etablissement->getCA(date('Y-m')), 2); ?> €</span></div>
  163. </div>
  164. <div class="col-md-6">
  165. <?php $montant = $etablissement->getMontantFacturer(date('Y-m'), 0); ?>
  166. <h2>Participation<br /><em>La boîte à pain</em> (2%)</h2>
  167. <div class="montant"><span><?php if($montant): echo number_format($montant,2).' €' ; else: echo 'Gratuit' ; endif; ?></span></div>
  168. </div>
  169. <div class="clr"></div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="col-md-8">
  175. <!-- dernières commandes -->
  176. <div id="dernieres-commandes" class="">
  177. <div class="panel panel-default">
  178. <div class="panel-heading">
  179. <h3 class="panel-title">
  180. Dernières commandes
  181. </h3>
  182. </div>
  183. <div class="panel-body">
  184. <?php if(count($commandes)): ?>
  185. <table class="table table-condensed table-bordered">
  186. <thead>
  187. <tr>
  188. <th>Date</th>
  189. <th>Client</th>
  190. <th>Produits</th>
  191. <th>Point de vente</th>
  192. <th>Montant</th>
  193. </tr>
  194. </thead>
  195. <tbody>
  196. <?php foreach($commandes as $c): ?>
  197. <tr>
  198. <td><?= date('d/m/Y', strtotime($c->production->date)) ?></td>
  199. <td><?= $c->getStrUser(); ?></td>
  200. <td><?= $c->getResumePanier() ; ?></td>
  201. <td><?= $c->getResumePointVente() ; ?></td>
  202. <td><?= $c->getStrMontant() ; ?></td>
  203. </tr>
  204. <?php endforeach; ?>
  205. </tbody>
  206. </table>
  207. <?php else: ?>
  208. <div class="alert alert-warning">Aucune commande</div>
  209. <?php endif; ?>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. </div>