����JFIF��`�`�����Viewing File: /home/u820193700/domains/throtllr.com/public_html/backend/fix_packages.php
<?php
$file = 'api/dealer/packages.php';
$content = file_get_contents($file);
$search = "\$pkg = \$pkg_res->fetch_assoc();";
$replace = "\$pkg = \$pkg_res->fetch_assoc();\n\n    // Check if any other dealer has already hosted this package on this specific date\n    \$check_sql = \"SELECT id FROM tours WHERE package_id = \$package_id AND start_date = '\$start_date' AND status != 'cancelled'\";\n    \$check_res = \$conn->query(\$check_sql);\n    if (\$check_res && \$check_res->num_rows > 0) {\n        send_json(['success' => false, 'message' => 'Another dealer is already hosting this package on this exact date. Please select a different start date.'], 400);\n    }";

if (strpos($content, $search) !== false) {
    if (strpos($content, 'Another dealer is already hosting this') === false) {
        $new_content = str_replace($search, $replace, $content);
        file_put_contents($file, $new_content);
        echo "Successfully patched packages.php\n";
    }
    else {
        echo "Already patched.\n";
    }
}
else {
    echo "Could not find target content.\n";
}
?>
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����