JezK
Edit File: scratch_db_update_files.php
<?php $filesToMove = [ 'test_booking.php', 'attendance.php', 'daily_log.php', 'invoice.php', 'patient_add.php', 'token.php', 'patient_search_ajax.php', 'ajax_get_sessions.php', 'ajax_get_all_sessions.php', 'ajax_check_warranty.php', 'record_payment_ajax.php' ]; $recDir = __DIR__ . '/receptionist/'; $opDir = __DIR__ . '/operator/'; foreach ($filesToMove as $file) { if (file_exists($recDir . $file)) { $content = file_get_contents($recDir . $file); // Update require_role calls $content = str_replace("'receptionist'", "'operator'", $content); $content = str_replace('"receptionist"', '"operator"', $content); // Update sidebar include $content = str_replace("sidebar_receptionist.php", "sidebar_operator.php", $content); // Update specific JS fetch urls if any (like in invoice.php) $content = str_replace("/receptionist/record_payment_ajax.php", "/operator/record_payment_ajax.php", $content); file_put_contents($opDir . $file, $content); echo "Moved and updated $file\n"; } }