Spaces:
Sleeping
Sleeping
Update app.py
Browse files64 unmodified lines65666768686970715 unmodified lines77787980808182838485858687888889909164 unmodified lines# مقدم الشكوىelif st.session_state.user_type == "sender": st.title("📨 إرسال شكوى جديدة") st.session_state.complaint_input = st.text_area("📝 وصف الشكوى", value=st.session_state.complaint_input, key="complaint_input") complaint_text = st.text_area("📝 وصف الشكوى", value=st.session_state.complaint_input, key="complaint_input")
if st.button("📤 إرسال الشكوى"): c.execute("SELECT * FROM complaints WHERE username=?", (st.session_state.username,))5 unmodified lines c.execute("SELECT * FROM complaints WHERE complaint_id=?", (complaint_id,)) if c.fetchone(): st.warning("⚠️ تم إرسال هذه الشكوى مسبقًا بناءً على المعرف!") elif st.session_state.complaint_input.strip() == "": elif complaint_text.strip() == "": st.warning("⚠️ الرجاء إدخال نص الشكوى.") else: timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") c.execute("INSERT INTO complaints (complaint_id, username, complaint_text, status, response, timestamp, user_comment) VALUES (?, ?, ?, ?, ?, ?, ?)", (complaint_id, st.session_state.username, st.session_state.complaint_input.strip(), "Pending", "", timestamp, "")) (complaint_id, st.session_state.username, complaint_text.strip(), "Pending", "", timestamp, "")) conn.commit() st.success("✅ تم تقديم الشكوى بنجاح") st.session_state.complaint_input = "" # مسح الصندوق st.session_state.complaint_input = "" # مسح محتوى الصندوق st.rerun()
st.subheader("📋 الشكاوى السابقة")app.py+4-4