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
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
d0a20c1d
Commit
d0a20c1d
authored
4 months ago
by
Bouchaira Neirouz
Browse files
Options
Downloads
Patches
Plain Diff
access_control
parent
06e29e90
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
access_control.db
+0
-0
0 additions, 0 deletions
access_control.db
streamlit_app.py
+280
-254
280 additions, 254 deletions
streamlit_app.py
with
280 additions
and
254 deletions
access_control.db
0 → 100644
+
0
−
0
View file @
d0a20c1d
This diff is collapsed.
Click to expand it.
streamlit_app.py
+
280
−
254
View file @
d0a20c1d
...
...
@@ -5,6 +5,32 @@ import pandas as pd
import
numpy
as
np
# Add this line to import numpy
st
.
title
(
"
Page de gestion des employés
"
)
st
.
write
(
"
Bienvenue!😃
"
)
# Connect to the access control database
conn
=
sqlite3
.
connect
(
'
donnees/access_control.db
'
)
cursor
=
conn
.
cursor
()
if
'
logged_in
'
not
in
st
.
session_state
:
st
.
session_state
.
logged_in
=
False
if
not
st
.
session_state
.
logged_in
:
# Create a login form
st
.
header
(
"
Login
"
)
employee_code
=
st
.
text_input
(
"
Code Employé
"
)
mot_de_passe
=
st
.
text_input
(
"
Mot de passe
"
,
type
=
"
password
"
)
login_button
=
st
.
button
(
"
Login
"
)
if
login_button
:
cursor
.
execute
(
"
SELECT status FROM employees WHERE employee_code = ? AND mot_de_passe = ?
"
,
(
employee_code
,
mot_de_passe
))
result
=
cursor
.
fetchone
()
if
result
and
result
[
0
]
==
'
RH
'
:
st
.
session_state
.
logged_in
=
True
st
.
session_state
.
status
=
result
[
0
]
else
:
st
.
error
(
"
Accès refusé. Veuillez vérifier vos informations de connexion.
"
)
conn
.
close
()
# Check if the user is logged in and has the correct status
if
'
logged_in
'
in
st
.
session_state
and
st
.
session_state
.
logged_in
:
if
'
page
'
not
in
st
.
session_state
:
st
.
session_state
.
page
=
None
...
...
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