. * --------------------------------------------------------------------- */ include ('../inc/includes.php'); if (!$CFG_GLPI["use_anonymous_helpdesk"]) { exit(); } // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); echo "\n"; echo ""; ?> GLPI "; echo "

".__('Search the ID of your hardware')."

"; echo "
"; echo ""; echo ""; echo "
".__('Enter the first letters (user, item name, serial or asset number)'). "
"; echo ""; echo ""; // bug IE ! La validation par enter ne fonctionne pas sans cette ligne incroyable mais vrai ! echo ""; echo "
"; Html::closeForm(); echo ""; if (isset($_POST["send"])) { echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $types = ['Computer' => Computer::getTypeName(1), 'NetworkEquipment' => NetworkEquipment::getTypeName(1), 'Printer' => Printer::getTypeName(1), 'Monitor' => Monitor::getTypeName(1), 'Peripheral' => Peripheral::getTypeName(1)]; foreach ($types as $type => $label) { $iterator = $DB->request([ 'SELECT' => ['name', 'id', 'contact', 'serial', 'otherserial'], 'FROM' => getTableForItemType($type), 'WHERE' => [ 'is_template' => 0, 'is_deleted' => 0, 'OR' => [ 'contact' => ['LIKE', '%' . $_POST['NomContact'] . '%'], 'name' => ['LIKE', '%' . $_POST['NomContact'] . '%'], 'serial' => ['LIKE', '%' . $_POST['NomContact'] . '%'], 'otherserial' => ['LIKE', '%' . $_POST['NomContact'] . '%'], ] ], 'ORDER' => ['name'] ]); while ($ligne = $iterator->next()) { $Comp_num = $ligne['id']; $Contact = $ligne['contact']; $Computer = $ligne['name']; $s1 = $ligne['serial']; $s2 = $ligne['otherserial']; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } $iterator = $DB->request([ 'SELECT' => ['name', 'id'], 'FROM' => 'glpi_softwares', 'WHERE' => [ 'is_template' => 0, 'is_deleted' => 0, 'name' => ['LIKE', "%{$_POST['NomContact']}%"] ], 'ORDER' => ['name'] ]); while ($ligne = $iterator->next()) { $Comp_num = $ligne['id']; $Computer = $ligne['name']; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".__('Alternate username')."".__('Hardware type').""._n('Associated element', 'Associated elements', Session::getPluralNumber())."".__('ID')."".__('Serial number')."".__('Inventory number')."
 $Contact  $label  $Computer  $Comp_num  $s1  $s2 "; echo "
  "._n('Software', 'Software', 1)."  $Computer  $Comp_num  
"; } echo '';