|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <?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; ?>
-
- <div class="col-md-4">
- <!-- commandes -->
- <div class="">
- <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>
-
- <!-- Clients -->
- <div class="">
- <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>
-
-
- <!-- Clients crédit pain négatif -->
- <div class="">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- Clients au crédit pain négatif
- </h3>
- </div>
- <div class="panel-body">
- <?php if(count($clients_credit_pain_negatif)): ?>
- <p>Dernières inscriptions :</p>
- <table class="table table-bordered table-condensed">
- <thead>
- <tr>
- <th>Prénom, nom</th>
- <th>Crédit pain</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($clients_credit_pain_negatif as $c): ?>
- <tr>
- <td><?= Html::encode($c['prenom'].' '.$c['nom']) ?></td>
- <td><?= number_format($c['credit'],2) ?></td>
- <td><?= Html::a('<span class="glyphicon glyphicon-euro"></span>', ['user/credit','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="">
- <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>Établissement activé</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>Établissement protégé 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="" 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-12">
- <?php if(is_null($etablissement->prix_libre)): ?>
- <h2>Prix libre</h2>
- <p>Le modèle économique de <em>La boîte à pain</em> est basé sur un système de prix libre. <?= Html::a('En savoir plus',['etablissement/facturation']); ?></p>
- <?php else: ?>
- <h2><?= $etablissement->getPrixLibre() ?> / mois <?= Html::a('Modifier',['etablissement/facturation'],['class' => 'btn btn-xs btn-primary']) ?></h2>
- <?php endif; ?>
- </div>
-
- <!--<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>
-
- <div class="col-md-8">
- <!-- dernières commandes -->
- <div id="dernieres-commandes" class="">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">
- Dernières commandes clients
- </h3>
- </div>
- <div class="panel-body">
- <?php if(count($commandes)): ?>
- <table class="table table-condensed table-bordered">
- <thead>
- <tr>
- <th></th>
- <th>Date</th>
- <th>Client</th>
- <th>Produits</th>
- <th>Point de vente</th>
- <th>Montant</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($commandes as $c): ?>
- <tr>
- <td><?= $c->getStrType(true); ?></td>
- <td class="date">
- <div class="bloc-date">
- <div class="jour"><?= strftime('%A', strtotime($c->production->date)) ?></div>
- <div class="num"><?= date('d', strtotime($c->production->date)) ?></div>
- <div class="mois"><?= strftime('%B', strtotime($c->production->date)) ?></div>
- </div>
- </td>
- <td>
- <?= $c->getStrUser(); ?><br />
- <span class="small">Le <?= date('d/m/Y à G\hi', strtotime($c->date)) ?></span>
- </td>
- <td><?= $c->getResumePanier() ; ?></td>
- <td><?= $c->getResumePointVente() ; ?></td>
- <td><?= $c->getStrMontant() ; ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php else: ?>
- <div class="alert alert-warning">Aucune commande</div>
- <?php endif; ?>
- </div>
- </div>
- </div>
-
-
-
- </div>
-
- </div>
|