Commit 190eeb61 authored by okhin's avatar okhin 🚴

Merge branch '32-nouveau-front' into 'preprod'

Ajout des petits triangles

See merge request !30
parents 3d6385d9 3a43f954
Pipeline #2123 passed with stages
in 1 minute and 19 seconds
......@@ -25,6 +25,12 @@ class Perso extends Controller
$this->get_contreparties($f3);
$this->get_dons($f3);
$this->get_recurrents($f3);
if ($f3->exists('GET.validate')) {
$f3->set('modal_counterparts', '1');
$f3->clear('GET.validate');
} else {
$f3->set('modal_counterparts', '0');
};
$f3->set('block_content', 'user/perso.html');
}
......@@ -356,6 +362,7 @@ class Perso extends Controller
// Récupération des valeurs du formulaire
$adresse_id = $f3->get('adresse_id');
$quoi = $f3->get('quoi');
$commentaire = $f3->get('commentaire');
$valeur = 0;
$piplome_id = intval(substr($f3->get('piplome_id'), 0, strpos($f3->get('piplome_id'), '_')));
$taille = intval($f3->get('taille'));
......@@ -380,22 +387,22 @@ class Perso extends Controller
if ($cumul >= $valeur) {
switch ($quoi) {
case 'piplome':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'piplome','".\Utils::asl($piplome_id)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status,commentaire) VALUES ('".$f3->get('SESSION.id')."',NOW(),'piplome','".\Utils::asl($piplome_id)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'pibag':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pibag','','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pibag','','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'pishirt':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pishirt','".\Utils::asl($taille)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'pishirt','".\Utils::asl($taille)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
break;
case 'hoopie':
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'hoodie','".\Utils::asl($taille_h)."','".\Utils::asl($adresse_id)."',1)");
$db->query("INSERT INTO contreparties (user_id,datec,quoi,taille,adresse_id,status) VALUES ('".$f3->get('SESSION.id')."',NOW(),'hoodie','".\Utils::asl($taille_h)."','".\Utils::asl($adresse_id)."',1, '".\Utils::asl($commentaire)."')");
}
}
// Puis diminution du cumul de la valeur des contreparties
$db->query("UPDATE users SET cumul = cumul - ".$valeur." WHERE id='".$f3->get('SESSION.id')."'");
$f3->set('msg', _("Merci, vos contreparties seront envoyées dès que possible !"));
$this->show($f3, $args);
$f3->reroute('/perso');
}
public function receipt($f3, $params)
......
......@@ -5,6 +5,5 @@
<include href="toolbar.html" />
<include href="{{ @block_content }}" />
<include href="footer.html" />
</check>
</body>
</html>
......@@ -30,11 +30,13 @@
<!-- Custom Styles pour la version 2018 -->
<link rel="stylesheet" href="./static/css/custom.css" media="all">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!--
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
-->
<!-- Latest compiled and minified JavaScript -->
<!--
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
-->
</head>
This diff is collapsed.
<?php
use Phinx\Migration\AbstractMigration;
class AddCommentaire extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('contreparties');
$table->addColumn('commentaire', 'string')
->update();
}
}
......@@ -25,6 +25,7 @@ class CounterpartFinderTest extends FunctionalTest
'pdf_id' => '1',
'pdf_nom' => 'Main',
'pdf_url' => 'pdf',
'commentaire' => '',
];
$this->assertEquals($expectedCounterpart, $firstCounterpart);
}
......
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