forked from vergnet/site-accueil-insa
transparent
This commit is contained in:
parent
8e526d73ce
commit
612b1120c4
1 changed files with 14 additions and 9 deletions
|
@ -36,7 +36,7 @@ $tab = array_unique($tab); //supprimer les doublons
|
|||
|
||||
if(isset($_POST['send'])) {
|
||||
if($user['perm'] >= 1) {
|
||||
if(isset($_POST['day']) AND !empty($_POST['day']) AND isset($_POST['title']) AND !empty($_POST['title']) AND isset($_POST['description']) AND !empty($_POST['description']) AND isset($_POST['color']) AND !empty($_POST['color']) AND isset($_POST['order_start']) AND !empty($_POST['order_start']) AND isset($_POST['length']) AND !empty($_POST['length']) AND isset($_POST['num_planning']) AND !empty($_POST['num_planning']) AND isset($_POST['opacity']) AND !empty($_POST['opacity'])) {
|
||||
if(isset($_POST['day']) AND !empty($_POST['day']) AND isset($_POST['title']) AND !empty($_POST['title']) AND isset($_POST['description']) AND !empty($_POST['description']) AND isset($_POST['color']) AND !empty($_POST['color']) AND isset($_POST['order_start']) AND !empty($_POST['order_start']) AND isset($_POST['length']) AND !empty($_POST['length']) AND isset($_POST['num_planning']) AND !empty($_POST['num_planning']) AND isset($_POST['opacity'])) {
|
||||
$day = (int) htmlspecialchars($_POST['day']);
|
||||
$title = htmlspecialchars($_POST['title']);
|
||||
$desc = htmlspecialchars($_POST['description']);
|
||||
|
@ -50,16 +50,21 @@ if(isset($_POST['send'])) {
|
|||
if (isset($_POST['colorhex']) AND !empty($_POST['colorhex'])) {
|
||||
$color = htmlspecialchars($_POST['colorhex']);
|
||||
} else {
|
||||
$color = $color.dechex($opacity*2.55);
|
||||
|
||||
if($opacity <= 100 AND $opacity >= 0) {
|
||||
if(opacity == 0) {
|
||||
$color = "transparent";
|
||||
} else {
|
||||
$color = $color.dechex($opacity*2.55);
|
||||
}
|
||||
} else {
|
||||
$error = "l'opacité doit être en %";
|
||||
}
|
||||
}
|
||||
|
||||
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, $order_start, $len, $num_planning));
|
||||
header('refresh:0');
|
||||
} else {
|
||||
$error ="L'opacité doit être en %";
|
||||
}
|
||||
$req = $db->prepare("INSERT INTO planning_insa(day, title, description, color, order_start, length, num_planning) VALUES(?, ?, ?, ?, ?, ?, ?)");
|
||||
$req->execute(array($day, $title, $desc, $color, $order_start, $len, $num_planning));
|
||||
header('refresh:0');
|
||||
|
||||
} else {
|
||||
$error = "Tout les champs doivent être complétés";
|
||||
|
|
Loading…
Reference in a new issue