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

interface

parent e87e368f
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment