if (isset($_SESSION["ocs_importsnmp"]["id"])) { if ($count = count($_SESSION["ocs_importsnmp"]["id"])) { $percent = min(100, round(100 * ($_SESSION["ocs_importsnmp_count"] - $count) / $_SESSION["ocs_importsnmp_count"], 0)); $key = array_pop($_SESSION["ocs_importsnmp"]["id"]); if (isset($_SESSION["ocs_importsnmp"]["entities_id"][$key])) { $params['entity'] = $_SESSION["ocs_importsnmp"]["entities_id"][$key]; } else { $params['entity'] = -1; } if (isset($_SESSION["ocs_importsnmp"]["itemtype"][$key])) { $params['itemtype'] = $_SESSION["ocs_importsnmp"]["itemtype"][$key]; } else { $params['itemtype'] = -1; } $conf = PluginOcsinventoryngOcsServer::getConfig($_SESSION["plugin_ocsinventoryng_ocsservers_id"]); $action = PluginOcsinventoryngSnmpOcslink::processSnmp($key, $_SESSION["plugin_ocsinventoryng_ocsservers_id"], 0, $params); PluginOcsinventoryngOcsServer::manageImportStatistics($_SESSION["ocs_importsnmp"]['statistics'], $action['status'], true); PluginOcsinventoryngOcsServer::showStatistics($_SESSION["ocs_importsnmp"]['statistics'], false, true); Html::displayProgressBar(400, $percent); Html::redirect($_SERVER['PHP_SELF']); } else { //displayProgressBar(400, 100); if (isset($_SESSION["ocs_importsnmp"]['statistics'])) { PluginOcsinventoryngOcsServer::showStatistics($_SESSION["ocs_importsnmp"]['statistics'], false, true); } else { echo "<div class='center b red'>"; _e('No import: the plugin will not import these elements', 'ocsinventoryng'); echo "</div>"; } unset($_SESSION["ocs_importsnmp"]); echo "<div class='center b'><br>";