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
4544f2cf
Commit
4544f2cf
authored
8 months ago
by
Bouchaira Neirouz
Browse files
Options
Downloads
Patches
Plain Diff
application shiny
parent
0bc5217b
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/shiny_app.py
+17
-11
17 additions, 11 deletions
code_interface/shiny_app.py
with
17 additions
and
11 deletions
code_interface/shiny_app.py
+
17
−
11
View file @
4544f2cf
...
...
@@ -6,21 +6,27 @@ import pandas as pd
from
datetime
import
datetime
# Connect to the database
conn
=
sqlite3
.
connect
(
'
C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db
'
)
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"
SELECT * FROM EMPLOYE
"
)
data
=
pd
.
DataFrame
(
cursor
.
fetchall
(),
columns
=
[
x
[
0
]
for
x
in
cursor
.
description
])
ui
.
page_opts
(
title
=
"
Bienvenue à la page RH
"
,
fillable
=
True
)
with
ui
.
nav_panel
(
"
Création de compte employé
"
):
conn
=
sqlite3
.
connect
(
'
C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db
'
)
cursor
=
conn
.
cursor
()
with
ui
.
card
():
ui
.
h2
(
"
Création de compte employé
"
)
# Set the employee number to the next available number
# Employee name
conn
=
sqlite3
.
connect
(
'
C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db
'
)
cursor
=
conn
.
cursor
()
res
=
cursor
.
execute
(
"
SELECT MAX(NUMERO_EMPLOYE) FROM EMPLOYE
"
)
ui
.
input_text
(
"
Nom
"
,
"
NOM
"
)
conn
.
commit
()
conn
.
close
()
with
ui
.
nav_panel
(
"
Suivi des employés
"
):
@render.data_frame
def
suivi
():
conn1
=
sqlite3
.
connect
(
'
C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db
'
)
cursor
=
conn1
.
cursor
()
res
=
cursor
.
execute
(
"
SELECT * FROM EMPLOYE
"
)
data
=
pd
.
DataFrame
(
res
.
fetchall
(),
columns
=
[
x
[
0
]
for
x
in
cursor
.
description
])
return
data
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