<?php //==================================================================================== // OCS INVENTORY REPORTS // Copyleft Pierre LEMMET 2005 // Web: http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt //==================================================================================== //Modified on $Date: 2010 $$Author: Erwan Goalou require_once 'require/function_opt_param.php'; //BEGIN SHOW ACCOUNTINFO require_once 'require/function_admininfo.php'; $accountinfo_value = interprete_accountinfo($list_fields, $tab_options); if (array($accountinfo_value['TAB_OPTIONS'])) { $tab_options = $accountinfo_value['TAB_OPTIONS']; } if (array($accountinfo_value['DEFAULT_VALUE'])) { $default_fields = $accountinfo_value['DEFAULT_VALUE']; } $list_fields = $accountinfo_value['LIST_FIELDS']; //END SHOW ACCOUNTINFO $list_fields2 = array($l->g(949) => 'h.ID', 'DEVICEID' => 'h.DEVICEID', 'NAME' => 'h.name', $l->g(25) => 'h.OSNAME', $l->g(275) => 'h.OSVERSION', $l->g(51) => 'h.OSCOMMENTS', $l->g(350) => 'h.PROCESSORT', $l->g(377) => 'h.PROCESSORS', $l->g(351) => 'h.PROCESSORN', $l->g(26) => 'h.MEMORY', $l->g(50) => 'h.SWAP', $l->g(46) => 'h.LASTDATE', $l->g(820) => 'h.LASTCOME', $l->g(353) => 'h.QUALITY', $l->g(354) => 'h.FIDELITY', $l->g(53) => 'h.DESCRIPTION', $l->g(34) => 'h.IPADDR', 'CHECK' => 'h.ID'); $list_fields = array_merge($list_fields, $list_fields2); $list_col_cant_del = array('NAME' => 'NAME', 'CHECK' => 'CHECK'); $default_fields2 = array('NAME' => 'NAME', $l->g(46) => $l->g(46), $l->g(820) => $l->g(820), $l->g(34) => $l->g(34)); $default_fields = array_merge($default_fields, $default_fields2); if (isset($protectedGet['systemid'])) { $systemid = $protectedGet['systemid'];
$data_fixe[$cont['HARDWARE_ID']][$field] = $cont[$lbl]; } } } $i++; } } if ($_SESSION['OCS']['csv']['ARG'][$protectedGet['tablename']]) { $arg = $_SESSION['OCS']['csv']['ARG'][$protectedGet['tablename']]; } else { $arg = ''; } $result = mysql2_query_secure($_SESSION['OCS']['csv']['SQL'][$protectedGet['tablename']], $link, $arg); $i = 0; require_once 'require/function_admininfo.php'; $inter = interprete_accountinfo($col, array()); while ($cont = mysql_fetch_array($result, MYSQL_ASSOC)) { //p($cont); foreach ($col as $field => $lbl) { if ($lbl == "name_of_machine" and !isset($cont[$field])) { $field = 'name'; } $found = false; // find value case-insensitive foreach ($cont as $key => $val) { if (strtolower($key) == strtolower($field)) { if (($field == 'TAG' or substr($field, 0, 7) == 'fields_') and isset($inter['TAB_OPTIONS']['REPLACE_VALUE'][$lbl])) { // administrative data $data[$i][$lbl] = $inter['TAB_OPTIONS']['REPLACE_VALUE'][$lbl][$val]; } else { // normal data