Kaynağa Gözat

Refactoring/traduction vues backend/views/site

dev
Guillaume Bourgeois 6 yıl önce
ebeveyn
işleme
ec8308b144
2 değiştirilmiş dosya ile 52 ekleme ve 68 silme
  1. +51
    -67
      backend/views/site/index.php
  2. +1
    -1
      backend/views/site/login.php

+ 51
- 67
backend/views/site/index.php Dosyayı Görüntüle

use yii\helpers\Html ; use yii\helpers\Html ;


$this->title = 'Tableau de bord'; $this->title = 'Tableau de bord';

?> ?>
<div class="site-index"> <div class="site-index">
<?php if(Yii::$app->request->get('erreur_produits_points_vente')): ?>
<?php if(Yii::$app->request->get('error_products_points_sale')): ?>
<div class="alert alert-danger">Vous devez saisir vos produits et vos points de vente <div class="alert alert-danger">Vous devez saisir vos produits et vos points de vente
avant d'initialiser vos jours de production.</div> avant d'initialiser vos jours de production.</div>
<?php endif; ?> <?php endif; ?>
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Commandes Commandes
<?= Html::a('Voir', ['commande/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
<?= Html::a('Voir', ['order/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?php if(count($productions)): ?>
<p>Prochaines productions : </p>
<?php if(count($distributionsArray)): ?>
<p>Prochaines distributions : </p>
<table class="table table-bordered table-condensed"> <table class="table table-bordered table-condensed">
<thead> <thead>
<tr> <tr>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($productions as $p): ?>
<?php foreach($distributionsArray as $distribution): ?>
<tr> <tr>
<td><?= date('d/m/Y',strtotime($p['date'])); ?></td>
<td><?= count($p->commande); ?></td>
<td><?= date('d/m/Y',strtotime($distribution['date'])); ?></td>
<td><?= count($distribution->order); ?></td>
<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; ?>
<?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['order/index','date' => $distribution['date']], ['class' => 'btn btn-default btn-xs']) ; ?>
<?php if(count($distribution->order)): ?><?= Html::a('<span class="glyphicon glyphicon-download-alt"></span>', ['order/report','date' => $distribution['date'],'global' => 1], ['class' => 'btn btn-default btn-xs']) ; ?><?php endif; ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
<?= $nb_clients; ?> client<?php if($nb_clients > 1): ?>s<?php endif; ?>
<?= $nbUsers; ?> client<?php if($nbUsers > 1): ?>s<?php endif; ?>
<?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?> <?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
<?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?> <?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?php if($nb_clients): ?>
<?php if($nbUsers): ?>
<p>Dernières inscriptions :</p> <p>Dernières inscriptions :</p>
<table class="table table-bordered table-condensed"> <table class="table table-bordered table-condensed">
<thead> <thead>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($clients as $c): ?>
<?php foreach($usersArray as $user): ?>
<tr> <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>
<td><?= Html::encode($user['lastname'].' '.$user['name']) ?></td>
<td><?= date('d/m/Y', $user['created_at']); ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $user['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</div> </div>
<!-- Clients crédit pain négatif -->
<!-- Clients crédit négatif -->
<div class=""> <div class="">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?php if(count($clients_credit_pain_negatif)): ?>
<?php if(count($usersNegativeCredit)): ?>
<table class="table table-bordered table-condensed"> <table class="table table-bordered table-condensed">
<thead> <thead>
<tr> <tr>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($clients_credit_pain_negatif as $c): ?>
<?php foreach($usersNegativeCredit as $user): ?>
<tr> <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>
<td><?= Html::encode($user['lastname'].' '.$user['name']) ?></td>
<td><?= number_format($user['credit'],2) ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-euro"></span>', ['user/credit','id' => $user['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Paramètres Paramètres
<?= Html::a('Configurer',['etablissement/update'],['class' => 'btn btn-default btn-xs']) ; ?>
<?= Html::a('Configurer',['producer/update'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>Établissement activé</td>
<td>Producteur activé</td>
<td> <td>
<?php if($etablissement->actif): ?>
<?php if($producer->active): ?>
<span class="label label-success">Active</span> <span class="label label-success">Active</span>
<?php else: ?> <?php else: ?>
<span class="label label-danger">Hors-ligne</span> <span class="label label-danger">Hors-ligne</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Établissement protégé par un code</td>
<td>Producteur protégé par un code</td>
<td> <td>
<?php if(strlen($etablissement->code)): ?>
<?php if(strlen($producer->code)): ?>
<span class="label label-success">Oui</span><br /> <span class="label label-success">Oui</span><br />
<strong><?= Html::encode($etablissement->code) ?></strong>
<strong><?= Html::encode($producer->code) ?></strong>
<?php else: ?> <?php else: ?>
<span class="label label-danger">Non</span> <span class="label label-danger">Non</span>
<?php endif; ?> <?php endif; ?>
</tr> </tr>
<tr> <tr>
<td>Délai de commande</td> <td>Délai de commande</td>
<td><?= $etablissement->delai_commande ?> jour<?php if($etablissement->delai_commande > 1): ?>s<?php endif; ?></td>
<td><?= $producer->prder_delay ?> jour<?php if($producer->order_delay > 1): ?>s<?php endif; ?></td>
</tr> </tr>
<tr> <tr>
<td>Heure limite de commande</td> <td>Heure limite de commande</td>
<td><?= $etablissement->heure_limite_commande ?>h</td>
<td><?= $producer->order_deadline ?>h</td>
</tr> </tr>
<tr> <tr>
<td>Système de Crédit Pain activé</td>
<td>Système de Crédit activé</td>
<td> <td>
<?php if($etablissement->credit_pain): ?>
<?php if($producer->credit): ?>
<span class="label label-success">Oui</span><br /> <span class="label label-success">Oui</span><br />
<?php else: ?> <?php else: ?>
<span class="label label-danger">Non</span> <span class="label label-danger">Non</span>
</div> </div>


<!-- Mon abonnement --> <!-- Mon abonnement -->
<div class="" id="facturation">
<div class="" id="billing">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Mon abonnement Mon abonnement
<?= Html::a('Voir',['etablissement/facturation'],['class' => 'btn btn-default btn-xs']) ; ?>
<?= Html::a('Voir',['producer/billing'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="col-md-12"> <div class="col-md-12">
<?php if(is_null($etablissement->prix_libre)): ?>
<?php if(is_null($producer->free_price)): ?>
<h2>Prix libre</h2> <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>
<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',['producer/billing']); ?></p>
<?php else: ?> <?php else: ?>
<h2><?= $etablissement->getPrixLibre() ?> / mois <?= Html::a('Modifier',['etablissement/facturation'],['class' => 'btn btn-xs btn-primary']) ?></h2>
<h2><?= $producer->getFreePrice() ?> / mois <?= Html::a('Modifier',['producer/billing'],['class' => 'btn btn-xs btn-primary']) ?></h2>
<?php endif; ?> <?php endif; ?>
</div> </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> </div>
<div class="col-md-8"> <div class="col-md-8">
<!-- dernières commandes --> <!-- dernières commandes -->
<div id="dernieres-commandes" class="">
<div id="last-orders" class="">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?php if(count($commandes)): ?>
<?php if(count($ordersArray)): ?>
<table class="table table-condensed table-bordered"> <table class="table table-condensed table-bordered">
<thead> <thead>
<tr> <tr>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($commandes as $c): ?>
<tr class="<?= $c->getClassHistorique() ; ?>">
<td class="infos"><?= $c->getStrType(true); ?></td>
<?php foreach($ordersArray as $order): ?>
<tr class="<?= $order->getClassHistory() ; ?>">
<td class="infos"><?= $order->getStrType(true); ?></td>
<td class="date"> <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 class="block-date">
<div class="day"><?= strftime('%A', strtotime($order->distribution->date)) ?></div>
<div class="num"><?= date('d', strtotime($order->distribution->date)) ?></div>
<div class="month"><?= strftime('%B', strtotime($order->distribution->date)) ?></div>
</div> </div>
</td> </td>
<td> <td>
<?= $c->getStrUser(); ?><br />
<?= $order->getStrUser(); ?><br />
</td> </td>
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente() ; ?></td>
<td><?= $c->getMontant(true) ; ?></td>
<td class="history"><?= $order->getStrHistory() ; ?></td>
<td><?= $order->getCartSummary() ; ?></td>
<td><?= $order->getPointSaleSummary() ; ?></td>
<td><?= $order->getAmount(Order::AMOUNT_TOTAL, true) ; ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</div> </div>
</div> </div>
</div> </div>

</div> </div>
</div> </div>

+ 1
- 1
backend/views/site/login.php Dosyayı Görüntüle

<div class="col-lg-5"> <div class="col-lg-5">
<?php if(YII_ENV == 'demo') : ?> <?php if(YII_ENV == 'demo') : ?>
<div class="alert alert-warning"> <div class="alert alert-warning">
Identifiant : <strong>boulanger@laboiteapain.net</strong><br />
Identifiant : <strong>producteur@laboiteapain.net</strong><br />
Mot de passe : <strong>laboiteapain</strong> Mot de passe : <strong>laboiteapain</strong>
</div> </div>
<?php endif; ?> <?php endif; ?>

Yükleniyor…
İptal
Kaydet