\s*)"""
content = re.sub(col_lg_4_cycles, r'\n\1\n', content, flags=re.DOTALL)
# Adjust col-lg-8 to be conditionally 12
content = re.sub(r'
', r'
', content)
# Check POST handler for cycles in approved_school.php
post_handler = r"if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['cycle_action'])) {"
post_handler_new = r"""if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['cycle_action'])) {
if (!is_super_admin()) {
set_flash('error', 'عذراً، الإدارة الكاملة للدورات متاحة للمشرف العام فقط.');
header('Location: approved_school.php?id=' . $application['id']);
exit;
}"""
content = content.replace(post_handler, post_handler_new)
with open('approved_school.php', 'w', encoding='utf-8') as f:
f.write(content)