/**
  * Display informations about computer (bios...)
  *
  * @param type $computers_id
  */
 static function showInfo($item)
 {
     global $CFG_GLPI;
     // Manage locks pictures
     PluginFusioninventoryLock::showLockIcon('Computer');
     $pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
     $a_computerextend = current($pfInventoryComputerComputer->find("`computers_id`='" . $item->getID() . "'", "", 1));
     if (empty($a_computerextend)) {
         return;
     }
     echo '<table class="tab_glpi" width="100%">';
     echo '<tr>';
     echo '<th colspan="2">' . __('FusionInventory', 'fusioninventory') . '</th>';
     echo '</tr>';
     echo '<tr class="tab_bg_1">';
     echo '<td>';
     echo __('Last inventory', 'fusioninventory');
     echo '</td>';
     echo '<td>';
     echo Html::convDateTime($a_computerextend['last_fusioninventory_update']);
     echo '</td>';
     echo '</tr>';
     if ($a_computerextend['remote_addr'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Public contact address', 'fusioninventory') . '</td>';
         echo '<td>' . $a_computerextend['remote_addr'] . '</td>';
         echo '</tr>';
     }
     $pfAgent = new PluginFusioninventoryAgent();
     $pfAgent->showInfoForComputer($item->getID());
     if ($a_computerextend['bios_date'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('BIOS date', 'fusioninventory') . '</td>';
         echo '<td>' . Html::convDate($a_computerextend['bios_date']) . '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['bios_version'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('BIOS version', 'fusioninventory') . '</td>';
         echo '<td>' . $a_computerextend['bios_version'] . '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['bios_manufacturers_id'] > 0) {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Manufacturer') . '&nbsp;:</td>';
         echo '<td>';
         echo Dropdown::getDropdownName("glpi_manufacturers", $a_computerextend['bios_manufacturers_id']);
         echo '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['plugin_fusioninventory_computerarchs_id'] != '') {
         echo '<tr class="tab_bg_1">';
         echo "<td>" . __('Architecture', 'fusioninventory') . "</td>";
         echo '<td>';
         echo Dropdown::getDropdownName('glpi_plugin_fusioninventory_computerarchs', $a_computerextend['plugin_fusioninventory_computerarchs_id']);
         echo '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['operatingsystem_installationdate'] != '') {
         echo '<tr class="tab_bg_1">';
         echo "<td>" . __('Operating system') . " - " . __('Installation') . " (" . strtolower(__('Date')) . ")</td>";
         echo '<td>' . Html::convDate($a_computerextend['operatingsystem_installationdate']) . '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['winowner'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Owner', 'fusioninventory') . '</td>';
         echo '<td>' . $a_computerextend['winowner'] . '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['wincompany'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Company', 'fusioninventory') . '</td>';
         echo '<td>' . $a_computerextend['wincompany'] . '</td>';
         echo '</tr>';
     }
     if ($a_computerextend['oscomment'] != '') {
         echo '<tr class="tab_bg_1">';
         echo "<td>" . __('Comments') . "</td>";
         echo '<td>' . $a_computerextend['oscomment'] . '</td>';
         echo '</tr>';
     }
     // Display automatic entity transfer
     if (Session::isMultiEntitiesMode()) {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Automatic entity transfer', 'fusioninventory') . '</td>';
         echo '<td>';
         $pfEntity = new PluginFusioninventoryEntity();
         if ($pfEntity->getValue('transfers_id_auto', $item->fields['entities_id']) == 0) {
             echo __('No, locked (by entity configuration)', 'fusioninventory');
         } else {
             if ($a_computerextend['is_entitylocked'] == 1) {
                 echo __('No, locked manually', 'fusioninventory');
                 echo " [ <a href='" . $CFG_GLPI['root_doc'] . "/plugins/fusioninventory/front/computerentitylock.form.php?id=" . $a_computerextend['id'] . "&lock=0'>" . __('Unlock it', 'fusioninventory') . "</a> ]";
             } else {
                 echo __('Yes');
                 echo " [ <a href='" . $CFG_GLPI['root_doc'] . "/plugins/fusioninventory/front/computerentitylock.form.php?id=" . $a_computerextend['id'] . "&lock=1'>" . __('Lock it', 'fusioninventory') . "</a> ]";
             }
         }
         echo '</td>';
         echo '</tr>';
     }
     echo '</table>';
 }
 static function showInfo($item)
 {
     // Manage locks pictures
     PluginFusioninventoryLock::showLockIcon('Printer');
     $pfPrinter = new PluginFusioninventoryPrinter();
     $a_printerextend = current($pfPrinter->find("`printers_id`='" . $item->getID() . "'", "", 1));
     if (empty($a_printerextend)) {
         return;
     }
     echo '<table class="tab_glpi" width="100%">';
     echo '<tr>';
     echo '<th colspan="2">' . __('FusionInventory', 'fusioninventory') . '</th>';
     echo '</tr>';
     echo '<tr class="tab_bg_1">';
     echo '<td>';
     echo __('Last inventory', 'fusioninventory');
     echo '</td>';
     echo '<td>';
     echo Html::convDateTime($a_printerextend['last_fusioninventory_update']);
     echo '</td>';
     echo '</tr>';
     echo '<tr class="tab_bg_1">';
     echo '<td>';
     echo __('Type');
     echo '</td>';
     echo '<td>';
     echo "SNMP";
     echo '</td>';
     echo '</tr>';
     echo "</table>";
 }
 /**
  * Display informations about networkequipment (automatic inventory)
  *
  * @param type $networkequipments_id
  */
 static function showInfo($item)
 {
     // Manage locks pictures
     PluginFusioninventoryLock::showLockIcon('NetworkEquipment');
     $pfNetworkEquipment = new PluginFusioninventoryNetworkEquipment();
     $a_networkequipmentextend = current($pfNetworkEquipment->find("`networkequipments_id`='" . $item->getID() . "'", "", 1));
     if (empty($a_networkequipmentextend)) {
         return;
     }
     echo '<table class="tab_glpi" width="100%">';
     echo '<tr>';
     echo '<th colspan="2">' . __('FusionInventory', 'fusioninventory') . '</th>';
     echo '</tr>';
     echo '<tr class="tab_bg_1">';
     echo '<td>';
     echo __('Last inventory', 'fusioninventory');
     echo '</td>';
     echo '<td>';
     echo Html::convDateTime($a_networkequipmentextend['last_fusioninventory_update']);
     echo '</td>';
     echo '</tr>';
     if ($a_networkequipmentextend['uptime'] != '') {
         echo '<tr class="tab_bg_1">';
         echo '<td>' . __('Uptime', 'fusioninventory') . '</td>';
         echo '<td>';
         $sysUpTime = $a_networkequipmentextend['uptime'];
         $day = 0;
         $hour = 0;
         $minute = 0;
         $sec = 0;
         $ticks = 0;
         if (strstr($sysUpTime, "days")) {
             list($day, $hour, $minute, $sec, $ticks) = sscanf($sysUpTime, "%d days, %d:%d:%d.%d");
         } else {
             if (strstr($sysUpTime, "hours")) {
                 $day = 0;
                 list($hour, $minute, $sec, $ticks) = sscanf($sysUpTime, "%d hours, %d:%d.%d");
             } else {
                 if (strstr($sysUpTime, "minutes")) {
                     $day = 0;
                     $hour = 0;
                     list($minute, $sec, $ticks) = sscanf($sysUpTime, "%d minutes, %d.%d");
                 } else {
                     if ($sysUpTime == "0") {
                         $day = 0;
                         $hour = 0;
                         $minute = 0;
                         $sec = 0;
                     } else {
                         list($hour, $minute, $sec, $ticks) = sscanf($sysUpTime, "%d:%d:%d.%d");
                         $day = 0;
                     }
                 }
             }
         }
         echo "<b>{$day}</b> " . __('day(s)', 'fusioninventory') . " ";
         echo "<b>{$hour}</b> " . __('hour(s)', 'fusioninventory') . " ";
         echo "<b>{$minute}</b> " . __('Minute(s)', 'fusioninventory') . " ";
         echo " " . __('and') . " <b>{$sec}</b> " . __('sec(s)', 'fusioninventory') . " ";
         echo '</td>';
         echo '</tr>';
     }
     echo '</table>';
 }