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

login

parent d25baca8
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ import streamlit as st
import sqlite3
import datetime
# Connect to the database
conn = sqlite3.connect('C:\Users\neiro\Documents\GitHub\sgbd-usine\donnes\company.db')
conn = sqlite3.connect(r'C:\Users\neiro\Documents\GitHub\sgbd-usine\donnes\company.db')
cursor = conn.cursor()
# Set the title of the Streamlit app
st.title("Machine de Badgeage")
......
......@@ -21,7 +21,7 @@ if not st.session_state.logged_in:
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':
if result and (result[0] == 'RH' or result[0] == 'admin'):
st.session_state.logged_in = True
st.session_state.status = result[0]
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment