-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_boitier.php
More file actions
46 lines (31 loc) · 1.01 KB
/
new_boitier.php
File metadata and controls
46 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require("Modeles/fonction.php");
require("includes/AccesBase.php");
if(!empty($_SESSION)){
$erreur="";
$i = 0;
$entite;
$ListeEntite = $db->query('SELECT * FROM entit ORDER BY idEntité DESC');
// if(!empty($_POST['reference']) AND (!empty($_POST['listeDeroulante'])){
if(!empty($_POST)){
$ref = htmlspecialchars($_POST['reference']);
$entite = htmlspecialchars($_POST['listeDeroulante']);
$idEntite=entiteDisponible($db,$entite);
//if(!is_bool($idEntite)){ fonctionne pas correctement : à voir plus tard
if(boitierDisponible($db, $ref)){
$TabAllEntite = $ListeEntite->fetchall();
insertBoitier($db, $ref, $TabAllEntite[(int)$_POST['listeDeroulante']]['idEntité']);
$erreur="La création du boîtier s'est bien déroulée";
include('Vues/new_boitier.vue.php');
}
else{
$erreur= "Ce boîtier existe déjà";
include('Vues/new_boitier.vue.php');
}
}
else{
$erreur= "Veuillez remplir tous les champs";
include('Vues/new_boitier.vue.php');
}
}
?>