Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
legi
soft
gestex
Commits
27641bee
Commit
27641bee
authored
Sep 29, 2020
by
Gabriel Moreau
Browse files
Do not push notice if no notice !
parent
1744f248
Changes
2
Hide whitespace changes
Inline
Side-by-side
equipment-create.php
View file @
27641bee
...
...
@@ -53,11 +53,14 @@ $inventaire = param_post('inventaire');
$barcode
=
param_post
(
'barcode'
);
$loanable
=
param_post
(
'loanable'
);
$notice
=
$_FILES
[
"notice"
][
"name"
];
$notice
=
str_replace
(
' '
,
'_'
,
$notice
);
$notice
=
str_replace
(
'é'
,
'e'
,
$notice
);
$notice
=
str_replace
(
'è'
,
'e'
,
$notice
);
$notice
=
str_replace
(
'à'
,
'a'
,
$notice
);
$notice
=
''
;
if
(
isset
(
$_FILES
[
"notice"
]))
{
$notice
=
$_FILES
[
"notice"
][
"name"
];
$notice
=
str_replace
(
' '
,
'_'
,
$notice
);
$notice
=
str_replace
(
'é'
,
'e'
,
$notice
);
$notice
=
str_replace
(
'è'
,
'e'
,
$notice
);
$notice
=
str_replace
(
'à'
,
'a'
,
$notice
);
}
en_tete
(
'Résultat ajout appareil'
);
...
...
@@ -75,7 +78,8 @@ if (!empty($erreur) ){
// tout est ok
if
(
$pdo
=
connect_db
())
{
$id_equipment
=
set_equipment_new
(
$pdo
,
$categorie
,
$nom
,
$modele
,
$gamme
,
$equipe
,
$fourn
,
$achat
,
$tech
,
$reparation
,
$accessoires
,
$inventaire
,
$notice
,
$barcode
,
$loanable
);
$id_datasheet
=
set_datasheet_new
(
$pdo
,
$id_equipment
,
$nom
,
$_FILES
[
"notice"
][
"tmp_name"
]);
if
(
$notice
!=
''
)
$id_datasheet
=
set_datasheet_new
(
$pdo
,
$id_equipment
,
$nom
,
$_FILES
[
"notice"
][
"tmp_name"
]);
}
//end if connect
echo
'<br />Ajout de '
.
$nom
.
' validée'
;
...
...
module/db-functions.php
View file @
27641bee
...
...
@@ -162,8 +162,8 @@ function get_equipment_listshort($pdo) {
// ---------------------------------------------------------------------
function
set_equipment_new
(
$pdo
,
$categorie
,
$nom
,
$modele
,
$gamme
,
$equipe
,
$fourn
,
$achat
,
$tech
,
$reparation
,
$accessoires
,
$inventaire
,
$notice
,
$barcode
,
$loanable
)
{
$sql
=
'INSERT INTO Listing (categorie, nom, modele, gamme, equipe, fournisseur, achat, responsable, reparation, accessoires, inventaire, notice, barcode, loanable)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?);'
;
$sql
=
'INSERT INTO Listing (categorie, nom, modele, gamme, equipe, fournisseur, achat, responsable, reparation, accessoires, inventaire, notice, barcode, loanable)
'
$sql
.
=
' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?);'
;
$stmt
=
$pdo
->
prepare
(
$sql
);
$stmt
->
execute
(
array
(
$categorie
,
$nom
,
$modele
,
$gamme
,
$equipe
,
$fourn
,
$achat
,
$tech
,
$reparation
,
$accessoires
,
$inventaire
,
$notice
,
$barcode
,
$loanable
));
return
$pdo
->
lastInsertId
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment