From 333890c2ca12f230fc73836465f57fb268e19271 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Sat, 18 Jun 2022 12:19:38 +0200 Subject: [PATCH] hexa --- admin/planning.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/admin/planning.php b/admin/planning.php index 0a47c8f..a8b071c 100644 --- a/admin/planning.php +++ b/admin/planning.php @@ -46,9 +46,16 @@ if(isset($_POST['send'])) { $len = (float) (100/20)*htmlspecialchars($_POST['length']); $num_planning = (int) htmlspecialchars($_POST['num_planning']); + + if (isset($_POST['colorhex']) AND !empty($_POST['colorhex'])) { + $color = htmlspecialchars($_POST['colorhex']); + } else { + $color = $color.dechex($opacity); + } + if($opacity <= 100 AND $opacity >= 0) { $req = $db->prepare("INSERT INTO planning_insa(day, title, description, color, order_start, length, num_planning) VALUES(?, ?, ?, ?, ?, ?, ?)"); - $req->execute(array($day, $title, $desc, $color.dechex($opacity), $order_start, $len, $num_planning)); + $req->execute(array($day, $title, $desc, $color, $order_start, $len, $num_planning)); header('refresh:0'); } else { $error ="L'opacité doit être en %"; @@ -82,6 +89,7 @@ if(isset($_POST['send'])) { + @@ -153,7 +161,7 @@ if(isset($_POST['send'])) { ?> -
+ %