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
2c7f7a0c
Commit
2c7f7a0c
authored
Jul 15, 2021
by
Gabriel Moreau
Browse files
Merge branch 'devel' of gricad-gitlab.univ-grenoble-alpes.fr:legi/soft/gestex into devel
parents
6cf6cfc2
22a5e2f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
intervention-process.php
View file @
2c7f7a0c
...
...
@@ -33,7 +33,7 @@ var_dump($supplier_id);
var_dump
(
$date
);
if
(
$recipe
!=
''
)
{
$id_recipe
=
set_recipe_new
(
$pdo
,
$equipment_id
,
$intervention_id
,
'recipe'
);
$id_recipe
=
set_recipe_new
(
$pdo
,
$intervention_id
,
'recipe'
);
if
(
!
$id_recipe
)
{
$title
=
'Erreur appareil'
;
$action
=
'equipment-view.php?id='
.
$equipment_id
;
...
...
module/db-functions.php
View file @
2c7f7a0c
...
...
@@ -1416,7 +1416,7 @@ function set_version_by_name($pdo, $name, $version) {
// RECIPE
// ---------------------------------------------------------------------
function
set_recipe_new
(
$pdo
,
$equipment_id
,
$intervention_id
,
$file_field_name
)
{
function
set_recipe_new
(
$pdo
,
$intervention_id
,
$file_field_name
)
{
$recipe_filename_upload
=
$_FILES
[
$file_field_name
][
'name'
];
$recipe_tmp_file
=
$_FILES
[
$file_field_name
][
'tmp_name'
];
$recipe_io_error
=
$_FILES
[
$file_field_name
][
'error'
];
...
...
@@ -1448,9 +1448,9 @@ function set_recipe_new($pdo, $equipment_id, $intervention_id, $file_field_name)
$recipe_filename_no_ext
=
pathinfo
(
$recipe_filename_upload
,
PATHINFO_FILENAME
);
$recipe_filename_kebab
=
string_to_filename_kebab
(
$recipe_filename_no_ext
)
.
'.pdf'
;
$sql1
=
'INSERT INTO recipe (description,
equipment_id,
intervention_id) VALUES (?, ?, ?);'
;
$sql1
=
'INSERT INTO recipe (description, intervention_id) VALUES (?, ?, ?);'
;
$stmt1
=
$pdo
->
prepare
(
$sql1
);
$stmt1
->
execute
(
array
(
$recipe_filename_no_ext
,
$equipment_id
,
$intervention_id
));
$stmt1
->
execute
(
array
(
$recipe_filename_no_ext
,
$intervention_id
));
$recipe_id
=
$pdo
->
lastInsertId
();
$sub_path
=
$recipe_id
.
'-'
.
random_string
(
8
);
...
...
@@ -1507,10 +1507,10 @@ function get_recipe_all_by_id($pdo, $id) {
// ---------------------------------------------------------------------
function
get_recipe_listall_by_
equipment
(
$pdo
,
$equipment
_id
)
{
$sql
=
'SELECT * FROM recipe WHERE
equipment
_id = ?;'
;
function
get_recipe_listall_by_
intervention
(
$pdo
,
$intervention
_id
)
{
$sql
=
'SELECT * FROM recipe WHERE
intervention
_id = ?;'
;
$stmt
=
$pdo
->
prepare
(
$sql
);
$stmt
->
execute
(
array
(
$
equipment
_id
));
$stmt
->
execute
(
array
(
$
intervention
_id
));
$result_fetch
=
$stmt
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
return
$result_fetch
;
}
...
...
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