<?php
$networkDrive = '\\\\hq_base\\shared_home\\GOPOOLS\\CRM\\Final\\v1.3.0_Cumulative_Update';
$localPath = 'c:\\xampp\\htdocs\\gopools';

$files = [
    'public/projects/edit.php',
    'public/partners/my_jobs.php',
    'public/employees/my_jobs.php',
    'public/employees/my_work.php',
    'public/employees/job_action.php',
    'public/customers/my_warranties.php',
    'public/api/upload_job_photo.php',
    'app/helpers/weather_helper.php',
    'app/helpers/common.php',
    'app/core/bootstrap.php',
    'public/api/geocode_dist.php',
    'public/projects/map.php',
    'public/api/save_pool_specs.php',
    'public/api/visit_add.php',
    'public/api/visit_delete.php',
    'public/api/project_visit_actions.php',
    'app/core/translations.php',
    'public/projects/index.php',
    'public/dashboard/index.php',
    'public/api/calendar_events.php',
    'public/api/assistant_status.php'
];

foreach ($files as $file) {
    $src = $localPath . '\\' . str_replace('/', '\\', $file);
    $dest = $networkDrive . '\\' . str_replace('/', '\\', $file);
    
    // Create directory if it doesn't exist
    $dir = dirname($dest);
    if (!is_dir($dir)) {
        mkdir($dir, 0777, true);
    }
    
    if (file_exists($src)) {
        if (copy($src, $dest)) {
            echo "Copied: $file\n";
        } else {
            echo "Failed to copy: $file\n";
        }
    } else {
        echo "File does not exist locally: $file\n";
    }
}
echo "Done!\n";
