Spaces:
Sleeping
Sleeping
Update app.py
Browse files4 unmodified lines5678891022 unmodified lines33343537363738397 unmodified lines474849505152535455565758596061187 unmodified lines24925025125225325425525625713 unmodified lines2712722732632744 unmodified linesimport osimport shutilfrom dotenv import load_dotenvimport os
# تهيئة الصفحةst.set_page_config(page_title="نظام إدارة الشكاوى", layout="centered")22 unmodified lines ) """) # إنشاء جدول الشكاوى مع جميع الأعمدة المطلوبة # إنشاء جدول الشكاوى (لو مش موجود) conn.execute(""" CREATE TABLE IF NOT EXISTS complaints ( id INTEGER PRIMARY KEY AUTOINCREMENT,7 unmodified lines ) """) # ✅ التأكد من وجود عمود sender_comment (وإضافته لو ناقص) try: columns = [col[1] for col in conn.execute("PRAGMA table_info(complaints)").fetchall()] if "sender_comment" not in columns: conn.execute("ALTER TABLE complaints ADD COLUMN sender_comment TEXT DEFAULT ''") conn.commit() except Exception as e: st.error(f"⚠️ خطأ أثناء التأكد من الأعمدة: {e}") # إنشاء جدول معلومات قاعدة البيانات conn.execute(""" CREATE TABLE IF NOT EXISTS db_info (187 unmodified lines# الواجهة الرئيسيةdef main(): init_db() # تهيئة قاعدة البيانات
# ✅ طباعة مسار قاعدة البيانات للتأكد st.write("📂 Database path:", os.path.abspath("complaintsBD.db")) if not st.session_state.auth["is_logged_in"]: login_page()13 unmodified lines st.rerun()
if __name__ == "__main__": main() main()app.py+14-3