Spaces:
Sleeping
Sleeping
Update app.py
Browse files57 unmodified lines58596061626364656657 unmodified lines# -----------------------------------------# ู ูุฏู ุงูุดูููelif st.session_state.user_type == "sender":st.title("๐จ ุชูุฏูู ุดููู")if "complaint_input" not in st.session_state:st.session_state["complaint_input"] = ""complaint_text = st.text_area("๐ ูุตู ุงูุดููู", key="complaint_input")if st.button("๐ค ุฅุฑุณุงู ุงูุดููู"):57 unmodified lines585960616263646566676869707172737475767778798081828384858687888990919257 unmodified lines# -----------------------------------------# ู ูุฏู ุงูุดูููelif st.session_state.user_type == "sender":complaint_text = st.text_area("๐ ูุตู ุงูุดููู", key="complaint_input")if st.button("๐ค ุฅุฑุณุงู ุงูุดููู"):existing_user_complaints = df[df["username"] == st.session_state.username]if st.session_state["complaint_input"].strip() in existing_user_complaints["complaint_text"].values:st.warning("โ ๏ธ ุชู ุฅุฑุณุงู ูุฐู ุงูุดููู ู ุณุจููุง!")elif st.session_state["complaint_input"].strip() == "":st.warning("โ ๏ธ ุงูุฑุฌุงุก ุฅุฏุฎุงู ูุต ุงูุดููู.")else:prefix = st.session_state.username[:4].lower()next_id = len(existing_user_complaints) + 1complaint_id = f"{prefix}_{next_id:06}"timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")new_complaint = {"complaint_id": complaint_id,"username": st.session_state.username,"complaint_text": st.session_state["complaint_input"].strip(),"status": "Pending","response": "","timestamp": timestamp}df = pd.concat([df, pd.DataFrame([new_complaint])], ignore_index=True)df.to_csv(file_path, index=False, encoding='utf-8-sig')st.success("โ ุชู ุชูุฏูู ุงูุดููู ุจูุฌุงุญ")# ุฅุนุงุฏุฉ ุชุนููู ุงูููู ุฉ ุนุจุฑ ุทุฑููุฉ rerun ุงูุขู ูุฉ:st.session_state["complaint_input"] = ""st.rerun()complaint_text = st.text_area("๐ ูุตู ุงูุดููู", key="complaint_input")if st.button("๐ค ุฅุฑุณุงู ุงูุดููู"):
app.py+28-2