Browse Source

Système de paiement

Mise en place d'un système de paiement via Paypal.
prodstable
keun 8 years ago
parent
commit
b9ebd2dffc
16 changed files with 226 additions and 71 deletions
  1. +22
    -0
      backend/controllers/BackendController.php
  2. +1
    -1
      backend/controllers/CommandeController.php
  3. +1
    -1
      backend/controllers/EtablissementController.php
  4. +23
    -6
      backend/controllers/PaiementController.php
  5. +1
    -1
      backend/controllers/PointVenteController.php
  6. +1
    -1
      backend/controllers/ProduitController.php
  7. +1
    -1
      backend/controllers/SiteController.php
  8. +1
    -1
      backend/controllers/StatsController.php
  9. +1
    -1
      backend/controllers/UserController.php
  10. +1
    -1
      backend/controllers/VracController.php
  11. +10
    -0
      backend/views/layouts/main.php
  12. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  13. +72
    -57
      backend/web/css/screen.css
  14. +13
    -0
      backend/web/sass/screen.scss
  15. +46
    -0
      common/models/User.php
  16. +32
    -0
      console/migrations/m161113_155900_systeme_paiement.php

+ 22
- 0
backend/controllers/BackendController.php View File

<?php

namespace backend\controllers;

use yii ;

class BackendController extends \yii\web\Controller
{
public function beforeAction($event)
{
if(Yii::$app->user->identity->etatPaiementEtablissement() == 'essai-terminee')
{
$this->redirect(['paiement/index']) ;
}
return parent::beforeAction($event);
}
}

?>

+ 1
- 1
backend/controllers/CommandeController.php View File

use common\models\CommandeProduit; use common\models\CommandeProduit;
use kartik\mpdf\Pdf; use kartik\mpdf\Pdf;


class CommandeController extends \yii\web\Controller {
class CommandeController extends BackendController {


var $enableCsrfValidation = false; var $enableCsrfValidation = false;



+ 1
- 1
backend/controllers/EtablissementController.php View File

/** /**
* UserController implements the CRUD actions for User model. * UserController implements the CRUD actions for User model.
*/ */
class EtablissementController extends Controller
class EtablissementController extends BackendController
{ {
public function behaviors() public function behaviors()
{ {

+ 23
- 6
backend/controllers/PaiementController.php View File

$ipn = new PayPal_Ipn(false); $ipn = new PayPal_Ipn(false);
if ($ipn->init()) if ($ipn->init())
{ {
/* Get any key/value */
$custom = $ipn->getKeyValue('custom'); $custom = $ipn->getKeyValue('custom');
/*
Add your code here
*/
$txn_type = $ipn->getKeyValue('txn_type');
$message = '' ;
/*$message = '' ;


foreach($_POST as $key => $val) { foreach($_POST as $key => $val) {
$message .= $key.' : '.$val."\n" ; $message .= $key.' : '.$val."\n" ;
} }


mail('guillaume.bourgeois13@laposte.net','Données IPN', $message) ;
mail('guillaume.bourgeois13@laposte.net','Données IPN', $message) ;*/
if($txn_type == 'subscr_payment' && $custom)
{
$user = User::findOne($custom) ;
if($user)
{
$etablissement = Etablissement::findOne($user->id_etablissement) ;
if($etablissement)
{
$date = $etablissement->date_paiement ;
if(!$date) $date = time() ;
else $date = strtotime($date) ;
$date += 30*24*60*60 ;
$etablissement->date_paiement = date('Y-m-d H:i:s',$date) ;
$etablissement->save() ;
}
}
}
} }
} }
/* Enable again if you use it */ /* Enable again if you use it */

+ 1
- 1
backend/controllers/PointVenteController.php View File

/** /**
* PointVenteController implements the CRUD actions for PointVente model. * PointVenteController implements the CRUD actions for PointVente model.
*/ */
class PointVenteController extends Controller
class PointVenteController extends BackendController
{ {
public function behaviors() public function behaviors()
{ {

+ 1
- 1
backend/controllers/ProduitController.php View File

/** /**
* ProduitController implements the CRUD actions for Produit model. * ProduitController implements the CRUD actions for Produit model.
*/ */
class ProduitController extends Controller
class ProduitController extends BackendController
{ {
var $enableCsrfValidation = false ; var $enableCsrfValidation = false ;

+ 1
- 1
backend/controllers/SiteController.php View File

/** /**
* Site controller * Site controller
*/ */
class SiteController extends Controller
class SiteController extends BackendController
{ {
/** /**
* @inheritdoc * @inheritdoc

+ 1
- 1
backend/controllers/StatsController.php View File

use DateInterval; use DateInterval;
use DatePeriod; use DatePeriod;


class StatsController extends Controller {
class StatsController extends BackendController {
public function behaviors() public function behaviors()
{ {

+ 1
- 1
backend/controllers/UserController.php View File

/** /**
* UserController implements the CRUD actions for User model. * UserController implements the CRUD actions for User model.
*/ */
class UserController extends Controller
class UserController extends BackendController
{ {
public function behaviors() public function behaviors()
{ {

+ 1
- 1
backend/controllers/VracController.php View File

/** /**
* ProduitController implements the CRUD actions for Produit model. * ProduitController implements the CRUD actions for Produit model.
*/ */
class VracController extends Controller
class VracController extends BackendController
{ {
var $enableCsrfValidation = false ; var $enableCsrfValidation = false ;

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

<?php if(!Yii::$app->user->isGuest): ?> <?php if(!Yii::$app->user->isGuest): ?>
<div class="nom-boulange"> <div class="nom-boulange">
<span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span> <span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
<?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
<?php if($etat_paiement_etablissement == 'essai'): ?>
<span id="etat-paiement-etablissement">Période d'essai gratuite
<span class="strong"><?php echo Yii::$app->user->identity->periodeEssai(); ?> jours</span>
</span>
<?php elseif($etat_paiement_etablissement == 'essai-terminee'): ?>
<span id="etat-paiement-etablissement">
<span class="strong">Période d'essai gratuite terminée</span>
</span>
<?php endif; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?= Breadcrumbs::widget([ <?= Breadcrumbs::widget([

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


+ 72
- 57
backend/web/css/screen.css View File

font-size: 20px; font-size: 20px;
padding: 8px 15px; padding: 8px 15px;
} }
/* line 81, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement {
float: right;
text-align: right;
color: #F8F1DD;
}
/* line 85, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement .strong {
background-color: white;
color: #BB8757;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 0px 10px;
}


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


/* line 108, ../sass/screen.scss */
/* line 121, ../sass/screen.scss */
#page-commande h1 .btn-group { #page-commande h1 .btn-group {
float: right; float: right;
} }
/* line 113, ../sass/screen.scss */
/* line 126, ../sass/screen.scss */
#page-commande #jours-production { #page-commande #jours-production {
display: none; display: none;
} }
/* line 119, ../sass/screen.scss */
/* line 132, ../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 125, ../sass/screen.scss */
/* line 138, ../sass/screen.scss */
#page-commande #calendar .fc-header-title { #page-commande #calendar .fc-header-title {
margin-left: 10px; margin-left: 10px;
} }
/* line 131, ../sass/screen.scss */
/* line 144, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent { #page-commande #calendar .dayWithEvent {
background-color: #fee48d; background-color: #fee48d;
cursor: pointer; cursor: pointer;
} }
/* line 135, ../sass/screen.scss */
/* line 148, ../sass/screen.scss */
#page-commande #calendar .fc-event-container { #page-commande #calendar .fc-event-container {
display: none; display: none;
} }
/* line 136, ../sass/screen.scss */
/* line 149, ../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 140, ../sass/screen.scss */
/* line 153, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent { #page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d; background-color: #fee48d;
} }
/* line 145, ../sass/screen.scss */
/* line 158, ../sass/screen.scss */
#page-commande #calendar .fc-day { #page-commande #calendar .fc-day {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
} }
/* line 148, ../sass/screen.scss */
/* line 161, ../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 153, ../sass/screen.scss */
/* line 166, ../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 157, ../sass/screen.scss */
/* line 170, ../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 169, ../sass/screen.scss */
/* line 182, ../sass/screen.scss */
#page-commande #produits-production .overflow table { #page-commande #produits-production .overflow table {
width: 100%; width: 100%;
} }
/* line 173, ../sass/screen.scss */
/* line 186, ../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 175, ../sass/screen.scss */
/* line 188, ../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 182, ../sass/screen.scss */
/* line 195, ../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 188, ../sass/screen.scss */
/* line 201, ../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 196, ../sass/screen.scss */
/* line 209, ../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 201, ../sass/screen.scss */
/* line 214, ../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 206, ../sass/screen.scss */
/* line 219, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit { #page-commande #produits-production .overflow .td-produit {
width: 60%; width: 60%;
} }
/* line 209, ../sass/screen.scss */
/* line 222, ../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 215, ../sass/screen.scss */
/* line 228, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit { #page-commande #produits-production .overflow thead .td-produit {
width: 57%; width: 57%;
} }
/* line 221, ../sass/screen.scss */
/* line 234, ../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 229, ../sass/screen.scss */
/* line 242, ../sass/screen.scss */
#page-commande #produits-production td label { #page-commande #produits-production td label {
font-weight: normal; font-weight: normal;
} }
/* line 235, ../sass/screen.scss */
/* line 248, ../sass/screen.scss */
#page-commande .form-commandes-point-vente { #page-commande .form-commandes-point-vente {
margin-top: 20px; margin-top: 20px;
} }
/* line 239, ../sass/screen.scss */
/* line 252, ../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 243, ../sass/screen.scss */
/* line 256, ../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 251, ../sass/screen.scss */
/* line 264, ../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 255, ../sass/screen.scss */
/* line 268, ../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 259, ../sass/screen.scss */
/* line 272, ../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 263, ../sass/screen.scss */
/* line 276, ../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 271, ../sass/screen.scss */
/* line 284, ../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 275, ../sass/screen.scss */
/* line 288, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv { #page-commande .form-commandes-point-vente .submit-pv {
float: right; float: right;
} }
/* line 279, ../sass/screen.scss */
/* line 292, ../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 284, ../sass/screen.scss */
/* line 297, ../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 288, ../sass/screen.scss */
/* line 301, ../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 296, ../sass/screen.scss */
/* line 309, ../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 302, ../sass/screen.scss */
/* line 315, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse { #page-commande .form-commandes-point-vente .depasse {
color: #b32815; color: #b32815;
} }
/* line 306, ../sass/screen.scss */
/* line 319, ../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 311, ../sass/screen.scss */
/* line 324, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac { #page-commande .form-commandes-point-vente .vrac {
display: none; display: none;
} }
/* line 315, ../sass/screen.scss */
/* line 328, ../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 318, ../sass/screen.scss */
/* line 331, ../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 329, ../sass/screen.scss */
/* line 342, ../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 339, ../sass/screen.scss */
/* line 352, ../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 351, ../sass/screen.scss */
/* line 364, ../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 367, ../sass/screen.scss */
/* line 380, ../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 392, ../sass/screen.scss */
/* line 405, ../sass/screen.scss */
#email-masse-form #ids-users { #email-masse-form #ids-users {
line-height: 30px; line-height: 30px;
} }
/* line 394, ../sass/screen.scss */
/* line 407, ../sass/screen.scss */
#email-masse-form #ids-users .label { #email-masse-form #ids-users .label {
text-transform: capitalize; text-transform: capitalize;
} }


/* line 402, ../sass/screen.scss */
/* line 415, ../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 406, ../sass/screen.scss */
/* line 419, ../sass/screen.scss */
.produit-create #jours-production .form-group label { .produit-create #jours-production .form-group label {
font-weight: normal; font-weight: normal;
} }
/* line 411, ../sass/screen.scss */
/* line 424, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement { .produit-create .field-produit-id_etablissement {
display: none; display: none;
} }


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

+ 13
- 0
backend/web/sass/screen.scss View File

} }


.nom-boulange { .nom-boulange {
//font-family: 'Georgia' ;
margin-bottom: 15px ; margin-bottom: 15px ;
text-align: left ; text-align: left ;
position: fixed ; position: fixed ;
z-index: 100 ; z-index: 100 ;
font-size: 20px ; font-size: 20px ;
padding: 8px 15px ; padding: 8px 15px ;
#etat-paiement-etablissement {
float: right ;
text-align: right ;
color: $color2;
.strong {
background-color: white ;
color: $color1 ;
@include border-radius(10px) ;
padding: 0px 10px ;
}
}
} }


.table { .table {

+ 46
- 0
common/models/User.php View File

->all(); ->all();
} }
public function etatPaiementEtablissement()
{
$etablissement = Etablissement::findOne($this->id_etablissement) ;
if($etablissement)
{
$date_limite = strtotime($etablissement->date_creation) + 30*24*60*60 ;
$date = time() ;
if($etablissement->gratuit)
{
return 'gratuit' ;
}
else {
if($date < $date_limite)
{
return 'essai' ;
}
else {
return 'essai-terminee' ;
}
}
}
}
public function periodeEssai()
{
$etablissement = Etablissement::findOne($this->id_etablissement) ;
if($etablissement)
{
$date_limite = strtotime($etablissement->date_creation) + 30*24*60*60 ;
$date = time() ;
if($date < $date_limite)
{
$date = $date_limite - $date ;
return (int) ($date / (24*60*60)) ;
}
else {
return 0 ;
}
}
}
} }

+ 32
- 0
console/migrations/m161113_155900_systeme_paiement.php View File

<?php

use yii\db\Schema;
use yii\db\Migration;

class m161113_155900_systeme_paiement extends Migration
{
public function up()
{
$this->addColumn('etablissement', 'date_creation', Schema::TYPE_DATETIME.' NOT NULL DEFAULT CURRENT_TIMESTAMP') ;
$this->addColumn('etablissement', 'date_paiement', Schema::TYPE_DATETIME) ;
$this->addColumn('etablissement', 'gratuit', Schema::TYPE_BOOLEAN.' DEFAULT 0') ;
}

public function down()
{
$this->dropColumn('etablissement', 'date_creation') ;
$this->dropColumn('etablissement', 'date_paiement') ;
$this->dropColumn('etablissement', 'gratuit') ;
}

/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}

public function safeDown()
{
}
*/
}

Loading…
Cancel
Save