<?php
require('include/functions.php');

// Search Settings
echo "Searching sb_settings...\n";
$res = sb_db_get("SELECT * FROM sb_settings WHERE value LIKE '%سيقوم أحد الأطباء%'", false);
if ($res) {
    print_r($res);
} else {
    echo "Not found in settings.\n";
}

// Check all Flows (raw)
echo "Searching sb_settings for Flows (json)...\n";
// Flows are usually in 'sb-flows' setting?? Or separate table?
// sb_flows_get() usually does: $flows = sb_get_setting('flows');
// Let's check 'flows'.
$flows_setting = sb_get_setting('flows');
if ($flows_setting) {
    echo "Found 'flows' setting. Length: " . strlen(json_encode($flows_setting)) . "\n";
    if (strpos(json_encode($flows_setting, JSON_UNESCAPED_UNICODE), "سيقوم أحد الأطباء") !== false) {
        echo "FOUND in 'flows' setting!\n";
    } else {
        echo "NOT FOUND in 'flows' setting.\n";
    }
}
?>
