Commit c2e068c1 authored by okhin's avatar okhin 🚴

Merge branch 'preprod' into 'master'

Preprod

See merge request !80
parents ebe19be7 37b6d473
Pipeline #2310 passed with stages
in 1 minute and 15 seconds
......@@ -383,7 +383,7 @@ class Admin extends Controller
{
$db = $f3->get('DB');
$f3->set('counterparts_import', '');
$total = array("hoopie" => 0, "pishirt" => 0, "pibag" => 0, "piplome" => 0);
$total = array("hoodie" => 0, "pishirt" => 0, "pibag" => 0, "piplome" => 0);
if ($f3->get('VERB') == 'POST') {
......
......@@ -329,7 +329,7 @@ class Perso extends Controller
case 'pishirt':
$valeur = 100;
break;
case 'hoopie':
case 'hoodie':
$valeur = 250;
break;
}
......@@ -346,8 +346,8 @@ class Perso extends Controller
case 'pishirt':
$f3->get('container')['command_handler']->handle(new CounterpartCreateCommand(\Utils::asl($adresse_id), $f3->get('SESSION.id'), 'pishirt', \Utils::asl($taille), 1, date("Y-m-d H:i:s"), \Utils::asl($commentaire)));
break;
case 'hoopie':
$f3->get('container')['command_handler']->handle(new CounterpartCreateCommand(\Utils::asl($adresse_id), $f3->get('SESSION.id'), 'hoopie', \Utils::asl($taille_h), 1, date("Y-m-d H:i:s"), \Utils::asl($commentaire)));
case 'hoodie':
$f3->get('container')['command_handler']->handle(new CounterpartCreateCommand(\Utils::asl($adresse_id), $f3->get('SESSION.id'), 'hoodie', \Utils::asl($taille_h), 1, date("Y-m-d H:i:s"), \Utils::asl($commentaire)));
break;
}
// Puis diminution du cumul de la valeur des contreparties
......
......@@ -343,7 +343,7 @@
<div class="panel panel-default">
<div class="panel-body c-panelcontrepartie">
<div class="col-md-1">
<input type="radio" class="radio" id="quoi4" name="quoi"<check if="{{ @infos.cumul < 250 }}">disabled</check> value="hoopie">
<input type="radio" class="radio" id="quoi4" name="quoi"<check if="{{ @infos.cumul < 250 }}">disabled</check> value="hoodie">
<label for="quoi4"></label>
</div>
<div class="col-md-3 text-center">
......@@ -419,7 +419,7 @@
</p>
<h3>{{ _("Récapitulatif&nbsp;:") }}</h3>
<ul class="list-unstyled">
<check if="{{ in_array(@GET['quoi'], array('piplome', 'pibag', 'pishirt', 'hoopie')) }}">
<check if="{{ in_array(@GET['quoi'], array('piplome', 'pibag', 'pishirt', 'hoodie')) }}">
<li class="media">
<div class="media-left">
<img class="media-object" src="/static/img/piplome.svg" alt="">
......@@ -429,7 +429,7 @@
</div>
</li>
</check>
<check if="{{ in_array(@GET['quoi'], array('pibag', 'pishirt', 'hoopie')) }}">
<check if="{{ in_array(@GET['quoi'], array('pibag', 'pishirt', 'hoodie')) }}">
<li class="media">
<div class="media-left">
<img class="media-object" src="/static/img/pibag2.svg" alt="">
......@@ -439,7 +439,7 @@
</div>
</li>
</check>
<check if="{{ in_array(@GET['quoi'], array('pishirt', 'hoopie')) }}">
<check if="{{ in_array(@GET['quoi'], array('pishirt', 'hoodie')) }}">
<li class="media">
<div class="media-left">
<img class="media-object" src="/static/img/pishirt2.svg" alt="">
......@@ -449,7 +449,7 @@
</div>
</li>
</check>
<check if="{{ in_array(@GET['quoi'], array('hoopie')) }}">
<check if="{{ in_array(@GET['quoi'], array('hoodie')) }}">
<li class="media">
<div class="media-left">
<img class="media-object" src="/static/img/hoopie2.svg" alt="">
......
......@@ -46,7 +46,7 @@ class CounterpartSeeder extends AbstractSeed
'id' => 4,
'datec' => '2016-06-22 12:34',
'user_id' => 2,
'quoi' => 'hoopie', // [piplome|pibag|pishirt|hoodie]
'quoi' => 'hoodie', // [piplome|pibag|pishirt|hoodie]
'taille' => 2,
'status' => 2,
'adresse_id' => null,
......
......@@ -100,12 +100,12 @@ class UserHandler
])->fetchAll(\PDO::FETCH_COLUMN)[0];
// Let's compute the cumul too
// quoi = 'hoopie' somme = 250
// quoi = 'hoodie' somme = 250
// quoi = 'pishirt' somme = 100
// quoi = 'pibag' somme = 50
// quoi = 'piplome' somme = 30
$spent = $this->connection->executeQuery(
"SELECT sum(IF(quoi = 'hoopie',250,0)) + sum(IF(quoi = 'pishirt', 100, 0)) + sum(IF(quoi = 'pibag', 50, 0)) + sum(IF(quoi = 'piplome', 30, 0)) AS spent FROM contreparties WHERE user_id = :user_id",
"SELECT sum(IF(quoi = 'hoodie',250,0)) + sum(IF(quoi = 'pishirt', 100, 0)) + sum(IF(quoi = 'pibag', 50, 0)) + sum(IF(quoi = 'piplome', 30, 0)) AS spent FROM contreparties WHERE user_id = :user_id",
[ 'user_id' => $user_id]
)->fetchAll(\PDO::FETCH_COLUMN)[0];
$this->connection->executeUpdate('UPDATE users SET total = :total, cumul = :cumul WHERE id = :user_id', ['total' => (int) $total, 'cumul' => (int) $total - (int) $spent, 'user_id' => $user_id]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment