Browse Source

Système de paiement

Finalisation de la page de paiement (ajout d'informations pour le boulanger).
Finalisation de l'ajout d'infos dans le header relatives à l'abonnement (période d'essai, retard de paiement). En passant, amélioration graphique du header.

Sur le frontend, suppression de la boulangerie si elle n'est pas à jour au niveau du paiement.
master
keun 8 years ago
parent
commit
5db4b31661
13 changed files with 271 additions and 105 deletions
  1. +10
    -5
      backend/views/layouts/main.php
  2. +29
    -3
      backend/views/paiement/index.php
  3. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  4. +108
    -63
      backend/web/css/screen.css
  5. BIN
      backend/web/img/laboulange3.png
  6. +45
    -4
      backend/web/sass/screen.scss
  7. +38
    -8
      common/models/Etablissement.php
  8. +16
    -17
      common/models/User.php
  9. +12
    -1
      frontend/controllers/CommandeController.php
  10. +5
    -4
      frontend/views/commande/_form.php
  11. +6
    -0
      frontend/views/commande/_liste_etablissements.php
  12. +1
    -0
      frontend/views/commande/create.php
  13. +1
    -0
      frontend/views/commande/update.php

+ 10
- 5
backend/views/layouts/main.php View File

use yii\bootstrap\Nav; use yii\bootstrap\Nav;
use yii\bootstrap\NavBar; use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs; use yii\widgets\Breadcrumbs;
use common\models\Etablissement ;


/* @var $this \yii\web\View */ /* @var $this \yii\web\View */
/* @var $content string */ /* @var $content string */
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" /> <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" />
<?= Html::csrfMetaTags() ?> <?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?> - Réservation de pain</title>
<title><?= Html::encode($this->title) ?> - La boîte à pain</title>
<?php $this->head() ?> <?php $this->head() ?>
</head> </head>
<body> <body>
<div class="wrap"> <div class="wrap">
<?php <?php
NavBar::begin([ NavBar::begin([
'brandLabel' => '<img class="logo" src="'.Yii::$app->urlManager->getBaseUrl().'/img/laboulange2.png" />',
'brandLabel' => '<img class="logo" src="'.Yii::$app->urlManager->getBaseUrl().'/img/laboulange3.png" />',
'brandUrl' => Yii::$app->homeUrl, 'brandUrl' => Yii::$app->homeUrl,
'innerContainerOptions' => ['class'=>'container-fluid'], 'innerContainerOptions' => ['class'=>'container-fluid'],
'options' => [ 'options' => [
<?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?> <?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
<?php if($etat_paiement_etablissement == 'essai'): ?> <?php if($etat_paiement_etablissement == 'essai'): ?>
<span id="etat-paiement-etablissement">Période d'essai gratuite <span id="etat-paiement-etablissement">Période d'essai gratuite
<span class="strong"><?php echo Yii::$app->user->identity->periodeEssai(); ?> jours</span>
<span class="strong"><?php echo Yii::$app->user->identity->periodeEssai(); ?> jours</span> <a class="btn btn-success" href="<?php echo Yii::$app->urlManager->createUrl(['paiement/index']) ?>">S'abonner</a>
</span> </span>
<?php elseif($etat_paiement_etablissement == 'essai-terminee'): ?>
<?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE || $etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>
<span id="etat-paiement-etablissement"> <span id="etat-paiement-etablissement">
<span class="strong">Période d'essai gratuite terminée</span>
<span class="strong">
<?php if($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE): ?>Période d'essai gratuite terminée
<?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>Retard de paiement
<?php endif; ?>
</span>
</span> </span>
<?php endif; ?> <?php endif; ?>
</div> </div>

+ 29
- 3
backend/views/paiement/index.php View File

<?php <?php


use yii ;
use common\models\Etablissement ;

/* /*
* To change this license header, choose License Headers in Project Properties. * To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */


$this->title = 'Paiement';

$etat_paiement = Yii::$app->user->identity->etatPaiementEtablissement() ;

?> ?>


<h1>Paiement</h1> <h1>Paiement</h1>


<h2>Prod</h2>
<div class="alert alert-warning">
<?php if($etat_paiement == Etablissement::PAIEMENT_ESSAI_TERMINE): ?>
Votre période d'essai gratuite est terminée.<br />
Vous pouvez continuer à bénéficier de ce service en vous abonnant à <strong>La boîte à pain</strong>
pour <strong>30 € / mois</strong>
<?php elseif($etat_paiement == Etablissement::PAIEMENT_RETARD): ?>
Nous constatons un retard de paiement sur votre compte.<br />
Nous vous invitons à vérifier que tout est en ordre au niveau de votre compte Paypal ou à vous
abonner à nouveau en utilisant le bouton ci-dessous (<strong>30 € / mois</strong>).
<?php elseif($etat_paiement == Etablissement::PAIEMENT_ESSAI): ?>
Si vous souhaitez profiter de ce service au-delà de la période d'essai gratuite,
abonnez-vous à <strong>La boîte à pain</strong> pour <strong>30 € / mois</strong>.
<?php endif; ?>
</div>
<div class="alert alert-info">Si vous rencontrez des difficultés, n'hésitez pas à nous contacter.</div>


<!--<h2>Prod</h2>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top"> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="K96K2WLBSBDSA"> <input type="hidden" name="hosted_button_id" value="K96K2WLBSBDSA">
<input name="custom" value="<?php echo Yii::$app->user->identity->id; ?>" type="hidden" /> <input name="custom" value="<?php echo Yii::$app->user->identity->id; ?>" type="hidden" />
<input type="image" src="https://www.paypalobjects.com/fr_FR/FR/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal, le réflexe sécurité pour payer en ligne"> <input type="image" src="https://www.paypalobjects.com/fr_FR/FR/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal, le réflexe sécurité pour payer en ligne">
<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1"> <img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form>
</form>-->


<h2>Test</h2>
<!--<h2>Test</h2>-->
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top"> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="USASPWAC39S4N"> <input type="hidden" name="hosted_button_id" value="USASPWAC39S4N">
<input type="image" src="https://www.sandbox.paypal.com/fr_FR/FR/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal, le réflexe sécurité pour payer en ligne"> <input type="image" src="https://www.sandbox.paypal.com/fr_FR/FR/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal, le réflexe sécurité pour payer en ligne">
<img alt="" border="0" src="https://www.sandbox.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"> <img alt="" border="0" src="https://www.sandbox.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form> </form>


BIN
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc View File


+ 108
- 63
backend/web/css/screen.css View File



/* line 48, ../sass/screen.scss */ /* line 48, ../sass/screen.scss */
.nav-header .retour-site { .nav-header .retour-site {
border-left: solid 1px #9d9d9d;
border-left: solid 1px #F8F1DD;
padding: 10px 15px; padding: 10px 15px;
} }


} }


/* line 67, ../sass/screen.scss */ /* line 67, ../sass/screen.scss */
.navbar-inverse {
background-color: #BB8757;
border-bottom: 0px none;
}
/* line 71, ../sass/screen.scss */
.navbar-inverse .navbar-nav {
padding-top: 12px;
}
/* line 75, ../sass/screen.scss */
.navbar-inverse .navbar-nav > li > a {
color: white;
padding: 3px 14px;
}
/* line 79, ../sass/screen.scss */
.navbar-inverse .navbar-nav > li > a:hover {
color: #F8F1DD;
}
/* line 85, ../sass/screen.scss */
.navbar-inverse .navbar-nav > li.active a {
background-color: #F8F1DD;
color: #BB8757;
padding: 3px 14px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* line 91, ../sass/screen.scss */
.navbar-inverse .navbar-nav > li.active a:hover {
background-color: #BB8757;
color: #BB8757;
}

/* line 99, ../sass/screen.scss */
.nom-boulange { .nom-boulange {
margin-bottom: 15px; margin-bottom: 15px;
text-align: left; text-align: left;
top: 51px; top: 51px;
left: 0px; left: 0px;
width: 100%; width: 100%;
background-color: #BB8757;
color: white;
background-color: #515151;
background-color: #F8F1DD;
color: #8d6139;
z-index: 100; z-index: 100;
font-size: 20px; font-size: 20px;
padding: 8px 15px; padding: 8px 15px;
padding-bottom: 2px;
padding-top: 5px;
border-bottom: solid 1px #e0e0e0;
-moz-box-shadow: 0px 0px 5px gray;
-webkit-box-shadow: 0px 0px 5px gray;
box-shadow: 0px 0px 5px gray;
} }
/* line 81, ../sass/screen.scss */
/* line 118, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement { .nom-boulange #etat-paiement-etablissement {
float: right; float: right;
text-align: right; text-align: right;
color: #F8F1DD;
color: #8d6139;
font-size: 16px;
} }
/* line 85, ../sass/screen.scss */
/* line 123, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement .strong { .nom-boulange #etat-paiement-etablissement .strong {
background-color: white; background-color: white;
color: #BB8757; color: #BB8757;
border-radius: 10px; border-radius: 10px;
padding: 0px 10px; padding: 0px 10px;
} }
/* line 129, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement .btn {
padding: 2px 5px;
}


/* line 96, ../sass/screen.scss */
/* line 137, ../sass/screen.scss */
.table thead th.actions { .table thead th.actions {
width: 220px; width: 220px;
} }
/* line 99, ../sass/screen.scss */
/* line 140, ../sass/screen.scss */
.table thead th.order { .table thead th.order {
width: 58px; width: 58px;
} }
/* line 102, ../sass/screen.scss */
/* line 143, ../sass/screen.scss */
.table thead th.actif { .table thead th.actif {
width: 75px; width: 75px;
text-align: center; text-align: center;
} }
/* line 108, ../sass/screen.scss */
/* line 149, ../sass/screen.scss */
.table tbody td.center { .table tbody td.center {
text-align: center; text-align: center;
} }


/* line 121, ../sass/screen.scss */
/* line 162, ../sass/screen.scss */
#page-commande h1 .btn-group { #page-commande h1 .btn-group {
float: right; float: right;
} }
/* line 126, ../sass/screen.scss */
/* line 167, ../sass/screen.scss */
#page-commande #jours-production { #page-commande #jours-production {
display: none; display: none;
} }
/* line 132, ../sass/screen.scss */
/* line 173, ../sass/screen.scss */
#page-commande #calendar h2 { #page-commande #calendar h2 {
font-size: 20px; font-size: 20px;
position: relative; position: relative;
top: 3px; top: 3px;
} }
/* line 138, ../sass/screen.scss */
/* line 179, ../sass/screen.scss */
#page-commande #calendar .fc-header-title { #page-commande #calendar .fc-header-title {
margin-left: 10px; margin-left: 10px;
} }
/* line 144, ../sass/screen.scss */
/* line 185, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent { #page-commande #calendar .dayWithEvent {
background-color: #fee48d; background-color: #fee48d;
cursor: pointer; cursor: pointer;
} }
/* line 148, ../sass/screen.scss */
/* line 189, ../sass/screen.scss */
#page-commande #calendar .fc-event-container { #page-commande #calendar .fc-event-container {
display: none; display: none;
} }
/* line 149, ../sass/screen.scss */
/* line 190, ../sass/screen.scss */
#page-commande #calendar .fc-today { #page-commande #calendar .fc-today {
border-bottom: solid 1px #C9302C; border-bottom: solid 1px #C9302C;
background-color: white; background-color: white;
} }
/* line 153, ../sass/screen.scss */
/* line 194, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent { #page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d; background-color: #fee48d;
} }
/* line 158, ../sass/screen.scss */
/* line 199, ../sass/screen.scss */
#page-commande #calendar .fc-day { #page-commande #calendar .fc-day {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
} }
/* line 161, ../sass/screen.scss */
/* line 202, ../sass/screen.scss */
#page-commande #calendar .fc-day:hover { #page-commande #calendar .fc-day:hover {
-moz-box-shadow: 0px 0px 2px black inset; -moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset; -webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset; box-shadow: 0px 0px 2px black inset;
} }
/* line 166, ../sass/screen.scss */
/* line 207, ../sass/screen.scss */
#page-commande #calendar .current-date { #page-commande #calendar .current-date {
-moz-box-shadow: 0px 0px 2px black inset; -moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset; -webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset; box-shadow: 0px 0px 2px black inset;
} }
/* line 170, ../sass/screen.scss */
/* line 211, ../sass/screen.scss */
#page-commande #calendar .fc-day-number { #page-commande #calendar .fc-day-number {
float: none; float: none;
padding-top: 2px; padding-top: 2px;
} }
/* line 182, ../sass/screen.scss */
/* line 223, ../sass/screen.scss */
#page-commande #produits-production .overflow table { #page-commande #produits-production .overflow table {
width: 100%; width: 100%;
} }
/* line 186, ../sass/screen.scss */
/* line 227, ../sass/screen.scss */
#page-commande #produits-production .overflow thead, #page-commande #produits-production .overflow tbody, #page-commande #produits-production .overflow tr, #page-commande #produits-production .overflow td, #page-commande #produits-production .overflow th { #page-commande #produits-production .overflow thead, #page-commande #produits-production .overflow tbody, #page-commande #produits-production .overflow tr, #page-commande #produits-production .overflow td, #page-commande #produits-production .overflow th {
display: block; display: block;
} }
/* line 188, ../sass/screen.scss */
/* line 229, ../sass/screen.scss */
#page-commande #produits-production .overflow tr:after { #page-commande #produits-production .overflow tr:after {
content: ' '; content: ' ';
display: block; display: block;
visibility: hidden; visibility: hidden;
clear: both; clear: both;
} }
/* line 195, ../sass/screen.scss */
/* line 236, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th { #page-commande #produits-production .overflow thead th {
height: 30px; height: 30px;
/*text-align: left;*/ /*text-align: left;*/
} }
/* line 201, ../sass/screen.scss */
/* line 242, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody { #page-commande #produits-production .overflow tbody {
height: 200px; height: 200px;
overflow-y: auto; overflow-y: auto;
} }
/* line 209, ../sass/screen.scss */
/* line 250, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th { #page-commande #produits-production .overflow thead th {
width: 32%; width: 32%;
float: left; float: left;
} }
/* line 214, ../sass/screen.scss */
/* line 255, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody td { #page-commande #produits-production .overflow tbody td {
width: 33%; width: 33%;
float: left; float: left;
} }
/* line 219, ../sass/screen.scss */
/* line 260, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit { #page-commande #produits-production .overflow .td-produit {
width: 60%; width: 60%;
} }
/* line 222, ../sass/screen.scss */
/* line 263, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max { #page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max {
width: 20%; width: 20%;
text-align: center; text-align: center;
} }
/* line 228, ../sass/screen.scss */
/* line 269, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit { #page-commande #produits-production .overflow thead .td-produit {
width: 57%; width: 57%;
} }
/* line 234, ../sass/screen.scss */
/* line 275, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max { #page-commande #produits-production input.quantite-max {
background-color: white; background-color: white;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
text-align: center; text-align: center;
width: 50px; width: 50px;
} }
/* line 242, ../sass/screen.scss */
/* line 283, ../sass/screen.scss */
#page-commande #produits-production td label { #page-commande #produits-production td label {
font-weight: normal; font-weight: normal;
} }
/* line 248, ../sass/screen.scss */
/* line 289, ../sass/screen.scss */
#page-commande .form-commandes-point-vente { #page-commande .form-commandes-point-vente {
margin-top: 20px; margin-top: 20px;
} }
/* line 252, ../sass/screen.scss */
/* line 293, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table { #page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0; border-bottom: solid 1px #e0e0e0;
} }
/* line 256, ../sass/screen.scss */
/* line 297, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente { #page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2; background-color: #fff8e2;
border-left: solid 3px #BB8757; border-left: solid 3px #BB8757;
text-align: left; text-align: left;
padding: 10px; padding: 10px;
} }
/* line 264, ../sass/screen.scss */
/* line 305, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux { #page-commande .form-commandes-point-vente .title-totaux {
text-align: center; text-align: center;
} }
/* line 268, ../sass/screen.scss */
/* line 309, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left { #page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0; border-left: solid 1px #e0e0e0;
} }
/* line 272, ../sass/screen.scss */
/* line 313, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right { #page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0; border-right: solid 1px #e0e0e0;
} }
/* line 276, ../sass/screen.scss */
/* line 317, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite { #page-commande .form-commandes-point-vente input.quantite {
width: 30px; width: 30px;
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
text-align: center; text-align: center;
} }
/* line 284, ../sass/screen.scss */
/* line 325, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit { #page-commande .form-commandes-point-vente .td-produit {
text-align: center; text-align: center;
} }
/* line 288, ../sass/screen.scss */
/* line 329, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv { #page-commande .form-commandes-point-vente .submit-pv {
float: right; float: right;
} }
/* line 292, ../sass/screen.scss */
/* line 333, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user { #page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9; background-color: #F9F9F9;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
} }
/* line 297, ../sass/screen.scss */
/* line 338, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande { #page-commande .form-commandes-point-vente .date-commande {
font-size: 12px; font-size: 12px;
} }
/* line 301, ../sass/screen.scss */
/* line 342, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text { #page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text {
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
margin-top: 3px; margin-top: 3px;
width: 100px; width: 100px;
} }
/* line 309, ../sass/screen.scss */
/* line 350, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center { #page-commande .form-commandes-point-vente td.center {
text-align: center; text-align: center;
} }
/* line 315, ../sass/screen.scss */
/* line 356, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse { #page-commande .form-commandes-point-vente .depasse {
color: #b32815; color: #b32815;
} }
/* line 319, ../sass/screen.scss */
/* line 360, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span { #page-commande .form-commandes-point-vente .total strong span {
font-weight: normal; font-weight: normal;
font-size: 13px; font-size: 13px;
} }
/* line 324, ../sass/screen.scss */
/* line 365, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac { #page-commande .form-commandes-point-vente .vrac {
display: none; display: none;
} }
/* line 328, ../sass/screen.scss */
/* line 369, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client { #page-commande .form-commandes-point-vente td.client {
text-align: left; text-align: left;
padding: 3px; padding: 3px;
} }
/* line 331, ../sass/screen.scss */
/* line 372, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande { #page-commande .form-commandes-point-vente td.client .date-commande {
color: gray; color: gray;
} }
/* line 342, ../sass/screen.scss */
/* line 383, ../sass/screen.scss */
#page-commande .table-header-rotated td { #page-commande .table-header-rotated td {
width: 20px; width: 20px;
padding: 0px; padding: 0px;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
} }
/* line 352, ../sass/screen.scss */
/* line 393, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 { #page-commande .table-header-rotated th.rotate-45 {
height: 80px; height: 80px;
width: 20px; width: 20px;
font-size: 12px; font-size: 12px;
line-height: 0.8; line-height: 0.8;
} }
/* line 364, ../sass/screen.scss */
/* line 405, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div { #page-commande .table-header-rotated th.rotate-45 > div {
position: relative; position: relative;
top: 0px; top: 0px;
border-right: 1px solid #dddddd; border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd; border-top: 1px solid #dddddd;
} }
/* line 380, ../sass/screen.scss */
/* line 421, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 span { #page-commande .table-header-rotated th.rotate-45 span {
-ms-transform: skew(45deg, 0deg) rotate(315deg); -ms-transform: skew(45deg, 0deg) rotate(315deg);
-moz-transform: skew(45deg, 0deg) rotate(315deg); -moz-transform: skew(45deg, 0deg) rotate(315deg);
/*whether to display in one line or not*/ /*whether to display in one line or not*/
} }


/* line 405, ../sass/screen.scss */
/* line 446, ../sass/screen.scss */
#email-masse-form #ids-users { #email-masse-form #ids-users {
line-height: 30px; line-height: 30px;
} }
/* line 407, ../sass/screen.scss */
/* line 448, ../sass/screen.scss */
#email-masse-form #ids-users .label { #email-masse-form #ids-users .label {
text-transform: capitalize; text-transform: capitalize;
} }


/* line 415, ../sass/screen.scss */
/* line 456, ../sass/screen.scss */
.produit-create #jours-production .form-group { .produit-create #jours-production .form-group {
float: left; float: left;
margin-right: 15px; margin-right: 15px;
} }
/* line 419, ../sass/screen.scss */
/* line 460, ../sass/screen.scss */
.produit-create #jours-production .form-group label { .produit-create #jours-production .form-group label {
font-weight: normal; font-weight: normal;
} }
/* line 424, ../sass/screen.scss */
/* line 465, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement { .produit-create .field-produit-id_etablissement {
display: none; display: none;
} }


/* line 430, ../sass/screen.scss */
/* line 471, ../sass/screen.scss */
.produit-index .td-photo { .produit-index .td-photo {
max-width: 100px; max-width: 100px;
width: 100px; width: 100px;
} }
/* line 434, ../sass/screen.scss */
/* line 475, ../sass/screen.scss */
.produit-index .photo-produit { .produit-index .photo-produit {
max-width: 100px; max-width: 100px;
} }

BIN
backend/web/img/laboulange3.png View File

Before After
Width: 200  |  Height: 199  |  Size: 1.7KB

+ 45
- 4
backend/web/sass/screen.scss View File



.nav-header { .nav-header {
.retour-site { .retour-site {
border-left : solid 1px #9d9d9d ;
border-left : solid 1px $color2 ;
padding: 10px 15px ; padding: 10px 15px ;
} }
} }
padding-bottom: 50px ; padding-bottom: 50px ;
} }


.navbar-inverse {
background-color: $color1 ;
border-bottom: 0px none ;
.navbar-nav {
padding-top: 12px ;
}
.navbar-nav > li > a {
color: white ;
padding: 3px 14px ;
&:hover {
color: $color2 ;
}
}
.navbar-nav > li.active {
a {
background-color: $color2 ;
color: $color1 ;
padding: 3px 14px ;
@include border-radius(10px) ;
&:hover {
background-color: $color1 ;
color: $color1 ;
}
}
}
}

.nom-boulange { .nom-boulange {
//font-family: 'Georgia' ; //font-family: 'Georgia' ;
margin-bottom: 15px ; margin-bottom: 15px ;
top: 51px ; top: 51px ;
left: 0px ; left: 0px ;
width: 100% ; width: 100% ;
background-color: $color1 ;
color: white ;
background-color: #515151 ;
background-color: $color2 ;
color: darken($color1,15) ;
z-index: 100 ; z-index: 100 ;
font-size: 20px ; font-size: 20px ;
padding: 8px 15px ; padding: 8px 15px ;
padding-bottom: 2px ;
padding-top: 5px ;
border-bottom: solid 1px #e0e0e0 ;
@include box-shadow(0px 0px 5px gray) ;
#etat-paiement-etablissement { #etat-paiement-etablissement {
float: right ; float: right ;
text-align: right ; text-align: right ;
color: $color2;
color: darken($color1,15) ;
font-size: 16px ;
.strong { .strong {
background-color: white ; background-color: white ;
color: $color1 ; color: $color1 ;
@include border-radius(10px) ; @include border-radius(10px) ;
padding: 0px 10px ; padding: 0px 10px ;
} }
.btn {
padding: 2px 5px ;
}
} }
} }



+ 38
- 8
common/models/Etablissement.php View File

*/ */
class Etablissement extends \yii\db\ActiveRecord class Etablissement extends \yii\db\ActiveRecord
{ {
const PAIEMENT_OK = 'ok' ;
const PAIEMENT_ESSAI = 'essai' ;
const PAIEMENT_ESSAI_TERMINE = 'essai-terminee' ;
const PAIEMENT_RETARD = 'retard-paiement' ;
/** /**
* @inheritdoc * @inheritdoc
*/ */
$options_etablissements_dispos = [] ; $options_etablissements_dispos = [] ;
foreach($etablissements_dispos as $e) foreach($etablissements_dispos as $e)
{ {
if(!key_exists('d'. substr($e['code_postal'], 0, 2), $data_etablissements_dispos))
if($e->etatPaiement() == self::PAIEMENT_OK || $e->etatPaiement() == self::PAIEMENT_ESSAI)
{ {
$data_etablissements_dispos['d'. substr($e['code_postal'], 0, 2)] = '<strong>'.$departements[substr($e['code_postal'], 0, 2)].'</strong>' ;
$options_etablissements_dispos['d'. substr($e['code_postal'], 0, 2)] = ['disabled' => true] ;
if(!key_exists('d'. substr($e->code_postal, 0, 2), $data_etablissements_dispos))
{
$data_etablissements_dispos['d'. substr($e->code_postal, 0, 2)] = '<strong>'.$departements[substr($e->code_postal, 0, 2)].'</strong>' ;
$options_etablissements_dispos['d'. substr($e->code_postal, 0, 2)] = ['disabled' => true] ;
}

$data_etablissements_dispos[$e->id] = Html::encode($e->nom).' - '.Html::encode($e->code_postal).' '.Html::encode($e->ville) ;

} }
$data_etablissements_dispos[$e['id']] = Html::encode($e['nom']).' - '.Html::encode($e['code_postal']).' '.Html::encode($e['ville']) ;
} }
return ['data' => $data_etablissements_dispos, 'options' => $options_etablissements_dispos] ; return ['data' => $data_etablissements_dispos, 'options' => $options_etablissements_dispos] ;
}
public function etatPaiement()
{
$date_limite = strtotime($this->date_creation) + 30*24*60*60 ;
$date = time() ;
$date_paiement = strtotime($this->date_paiement) ;

if($date < $date_paiement + 30*24*60*60 || $this->gratuit)
{
return 'ok' ;
}
else {
if($date < $date_limite)
{
return 'essai' ;
}
else {
if(!$this->date_paiement)
return 'essai-terminee' ;
else
return 'retard-paiement' ;
}
}
} }
} }

+ 16
- 17
common/models/User.php View File

public function getEtablissementsFavoris() public function getEtablissementsFavoris()
{ {
return (new \yii\db\Query())
$etabs = (new \yii\db\Query())
->select('*') ->select('*')
->from(['user_etablissement', 'etablissement']) ->from(['user_etablissement', 'etablissement'])
->where('user_etablissement.id_etablissement = etablissement.id') ->where('user_etablissement.id_etablissement = etablissement.id')
->andWhere(['user_etablissement.id_user' => $this->id]) ->andWhere(['user_etablissement.id_user' => $this->id])
->all(); ->all();
$arr_etabs = array() ;
foreach($etabs as $e)
{
$etablissement = Etablissement::findOne($e['id_etablissement']) ;
if($etablissement->etatPaiement() == Etablissement::PAIEMENT_OK || $etablissement->etatPaiement() == Etablissement::PAIEMENT_ESSAI)
{
$arr_etabs[] = $e ;
}
}
return $arr_etabs ;
} }
public function etatPaiementEtablissement() public function etatPaiementEtablissement()
if($etablissement) if($etablissement)
{ {
$date_limite = strtotime($etablissement->date_creation) + 30*24*60*60 ;
$date = time() ;
$date_paiement = strtotime($etablissement->date_paiement) ;
return $etablissement->etatPaiement() ;
if($date < $date_paiement + 30*24*60*60 || $etablissement->gratuit)
{
return 'ok' ;
}
else {
if($date < $date_limite)
{
return 'essai' ;
}
else {
return 'essai-terminee' ;
}
}
} }
} }

+ 12
- 1
frontend/controllers/CommandeController.php View File

$etablissements = Yii::$app->user->identity->getEtablissementsFavoris() ; $etablissements = Yii::$app->user->identity->getEtablissementsFavoris() ;
$id_etablissement = Yii::$app->request->get('id_etablissement', 0) ; $id_etablissement = Yii::$app->request->get('id_etablissement', 0) ;
$etablissement_paiement_ok = false ;
if($id_etablissement)
{
$etablissement = Etablissement::findOne($id_etablissement);
if($etablissement->etatPaiement() == Etablissement::PAIEMENT_OK || $etablissement->etatPaiement() == Etablissement::PAIEMENT_ESSAI)
{
$etablissement_paiement_ok = true ;
}
}
// points de vente // points de vente
$points_vente = PointVente::find() $points_vente = PointVente::find()
->where(['id_etablissement'=>$id_etablissement]) ->where(['id_etablissement'=>$id_etablissement])
'produits_vrac' => $produits_vrac, 'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements, 'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement, 'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
]; ];
} }


// liste des etablissements // liste des etablissements
$etablissements = Yii::$app->user->identity->getEtablissementsFavoris(); $etablissements = Yii::$app->user->identity->getEtablissementsFavoris();
// liste des boulangeries disponibles // liste des boulangeries disponibles
$arr_etablissements = Etablissement::getEtablissementsPopulateDropdown() ; $arr_etablissements = Etablissement::getEtablissementsPopulateDropdown() ;
$data_etablissements_dispos = $arr_etablissements['data'] ; $data_etablissements_dispos = $arr_etablissements['data'] ;

+ 5
- 4
frontend/views/commande/_form.php View File

$this->render('_liste_etablissements.php',[ $this->render('_liste_etablissements.php',[
'etablissements' => $etablissements, 'etablissements' => $etablissements,
'context' => 'commande', 'context' => 'commande',
'id_etablissement' => $id_etablissement
'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
]) ; ]) ;
?> ?>
<div class="clr"></div> <div class="clr"></div>
]); ]);
?> ?>
<?php if($id_etablissement): ?>
<?php if($id_etablissement && $etablissement_paiement_ok): ?>
<h2 id="step-choix-date">Date de commande</h2> <h2 id="step-choix-date">Date de commande</h2>


<?= $form->field($model, 'commentaire')->textarea(['rows' => 3, 'placeholder' => 'Un commentaire ?'])->label(''); ?> <?= $form->field($model, 'commentaire')->textarea(['rows' => 3, 'placeholder' => 'Un commentaire ?'])->label(''); ?>
</div> </div>
</div> </div>
<?php
<?php
// id_etablissement // id_etablissement
endif; ?> endif; ?>

+ 6
- 0
frontend/views/commande/_liste_etablissements.php View File

?> ?>
<div class="liste-etablissements"> <div class="liste-etablissements">
<?php if(count($etablissements)): ?> <?php if(count($etablissements)): ?>
<?php if(isset($id_etablissement) && $id_etablissement &&
isset($etablissement_paiement_ok) && !$etablissement_paiement_ok): ?>
<div class="alert alert-warning">Cette boulangerie est désactivée.</div>
<?php endif; ?>
<?php foreach($etablissements as $e): ?> <?php foreach($etablissements as $e): ?>
<div class="col-md-6 boulangerie <?php if(isset($id_etablissement) && $e['id'] == $id_etablissement): ?>selected<?php endif; ?>"> <div class="col-md-6 boulangerie <?php if(isset($id_etablissement) && $e['id'] == $id_etablissement): ?>selected<?php endif; ?>">
<div class="panel panel-default"> <div class="panel panel-default">

+ 1
- 0
frontend/views/commande/create.php View File

'produits_vrac' => $produits_vrac, 'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements, 'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement, 'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
]) ?> ]) ?>


</div> </div>

+ 1
- 0
frontend/views/commande/update.php View File

'produits_vrac' => $produits_vrac, 'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements, 'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement, 'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
]) ?> ]) ?>
<?php endif; ?> <?php endif; ?>

Loading…
Cancel
Save