import re import glob files = ['students.php', 'teachers.php', 'assessments.php', 'attendance.php'] for file in files: with open(file, 'r', encoding='utf-8') as f: content = f.read() # Change
to conditionally be 12 # But wait, is it col-lg-7? content = re.sub(r'
', r'
# #
pattern = r'(
\s*\s*
)' def replacer(match): return f"\n{match.group(1)}\n" content = re.sub(pattern, replacer, content, flags=re.DOTALL) # Also restrict the button "إدارة الدورات الموسمية" # إدارة الدورات الموسمية # We should hide this button for center_admin btn_pattern = r'(إدارة الدورات الموسمية)' content = re.sub(btn_pattern, r'\1', content) with open(file, 'w', encoding='utf-8') as f: f.write(content)