|
- <?php
- /* @var $this yii\web\View */
-
- use yii\helpers\Html ;
-
- $this->title = 'Tableau de bord';
- ?>
- <div class="site-index">
-
- <?php if(Yii::$app->request->get('erreur_produits_points_vente')): ?>
- <div class="alert alert-danger">Vous devez saisir vos produits et vos points de vente
- avant d'initialiser vos jours de production.</div>
- <?php endif; ?>
-
- <!-- commandes -->
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- Commandes
- <?= Html::a('Voir', ['commande/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <?php if(count($productions)): ?>
- <p>Prochaines productions : </p>
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Date</th>
- <th>Commandes</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($productions as $p): ?>
- <tr>
- <td><?= date('d/m/Y',strtotime($p['date'])); ?></td>
- <td><?= count($p->commande); ?></td>
- <td>
- <?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['commande/index','date' => $p['date']], ['class' => 'btn btn-default btn-xs']) ; ?>
- <?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; ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php else: ?>
- <div class="alert alert-warning">Aucune production de programmée.</div>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <!-- produits -->
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- <?= $nb_produits ?> produit<?php if($nb_produits > 1): ?>s<?php endif; ?>
- <?= Html::a('Ajouter',['produit/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
- <?= Html::a('Liste', ['produit/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <?php if($nb_points_vente): ?>
- <p>Derniers produits ajoutés :</p>
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Nom</th>
- <th>Description</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($produits as $p): ?>
- <tr>
- <td><?= Html::encode($p['nom']) ?></td>
- <td><?= Html::encode($p['description']) ?></td>
- <td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['produit/update','id' => $p['id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php else: ?>
- <div class="alert alert-warning">Aucun produit.</div>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <!-- Points de vente -->
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- <?= $nb_points_vente ?> point<?php if($nb_points_vente > 1): ?>s<?php endif; ?> de vente
- <?= Html::a('Ajouter',['point-vente/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
- <?= Html::a('Liste', ['point-vente/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <?php if($nb_points_vente): ?>
- <p>Derniers points de vente ajoutés :</p>
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Nom</th>
- <th>Localisation</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($points_vente as $pv): ?>
- <tr>
- <td><?= Html::encode($pv['nom']) ?></td>
- <td><?= Html::encode($pv['localite']) ?></td>
- <td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['point-vente/update','id' => $pv['id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php else: ?>
- <div class="alert alert-warning">Aucun point de vente.</div>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <!-- Clients -->
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- <?= $nb_clients; ?> client<?php if($nb_clients > 1): ?>s<?php endif; ?>
- <?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
- <?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <?php if($nb_clients): ?>
- <p>Dernières inscriptions :</p>
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Prénom, nom</th>
- <th>Inscription</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($clients as $c): ?>
- <tr>
- <td><?= Html::encode($c['prenom'].' '.$c['nom']) ?></td>
- <td><?= date('d/m/Y', $c['created_at']); ?></td>
- <td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $c['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php else: ?>
- <div class="alert alert-warning">Aucun client.</div>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
- <!-- Paramètres -->
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- Paramètres
- <?= Html::a('Configurer',['etablissement/update'],['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Configuration</th>
- <th>Valeur</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Boulangerie activée</td>
- <td>
- <?php if($etablissement->actif): ?>
- <span class="label label-success">Active</span>
- <?php else: ?>
- <span class="label label-danger">Hors-ligne</span>
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td>Boulangerie protégée par un code</td>
- <td>
- <?php if(strlen($etablissement->code)): ?>
- <span class="label label-success">Oui</span><br />
- <strong><?= Html::encode($etablissement->code) ?></strong>
- <?php else: ?>
- <span class="label label-danger">Non</span>
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td>Délai de commande</td>
- <td><?= $etablissement->delai_commande ?> jour<?php if($etablissement->delai_commande > 1): ?>s<?php endif; ?></td>
- </tr>
- <tr>
- <td>Heure limite de commande</td>
- <td><?= $etablissement->heure_limite_commande ?>h</td>
- </tr>
- <tr>
- <td>Système de Crédit Pain activé</td>
- <td>
- <?php if($etablissement->credit_pain): ?>
- <span class="label label-success">Oui</span><br />
- <?php else: ?>
- <span class="label label-danger">Non</span>
- <?php endif; ?>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
-
- <!-- Facturation -->
- <div class="col-md-4" id="facturation">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- Facturation
- <?= Html::a('Voir',['etablissement/facturation'],['class' => 'btn btn-default btn-xs']) ; ?>
- </h3>
- </div>
- <div class="panel-body">
- <div class="col-md-6 mois-en-cours">
- <h2>Chiffre d'affaire<br />du mois en cours</h2>
- <div class="montant"><span><?= number_format($etablissement->getCA(date('Y-m')), 2); ?> €</span></div>
- </div>
-
- <div class="col-md-6">
- <?php $montant = $etablissement->getMontantFacturer(date('Y-m'), 0); ?>
- <h2>Participation<br /><em>La boîte à pain</em> (2%)</h2>
- <div class="montant"><span><?php if($montant): echo number_format($montant,2).' €' ; else: echo 'Gratuit' ; endif; ?></span></div>
- </div>
- <div class="clr"></div>
- </div>
- </div>
- </div>
-
- </div>
|