Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Database Management System Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bouchaira Neirouz
Database Management System Project
Commits
d843ce3c
Commit
d843ce3c
authored
6 months ago
by
Bouchaira Neirouz
Browse files
Options
Downloads
Patches
Plain Diff
yess
parent
b6c14ed7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
streamlit_app.py
+11
-11
11 additions, 11 deletions
streamlit_app.py
with
11 additions
and
11 deletions
streamlit_app.py
+
11
−
11
View file @
d843ce3c
...
...
@@ -52,10 +52,10 @@ if 'logged_in' in st.session_state and st.session_state.logged_in:
if
total
:
# Add code for "Suivi Employés" page here
st
.
write
(
"
Salaires des employés par semaine (question 1)
"
)
st
.
dataframe
(
df
)
st
.
dataframe
(
df
,
hide_index
=
True
)
if
dimin
:
st
.
write
(
"
Salaires des employés ayant eu une diminution par semaine (question 3)
"
)
st
.
dataframe
(
df
[
df
[
'
Salaire avant primes
'
]
<
df
[
'
Salaire base
'
]])
st
.
dataframe
(
df
[
df
[
'
Salaire avant primes
'
]
<
df
[
'
Salaire base
'
]]
,
hide_index
=
True
)
conn
.
close
()
with
tab2
:
...
...
@@ -73,17 +73,17 @@ if 'logged_in' in st.session_state and st.session_state.logged_in:
df
=
df
[(
today
-
df
[
'
DATE_DEBUT
'
]).
dt
.
days
>
3
*
365
]
df
.
columns
=
[
'
Numéro employé
'
,
'
Nom
'
,
'
Prénom
'
,
'
Type du contrat
'
,
'
Date de début
'
]
st
.
write
(
"
Liste des employés journaliers (question 2)
"
)
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
1
])
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
1
]
,
hide_index
=
True
)
st
.
write
(
"
Liste des employés par production
"
)
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
2
])
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
2
]
,
hide_index
=
True
)
else
:
df
.
columns
=
[
'
Numéro employé
'
,
'
Nom
'
,
'
Prénom
'
,
'
Type du contrat
'
,
'
Date de début
'
]
st
.
header
(
"
Liste de la totalité des employés
"
)
st
.
write
(
"
Liste des employés journaliers
"
)
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
1
])
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
1
]
,
hide_index
=
True
)
st
.
write
(
"
Liste des employés par production
"
)
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
2
])
st
.
dataframe
(
df
[
df
[
'
Type du contrat
'
]
==
2
]
,
hide_index
=
True
)
with
tab3
:
conn
=
sqlite3
.
connect
(
r
'
donnees/company.db
'
)
...
...
@@ -100,7 +100,7 @@ if 'logged_in' in st.session_state and st.session_state.logged_in:
cursor
.
execute
(
"
SELECT DATE_LUNDI, NB_HEURES FROM SALAIRE_SEMAINE WHERE NUMERO_EMPLOYE = ?
"
,
(
int
(
employe
.
split
(
"
-
"
)[
0
]),))
df
=
pd
.
DataFrame
(
cursor
.
fetchall
(),
columns
=
[
desc
[
0
]
for
desc
in
cursor
.
description
])
st
.
write
(
"
Nombre d
'
heures travaillées par semaine pour l
'
employé sélectionné
"
)
st
.
dataframe
(
df
)
st
.
dataframe
(
df
,
hide_index
=
True
)
import
matplotlib.pyplot
as
plt
# Filter the last 10 weeks
...
...
@@ -127,7 +127,7 @@ if 'logged_in' in st.session_state and st.session_state.logged_in:
cursor
.
execute
(
"
SELECT DATE_LUNDI, NB_PRODUCTION FROM SALAIRE_SEMAINE WHERE NUMERO_EMPLOYE = ?
"
,
(
int
(
employe
.
split
(
"
-
"
)[
0
]),))
df
=
pd
.
DataFrame
(
cursor
.
fetchall
(),
columns
=
[
desc
[
0
]
for
desc
in
cursor
.
description
])
st
.
write
(
"
Nombre de production par semaine pour l
'
employé sélectionné (question 4)
"
)
st
.
dataframe
(
df
)
st
.
dataframe
(
df
,
hide_index
=
True
)
import
matplotlib.pyplot
as
plt
# Filter the last 10 weeks
...
...
@@ -243,13 +243,13 @@ if 'logged_in' in st.session_state and st.session_state.logged_in:
selections
=
{
option
:
st
.
checkbox
(
option
)
for
option
in
options
}
if
selections
[
"
Primes de Noël partielles
"
]:
st
.
write
(
"
Primes de Noël 2025 partielles (question 6)
"
)
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime Noël partielles
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime Noël partielles
"
]])
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime Noël partielles
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime Noël partielles
"
]]
,
hide_index
=
True
)
if
selections
[
"
Primes de Noël complètes
"
]:
st
.
write
(
"
Primes de Noël 2025 complètes (question 5/7)
"
)
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime Noël
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime Noël
"
]])
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime Noël
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime Noël
"
]]
,
hide_index
=
True
)
if
selections
[
"
Primes d
'
anniversaire
"
]:
st
.
write
(
"
Primes d
'
anniversaire (question 5)
"
)
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime anniversaire
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime anniversaire
"
]])
st
.
dataframe
(
Bonus
[
Bonus
[
'
Prime anniversaire
'
]
>
0
][[
"
Lundi
"
,
"
Numéro employé
"
,
"
Nom
"
,
"
Prénom
"
,
"
Date de début
"
,
"
Prime anniversaire
"
]]
,
hide_index
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment