Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
legi
soft
gestex
Commits
58f92764
Commit
58f92764
authored
Sep 27, 2020
by
Gabriel Moreau
Browse files
Add equipement function and global comment
parent
69286b2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
module/db-functions.php
View file @
58f92764
...
...
@@ -65,6 +65,8 @@ function check_val_in_db($pdo, $table, $col, $value) {
return
false
;
}
// ---------------------------------------------------------------------
// Datasheet
// ---------------------------------------------------------------------
function
get_datasheet_listall_by_equipment
(
$pdo
,
$id_equipment
)
{
...
...
@@ -85,6 +87,8 @@ function get_datasheet_count_by_equipment($pdo, $id_equipment) {
return
$result_fetch
[
0
][
'count'
];
}
// ---------------------------------------------------------------------
// Equipment
// ---------------------------------------------------------------------
function
get_equipment_by_id
(
$pdo
,
$id
)
{
...
...
@@ -121,6 +125,31 @@ 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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);'
;
$stmt
=
$pdo
->
prepare
(
$sql
);
$stmt
->
execute
(
array
(
$categorie
,
$nom
,
$modele
,
$gamme
,
$equipe
,
$fourn
,
$achat
,
$tech
,
$reparation
,
$accessoires
,
$inventaire
,
$notice
,
$barcode
,
$loanable
));
return
$pdo
->
lastInsertId
();
}
// ---------------------------------------------------------------------
function
del_equipment
(
$pdo
,
$id
)
{
$sql
=
'DELETE LOW_PRIORITY FROM Listing WHERE id = ? LIMIT 1;'
;
$stmt
=
$pdo
->
prepare
(
$sql
);
$stmt
->
execute
(
array
(
$id
));
$result
=
$stmt
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
if
(
!
$result
)
return
false
;
else
return
true
;
}
// ---------------------------------------------------------------------
// Category
// ---------------------------------------------------------------------
function
get_category_by_id
(
$pdo
,
$id
)
{
$sql
=
'SELECT id, nom FROM categorie WHERE id = ?;'
;
$stmt
=
$pdo
->
prepare
(
$sql
);
...
...
@@ -166,6 +195,8 @@ function del_category_by_id($pdo, $id) {
return
$result_fetch
?
true
:
false
;
}
// ---------------------------------------------------------------------
// Loan
// ---------------------------------------------------------------------
function
get_loan_all_by_id_equipment
(
$pdo
,
$id_equipment
)
{
...
...
@@ -210,6 +241,8 @@ function set_loan_new($pdo, $id_equipment, $id_team, $date_begin, $date_end, $co
return
$pdo
->
lastInsertId
();
}
// ---------------------------------------------------------------------
// Supplier
// ---------------------------------------------------------------------
function
get_supplier_by_id
(
$pdo
,
$id
)
{
...
...
@@ -252,6 +285,8 @@ function get_supplier_find($pdo, $find='') {
return
$supplier_fetch
;
}
// ---------------------------------------------------------------------
// Team
// ---------------------------------------------------------------------
function
get_team_by_id
(
$pdo
,
$id
)
{
...
...
@@ -306,6 +341,8 @@ function get_team_with_appareil($pdo) {
return
$team_fetch
;
}
// ---------------------------------------------------------------------
// User
// ---------------------------------------------------------------------
function
get_user_by_id
(
$pdo
,
$id
)
{
...
...
@@ -357,6 +394,8 @@ function get_user_listall_by_logged_level($pdo, $logged_level) {
return
$result_fetch
;
}
// ---------------------------------------------------------------------
// Version
// ---------------------------------------------------------------------
function
get_version_by_name
(
$pdo
,
$name
)
{
...
...
Write
Preview
Markdown
is supported
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