|
- <?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>
-
- <!-- 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>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 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>
|