}
if (!isset($_POST["withtemplate"])) {
    $_POST["withtemplate"] = "";
}
switch ($_POST['glpi_tab']) {
    case -1:
        $ptap = new PluginFusioninventoryAgentsProcesses();
        $ptap->ShowProcesses();
        $ptac = new PluginFusioninventorySnmphistoryconnection();
        $ptac->showForm($_GET);
        $ptae = new PluginFusioninventoryAgentsErrors();
        $ptae->ShowErrors($_GET);
        break;
    case 1:
        $ptap = new PluginFusioninventoryAgentsProcesses();
        $ptap->ShowProcesses();
        break;
    case 2:
        $ptac = new PluginFusioninventorySnmphistoryconnection();
        $ptac->showForm($_POST);
        break;
    case 3:
        $ptae = new PluginFusioninventoryAgentsErrors();
        $ptae->ShowErrors($_POST);
        break;
    default:
        $ptap = new PluginFusioninventoryAgentsProcesses();
        $ptap->ShowProcesses();
        break;
}
ajaxFooter();
 static function addLogConnection($status, $port, $FK_process = 0)
 {
     global $DB, $CFG_GLPI;
     $CommonItem = new CommonItem();
     $pthc = new PluginFusioninventorySnmphistoryconnection();
     $nw = new Netwire();
     if ($FK_process == '0' and isset($_SESSION['glpi_plugin_fusioninventory_processnumber'])) {
         $input['process_number'] = $_SESSION['glpi_plugin_fusioninventory_processnumber'];
     }
     // Récupérer le port de la machine associé au port du switch
     // Récupérer le type de matériel
     $input["FK_port_source"] = $port;
     $opposite_port = $nw->getOppositeContact($port);
     if ($opposite_port == "0") {
         return;
     }
     $input['FK_port_destination'] = $opposite_port;
     $input['date'] = date("Y-m-d H:i:s");
     if ($status == 'remove') {
         $input['creation'] = 0;
     } else {
         if ($status == 'make') {
             $input['creation'] = 1;
         }
     }
     $pthc->add($input);
 }