I have a procedural PHP project. Here is the code of one of the file 'jobdesk.php':

<?php
    include "includes/config.php";
    include "includes/commonVariables.php";
    include "includes/commonFunctions.php";

    $autoAssignControlFileName = BASE_URL . 'autoassigncontrol.json';
    $autoAssignControl = json_decode(file_get_contents($autoAssignControlFileName), true);

    if ($autoAssignControl === FALSE) {
        sleep(1);
        $autoAssignControl = json_decode(file_get_contents($autoAssignControlFileName), true);
    }

    $autoAssignStart = $autoAssignControl['autoAssign'];
    $productAutoAssignStart = $autoAssignControl['productAutoAssign'];
    $variantAutoAssignStart = $autoAssignControl['variantAutoAssign'];

    $wait_timeout_Query = "SET session wait_timeout=28800";
    $set_wait_timeout = mysqli_query($conn, $wait_timeout_Query);
    $interactive_timeout_Query = "SET session interactive_timeout=28800";
    $set_interactive_timeout = mysqli_query($conn, $interactive_timeout_Query);

    $dataArray = array("artist_username" => "parag");
    $dataJSON = json_encode($dataArray);
    $jobDeskResponseJSON = callSingleThreadAll3dAPI($jobDeskClass, $dataJSON);

    $jobDeskResponse = json_decode($jobDeskResponseJSON, true);

    if (array_key_exists("errorMessage", $jobDeskResponse)) {
        $errorMessage = "❗️ <strong><u>Job desk API call returned error.</u></strong> ❗️\n";
        $errorMessage .= "<code><strong>Error message:</strong> " . $jobDeskResponse["errorMessage"] . "</code>\n";
        $errorMessageData = [
            "chat_id" => $QuickResponseBotChatId,
            "text" => $errorMessage,
            "parse_mode" => "HTML",
            "disable_notification" => true
        ];
        curl_get_contents("https://api.telegram.org/bot" . $QuickResponseBotToken . "/sendMessage?" . http_build_query($errorMessageData));

        exit("Job desk API call returned error.\n");
    }

    if (empty($jobDeskResponse["products"])) {
        exit("No products found in job desk.\n");
    }

    foreach ($jobDeskResponse["products"] as $product) {
        $id = $product["id"];

        $checkEntry = "SELECT * FROM `jobdesk` WHERE `id` = '" . $id . "' AND DATE(`timestamp`) BETWEEN '" . $yesterday . "' AND '" . $today . "'";
        $checkResult = mysqli_query($conn, $checkEntry);
        $checkRow = mysqli_num_rows($checkResult);

        if ($checkRow === 0) {
            $autoAssignStatus = 0;
            $containsZip = 0;

            // Get detailed information
            $detailDataArray = array("product_id" => "" . $id . "");
            $detailDataJSON = json_encode($detailDataArray);
            $detailDataResponseJSON = callSingleThreadAll3dAPI($productGetClass, $detailDataJSON);
            $detailDataResponse = json_decode($detailDataResponseJSON, true);
            // End detailed information

            // Get materials
            $materialsArray = array();
            if (!empty($detailDataResponse['materials'])) {
                $materialsArray = $detailDataResponse['materials'];
                $materials = implode(', ', $materialsArray);
            } else {
                $materials = $product["name"] . ', ' . $product["category"];
            }
            // End materials

            // Check if it has zip file
            if (!empty($detailDataResponse['raw_files'])) {
                foreach ($detailDataResponse['raw_files'] as $rawFile) {
                    if ($rawFile['type'] === 'application/zip') {
                        $containsZip = 1;
                    };
                }
            }
            // zip file check completes

            // Check if "Bed with Bedding" is TRUE
            if (array_key_exists("category_type", $detailDataResponse) && !empty($detailDataResponse['category_type'])) {
                if ($detailDataResponse['category_type'] == "Bed with Bedding") {
                    $bedWithBedding = TRUE;
                } else {
                    $bedWithBedding = FALSE;
                }
            } else {
                $bedWithBedding = FALSE;
            }
            // Bed check completes

            $name = $product["name"];
            $category = $product["category"];
            $model_status = $product["model_status"];
            $output_requirement = ($product["need_to_model"] === NULL || empty($product["need_to_model"])) ? $product["model_type"] : $product["need_to_model"];
            $customer_username = $product["customer_username"];
            $created_on = $product["created_on"];
            $last_modified = $product["last_modified"];
            $variant_of = ($product["variant_of"] != NULL || !empty($product["variant_of"])) ? $product["variant_of"] : "";
            $variation_type = ($product["variation_type"] != NULL || !empty($product["variation_type"])) ? $product["variation_type"] : "--";
            $name = filter_var($name, FILTER_SANITIZE_FULL_SPECIAL_CHARS);

            $output_requirement = outputRequirement($output_requirement);
            $model_statusHR = modelStatus($model_status);
            $model_statusHR = ($model_statusHR === "Pending") ? "🏆 New" : "♻️ Rework";

            $task_type = (empty($product["variant_of"]) || is_null($product["variant_of"])) ? "Product" : "Variant";
            $task_typeHR = ($task_type === "Product") ? "🌕 <strong>Product</strong>" : "🌗 Variant";

            $message = "<strong>ID:</strong> <code>" . $id . "</code>\n";
            $message .= "<strong>Name:</strong> " . $name . "\n";
            $message .= "<strong>Category:</strong> " . $category . "\n";
            $message .= "<strong>Materials:</strong> " . $materials . "\n";
            $message .= "<strong>Task Type:</strong> " . $task_typeHR . "\n";
            $message .= "<strong>Task Status:</strong> " . $model_statusHR . "\n";
            $message .= "<strong>Output Requirement:</strong> " . $output_requirement . "\n";
            $message .= "<strong>Customer Username:</strong> " . $customer_username . "\n";
            if ($task_type === "Variant") {
                $message .= "<strong>Variant Of:</strong> <a href='https://app.all3d.ai/product-details/" . $variant_of . "'>" . $variant_of . "</a>\n";
                $message .= "<strong>Variation Type:</strong> " . $variation_type . "\n";
            }
            if (intval($productAutoAssignStart) === 1 && intval($variantAutoAssignStart) === 0) {
                $autoAssignType = ($task_type === "Product");
                $disabledType = "VARIANT";
            } elseif (intval($variantAutoAssignStart) === 1 && intval($productAutoAssignStart) === 0) {
                $autoAssignType = ($task_type === "Variant");
                $disabledType = "PRODUCT";
            } elseif (intval($productAutoAssignStart) === 1 && intval($variantAutoAssignStart) === 1) {
                $autoAssignType = ($task_type === "Product" || $task_type === "Variant");
            } else {
                $autoAssignStart === 0;
            }

            $message .= "<strong><a href='https://app.all3d.ai/product_guidelines/" . $id . "'>See Details</a></strong>\n";

            // Initialize an empty array to store the keyboard buttons
            $keyboardButtons = [];
            // Add the existing button to the keyboard buttons array
            $keyboardButtons[] = [
                [
                    'text' => '🖼 See Photos',
                    'url' => BASE_URL . 'preview.html?id=' . $id
                ]
            ];

            // Get the contents of the JSON file
            $categoriesListJSON = file_get_contents(BASE_URL . "categorieslist.json");
            $artistsAccountStatusJSON = file_get_contents(BASE_URL . "accountsstatusupdate.json");
            // Decode the JSON data into an associative array
            $categoriesList = json_decode($categoriesListJSON, true);
            $artistsAccountStatus = json_decode($artistsAccountStatusJSON, true);
            $artistsAccountStatus = randomizeArray($artistsAccountStatus);
            // Get the selected categories from the JSON data
            $selectedCategories = array();
            foreach ($categoriesList as $categoryList) {
                if ($categoryList['selected'] == 1) {
                    $selectedCategories[] = $categoryList['name'];
                }
            }
            // Iterate through each key-value pair in the JSON data
            foreach ($artistsAccountStatus as $account => $status) {
                // Check the status of the account
                if ($status === 0) {
                    // AUTO ASSIGN CODE STARTS HERE
                    if (intval($autoAssignStart) === 1) { // If auto assign is enabled
                        if ($autoAssignStatus === 0) { // If it is not already auto assigned
                            if (intval($model_status) === 2) { // If it is new task, not rework (i.e. model_status = 2)
                                if ($bedWithBedding === FALSE || $variation_type != "state") { // If it is not a bed with bedding or variation type is state
                                    if ($autoAssignType) { // Product/Variant type check
                                        if (in_array($category, $selectedCategories)) {
                                            if (str_contains(strtolower($name), 'test') === false && $customer_username != "faizan42" && $customer_username != "meharfatimakhan" && $customer_username != "ashredmond" && $customer_username != "abd_goall3d" && $customer_username != "kolson") { // If it is not a test product
                                                if (str_contains(strtolower($name), "rattan") === false || str_contains(strtolower($name), "wicker") === false && str_contains(strtolower($name), 'reclin') === false && str_contains(strtolower($name), 'woven') === false) { // If it is not a rattan or wicker or recliner
                                                    $materialArray = array("rattan", "wicker", "seagrass", "jute");
                                                    $material = '/\b(' . implode('|', array_map('preg_quote', $materialArray)) . ')\b/i';
                                                    if (preg_match($material, $materials) === 0) { // If material is not a rattan or wicker
                                                        $parameters = "username=" . $account . "&product_id=" . $id;
                                                        $parameters = escapeshellarg($parameters); // must use escapeshellarg()
                                                        exec($php_path . ' httpdocs/all3d/autoassign.php ' . $parameters . " > /dev/null &"); // $pars is the parameter string
                                                        $autoAssignStatus = 1;
                                                        $autoAssignMessage = "Successfully <strong>auto assigned</strong> to " . ucfirst($account);
                                                    } else {
                                                        $autoAssignMessage = "Didn't auto assigned because of RATTAN or WICKER material.";
                                                    }
                                                } else {
                                                    $autoAssignMessage = "Didn't auto assigned because of RATTAN or WICKER or WOVEN or RECLINER product.";
                                                }
                                            } else {
                                                $autoAssignMessage = "Didn't auto assigned due to TEST product or UNWANTED client.";
                                            }
                                        } else {
                                            $autoAssignMessage = "Didn't auto assigned due to " . $category . " category is not selected.";
                                        }
                                    } else {
                                        $autoAssignMessage = $disabledType . " auto assign is disabled.";
                                    }
                                } else {
                                    $autoAssignMessage = "Didn't auto assigned because it is 'Bed With Bedding' or Variation type is 'State'.";
                                }
                            } else {
                                $autoAssignMessage = "Didn't auto assigned due to REWORK task.";
                            }
                        }
                    } else {
                        $autoAssignMessage = "Auto assign is disabled.";
                    }

                    // Auto assign if it has ZIP file attached
                    if ($autoAssignStatus === 0) { // If it is not already auto assigned
                        if (intval($model_status) === 2) { // If it is new task, not rework (i.e. model_status = 2)
                            if (intval($containsZip) === 1) {
                                $parameters = "username=" . $account . "&product_id=" . $id;
                                $parameters = escapeshellarg($parameters); // must use escapeshellarg()
                                exec($php_path . ' httpdocs/all3d/autoassign.php ' . $parameters . " > /dev/null &"); // $pars is the parameter string
                                $autoAssignStatus = 1;
                                $autoAssignMessage = "Successfully <strong>auto assigned</strong> to " . ucfirst($account) . " because it has ZIP file attached.";
                            } else {
                                if (intval($autoAssignStart) === 0) {
                                    $autoAssignMessage = "Didn't auto assigned because it has no ZIP file and auto assign is disabled.";
                                }
                            }
                        } else {
                            if (intval($autoAssignStart) === 0) {
                                $autoAssignMessage = "Didn't auto assigned ZIP file attached due to REWORK task.";
                            }
                        }
                    }

                    // Auto assign if Wall Art
                    if ($autoAssignStatus === 0) { // If it is not already auto assigned
                        if (intval($model_status) === 2) { // If it is new task, not rework (i.e. model_status = 2)
                            if ($category === "Wall Art" || $category === "Canvas & Wall Decor" || $category === "CANVAS ART" || $category === "FRAMED CANVAS ART") {
                                $materialArray = array("paper", "canvas", "wood", "acrylic");

                                $material = '/\b(' . implode('|', array_map('preg_quote', $materialArray)) . ')\b/i';
                                if (preg_match($material, $materials)) {
                                    $parameters = "username=" . $account . "&product_id=" . $id;
                                    $parameters = escapeshellarg($parameters); // must use escapeshellarg()
                                    exec($php_path . ' httpdocs/all3d/autoassign.php ' . $parameters . " > /dev/null &"); // $pars is the parameter string
                                    $autoAssignStatus = 1;
                                    $autoAssignMessage = "Successfully <strong>auto assigned</strong> WALL ART to " . ucfirst($account);
                                } else {
                                    $autoAssignMessage = "Didn't auto assigned WALL ART because it contains " . $materials . " materials.";
                                }
                            }
                        } else {
                            if (intval($autoAssignStart) === 0) {
                                $autoAssignMessage = "Didn't auto assigned WALL ART due to REWORK task.";
                            }
                        }
                    }

                    // Auto assign if SIZE Variant
                    if ($autoAssignStatus === 0) { // If it is not already auto assigned
                        if (intval($model_status) === 2) { // If it is new task, not rework (i.e. model_status = 2)
                            if ($task_type === "Variant" && $variation_type === "size") {
                                $skipCategoryArray = array("Sectional Sofas", "Recliners", "Outdoor Sofas & Loveseats");

                                if (!in_array($category, $skipCategoryArray)) {
                                    $parameters = "username=" . $account . "&product_id=" . $id;
                                    $parameters = escapeshellarg($parameters); // must use escapeshellarg()
                                    exec($php_path . ' httpdocs/all3d/autoassign.php ' . $parameters . " > /dev/null &"); // $pars is the parameter string
                                    $autoAssignStatus = 1;
                                    $autoAssignMessage = "Successfully <strong>auto assigned</strong> SIZE Variant to " . ucfirst($account);
                                } else {
                                    $autoAssignMessage = "Didn't auto assigned SIZE Variant because it is " . $category . ".";
                                }
                            }
                        } else {
                            if (intval($autoAssignStart) === 0) {
                                $autoAssignMessage = "Didn't auto assigned SIZE Variant due to REWORK task.";
                            }
                        }
                    }
                    // AUTO ASSIGN CODE ENDS HERE

                    // Add a new button for the artist if the status is 0
                    if (str_contains(strtolower($name), 'test') === false && $customer_username != "faizan42" && $customer_username != "meharfatimakhan" && $customer_username != "ashredmond" && $customer_username != "abd_goall3d") { // If it is not a test product
                        $keyboardButtons[] = [
                            [
                                'text' => "Assign to " . ucfirst($account),
                                'url' => BASE_URL . "assigntoself.php?username=" . $account . "&product_id=" . $id
                            ]
                        ];
                    }
                }
            }

            if (isset($autoAssignMessage)) {
                $message .= "<em><strong>Auto Assign Message:</strong> " . $autoAssignMessage . "</em>\n";
            }

            // Add the new buttons to the existing keyboard array
            $keyboard['inline_keyboard'] = $keyboardButtons;

            // Encode the keyboard array as JSON
            $encodedKeyboard = json_encode($keyboard);

            // Create a DateTime object for the last modified time in UTC
            $last_modified_utc = new DateTime($last_modified, new DateTimeZone('UTC'));
            // Convert the DateTime object to the server's timezone
            $last_modified_server = $last_modified_utc->setTimezone(new DateTimeZone('Asia/Calcutta'));
            // Get the current time on the server
            $current_time = new DateTime();
            // Calculate the difference between the two DateTime objects
            $time_diff = $current_time->diff($last_modified_server);
            // Store the difference in another variable
            $diff_in_seconds = $time_diff->s + ($time_diff->i * 60) + ($time_diff->h * 60 * 60) + ($time_diff->d * 24 * 60 * 60);
            $message .= "<em><strong>Job Desk Time:</strong> " . date_format($last_modified_server, 'h:i:s A') . "</em>\n";
            $message .= "<em><strong>Message Received After:</strong> " . $diff_in_seconds . " Seconds</em>\n";

            $data = [
                "chat_id" => $QuickResponseBotChatId,
                "text" => $message,
                "reply_markup" => $encodedKeyboard,
                "parse_mode" => "HTML",
                "disable_web_page_preview" => TRUE,
            ];

            $telegramJSONResponse = curl_get_contents("https://api.telegram.org/bot" . $QuickResponseBotToken . "/sendMessage?" . http_build_query($data));

            $name = htmlspecialchars($name);
            $name = addslashes($name);
            $category = htmlspecialchars($category);
            $category = addslashes($category);

            $query = "INSERT INTO `jobdesk`(`id`, `name`, `model_status`, `task_type`, `category`, `output_requirement`, `customer_username`, `variant_of`, `variation_type`, `created_on`, `last_modified`) VALUES ('" . $id . "', '" . $name . "', '" . $model_status . "', '" . $task_type . "', '" . $category . "', '" . $output_requirement . "', '" . $customer_username . "', '" . $variant_of . "', '" . $variation_type . "', '" . $created_on . "', '" . $last_modified . "')";
            $insertQuery = mysqli_query($conn, $query);
        }
    }
?>


Content of autoassigncontrol.json:
{"autoAssign":1,"productAutoAssign":1,"variantAutoAssign":1}

Sample content of categorieslist.json:
[
    {
        "category_id": "1134",
        "name": "Accent Chairs",
        "selected": 1,
        "parent_id": "619",
        "hidden_category": false
    },
    {
        "category_id": "933",
        "name": "Accent Rugs",
        "selected": 1,
        "parent_id": "631",
        "hidden_category": false
    },
    {
        "category_id": "1170",
        "name": "Accent Tables",
        "selected": 1,
        "parent_id": "619",
        "hidden_category": false
    },
    {
        "category_id": "600",
        "name": "Accessories",
        "selected": 0,
        "parent_id": "570",
        "hidden_category": false
    },
    {
        "category_id": "1318",
        "name": "Adult Bikes",
        "selected": 0,
        "parent_id": "671",
        "hidden_category": false
    }
]

Content of accountsstatusupdate.json:
{"dhee":2,"vedant":1,"niyam":1,"darsh":2,"parag":1,"yogi":1,"pragna":6,"bijaya":4,"abhinav":1}

Now, if status of any of the account is not 0 (if ($status === 0) {} else {}) I want to get status of other artists from following PHP file 'accountStatusJitendra.php':
<?php
include "includes/config.php";
include "includes/commonVariables.php";
include "includes/commonFunctions.php";

$multiHandle = curl_multi_init(); // Initialize the multi handle
$artistJitendra = array("jitendra24fps", "kalpesh");
$artistCountJitendra = count($artistJitendra);
$chArray = array(); // Initialize the array to store curl handles

for ($ac=0; $ac < $artistCountJitendra; $ac++) {
    $pendingDataArray = array(
        "required_fields" => ["id","name","brand_id","created_on","last_modified","category","company_name","model_type","model_type","need_to_model","assigned_artist","customer_username","price","height","width","depth","group_id","uploaded_model","variant_of","variation_type","subscription_display_name","segmented","model_status","last_modified_stamp",],
        "order_by" => "last_modified_stamp desc","filter_string" => "(model_status__in=[2,-4,8]&&assigned_artist__exact='" . $artistJitendra[$ac] . "')"
    );

    $pendingDataJSON = json_encode($pendingDataArray);
    callMultiThreadAll3dAPIchArrayReturn($productGetBatchClass, $pendingDataJSON, $chArray);
}

// Add the curl handles to the multi handle
foreach ($chArray as $ch) {
    curl_multi_add_handle($multiHandle, $ch);
}

// Execute the requests simultaneously
$running = null;
do {
    curl_multi_exec($multiHandle, $running);
} while ($running);

// Get the responses for each request
$i = 0;
$accountName = "";
$accountData = array();
foreach ($chArray as $ch) {
    $result = curl_multi_getcontent($ch);
    $pendingDataResponse = json_decode($result, true);

    if (empty($pendingDataResponse)) {
        $accountNameKey = $artistJitendra[$i];
        $pendingCountValue = 0;
    } else {
        $accountNameKey = $artistJitendra[$i];
        $pendingCountValue = count($pendingDataResponse);
    }

    // Add data for this iteration to the array
    $accountData[$accountNameKey] = $pendingCountValue;

    curl_multi_remove_handle($multiHandle, $ch);
    $i++;
}

$jsonJitendra = json_encode($accountData);
echo $jsonJitendra;
curl_multi_close($multiHandle); // Close the multi handle
?>

and run autoassign if any of the artist's status is 0 from accountStatusJitendra.php