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
1e706c8e
Commit
1e706c8e
authored
7 months ago
by
Bouchaira Neirouz
Browse files
Options
Downloads
Patches
Plain Diff
interface
parent
e87e368f
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
code_interface/streamlit_app.py
+6
-15
6 additions, 15 deletions
code_interface/streamlit_app.py
with
6 additions
and
15 deletions
code_interface/streamlit_app.py
+
6
−
15
View file @
1e706c8e
...
...
@@ -2,28 +2,19 @@ import streamlit as st
from
datetime
import
date
import
sqlite3
import
pandas
as
pd
import
numpy
as
np
# Add this line to import numpy
# Initialize session state for page if not already set
if
'
page
'
not
in
st
.
session_state
:
st
.
session_state
.
page
=
None
tab1
,
tab2
,
tab3
=
st
.
tabs
([
"
Suivi des employés
"
,
"
Création d
'
un compte employé
"
,
"
Bonus
"
])
# Add a button to navigate to "Suivi Employés" page
col1
,
col2
=
st
.
columns
(
2
)
with
col1
:
if
st
.
button
(
"
Suivi des employés
"
):
st
.
session_state
.
page
=
"
suivi_employes
"
with
col2
:
if
st
.
button
(
"
Création d
'
un compte employé
"
):
st
.
session_state
.
page
=
"
creation_compte_employe
"
page
=
st
.
session_state
.
page
if
page
==
"
suivi_employes
"
:
with
tab1
:
st
.
title
(
"
Suivi Employés
"
)
# Add code for "Suivi Employés" page here
st
.
write
(
"
Page de suivi des employés
"
)
# Connect to the database
with
sqlite3
.
connect
(
'
donnees\company.db
'
)
as
conn
:
with
sqlite3
.
connect
(
r
'
donnees\company.db
'
)
as
conn
:
# Use raw string
cursor
=
conn
.
cursor
()
# Fetch all employee records
cursor
.
execute
(
"
SELECT * FROM EMPLOYE
"
)
...
...
@@ -34,11 +25,11 @@ if page == "suivi_employes":
st
.
dataframe
(
df
)
st
.
stop
()
if
page
==
"
creation_compte_employe
"
:
with
tab2
:
st
.
title
(
"
Création de compte employé
"
)
# Connect to the database
with
sqlite3
.
connect
(
'
donnees\company.db
'
)
as
conn
:
with
sqlite3
.
connect
(
r
'
donnees\company.db
'
)
as
conn
:
# Use raw string
cursor
=
conn
.
cursor
()
# Get the maximum employee number from the database
cursor
.
execute
(
"
SELECT MAX(NUMERO_EMPLOYE) FROM EMPLOYE
"
)
...
...
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