$input['ID'] = $task_id;
                    $ptt->delete($input);
                }
                if ($a_tasks[$task_id]['action'] == 'WAKEONLAN' and $ptcm->isActivated('wol') and $a_agent['module_wakeonlan'] == '1') {
                    $single = 1;
                    $ptc->addWakeonlan($pxml);
                    $input['ID'] = $task_id;
                    $ptt->delete($input);
                }
            }
            if ($single == "0") {
                if ($a_agent['module_netdiscovery'] == '1') {
                    $ptc->addDiscovery($pxml);
                }
                if ($a_agent['module_snmpquery'] == '1') {
                    $ptc->addQuery($pxml);
                }
            }
            if ($ocsinventory == '1') {
                $ptc->addInventory();
            }
            //      $ptc->addWakeonlan();
            // ******** Send XML
            $ptc->setXML($ptc->getXML());
            echo $ptc->getSend();
            // echo response for the agent
        }
    } else {
        $res .= "0'" . $errors . "'";
    }
}