Skip to content
Snippets Groups Projects
Commit 0bc5217b authored by Bouchaira Neirouz's avatar Bouchaira Neirouz
Browse files

resoudre problème data

parent 0dc51a82
No related branches found
No related tags found
No related merge requests found
......@@ -7,32 +7,20 @@ 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é"):
ui.h2("Création de compte employé")
with ui.card():
"Veuillez remplir les informations suivantes pour créer un compte employé"
# Connect to the database
conn = sqlite3.connect('C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db')
cursor = conn.cursor()
# Get the maximum employee number from the database
cursor.execute("SELECT MAX(NUMERO_EMPLOYE) FROM EMPLOYE")
max_numero_employe = cursor.fetchone()[0]
# Set the employee number to the next available number
if max_numero_employe is not None:
NUMERO_EMPLOYE = max_numero_employe + 1
else:
NUMERO_EMPLOYE= 1
# Employee name
ui.input_text("Nom", "NOM")
conn.commit()
conn.close()
with ui.nav_panel("Suivi des employés"):
@render.data_frame
def suivi():
conn = sqlite3.connect('C:/Users/neiro/Documents/GitHub/sgbd-usine/donnees/company.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM EMPLOYE")
return pd.DataFrame(cursor.fetchall(), columns=[x[0] for x in cursor.description])
return data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment