import os file_path = os.path.expanduser("~/EGYshot/templates/wallet.html") with open(file_path, "r", encoding="utf-8") as f: code = f.read() # الكود الذي سيتم إضافته (زر الإدارة) admin_button = ''' {% if session.get("user_id") == "admin@egyshot.com" %}
⚙️ إدارة الحسابات والأرصدة
{% endif %} ''' if 'href="/admin"' not in code: # إضافته قبل إغلاق body if '' in code: code = code.replace('', admin_button + '\n') with open(file_path, "w", encoding="utf-8") as f: f.write(code) print("✅ تم إضافة زر الإدارة إلى wallet.html") else: print("⚠️ الزر موجود بالفعل.")