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
27d53bd0
Commit
27d53bd0
authored
Jul 08, 2021
by
Estéban Ristich
Browse files
Fix Issue
#65
some bug
parent
434e448d
Changes
1
Hide whitespace changes
Inline
Side-by-side
loan-process.php
View file @
27d53bd0
...
...
@@ -48,6 +48,13 @@ $pdo = connect_db_or_alert();
if
(
$param_mode
==
"loan"
||
$param_mode
==
"booking"
)
{
$day_diff
=
$date_out_rtn
-
$date_out_ymd
;
$day_diff
=
intval
(
date
(
'd'
,
$day_diff
));
if
(
$loan_id
>
0
)
{
$equipment_max_day
=
get_equipment_all_by_id
(
$pdo
,
get_equipment_by_loan_id
(
$pdo
,
$loan_id
))[
"max_loan_day"
];
}
else
{
$equipment_max_day
=
get_equipment_all_by_id
(
$pdo
,
$equipment_id
)[
"max_loan_day"
];
}
# var_dump('EQUIPEMENT ID : '.$equipment_id);
# var_dump('LOAN ID : '.$loan_id);
$equipment_max_day
=
get_equipment_all_by_id
(
$pdo
,
$equipment_id
)[
"max_loan_day"
];
if
(
$equipment_max_day
!=
0
)
{
if
(
$day_diff
>
$equipment_max_day
)
...
...
@@ -62,7 +69,7 @@ if ($loan_id > 0)
if
(
!
empty
(
$erreur
))
{
//erreur
$title
=
'Erreur sur l\'emprunt'
;
$action
=
'loan-edit.php?id='
.
$loan_id
.
'mode=edit'
;
$action
=
'loan-edit.php?id='
.
$loan_id
.
'
&
mode=edit'
;
if
(
$param_mode
==
'booking'
)
$action
=
'loan-edit.php?equipment='
.
$equipment_id
.
'&mode='
.
$param_mode
;
$message_text
=
$erreur
;
...
...
@@ -133,7 +140,9 @@ if ($param_mode == "booking") {
}
}
else
if
(
$param_mode
==
'loan'
)
{
if
(
get_loan_all_by_id
(
$pdo
,
$loan_id
)[
"status"
]
==
STATUS_LOAN_RESERVED
)
{
if
(
$loan_id
>
0
&&
get_loan_all_by_id
(
$pdo
,
$loan_id
)[
"status"
]
==
STATUS_LOAN_RESERVED
)
{
if
(
get_loans_all_by_equipment_borrowed
(
$pdo
,
get_equipment_by_loan_id
(
$pdo
,
$loan_id
))
==
false
)
{
set_loan_update_to_borrowed
(
$pdo
,
$loan_id
);
$message_text
=
'Votre réservation a bien été enregistré comme emprunt'
;
...
...
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