} } print "<div style=\"overflow: auto\">"; if ($n != null) { $n->setTableHeaderPadding(1); $n->setItemCount($count); $n->setNavBar(new AjaxNavBar($count, $filter)); $n->start = 0; $n->end = $maxperpage; $n->display(); } print "</div>"; ?><a href='<?php echo urlStr("inventory/inventory/csv", array('table'=>$table, 'uuid'=>$_GET["uuid"])) ?>'><img src='modules/inventory/graph/csv.png' alt='export csv'/></a><?php } else { $display = $_GET['part']; $machines = getLastMachineInventoryPart($display, array('gid'=>$_GET["gid"], 'filter'=>$filter, 'min'=>$start, 'max'=>($start + $maxperpage), 'date'=>$date, 'software_filter'=>$software_filter)); $count = countLastMachineInventoryPart($display, array('gid'=>$_GET["gid"], 'filter'=>$filter, 'date'=>$date, 'software_filter'=>$software_filter)); $result = array(); $index = 0; $params = array(); foreach ($machines as $machine) { $name = $machine[0]; if (count($machine[1]) == 0) { $result['Machine'][$index] = $name; $index += 1; } foreach ($machine[1] as $element) { $result['Machine'][$index] = $name; foreach ($element as $head => $val) { if ($head != 'id' && $head != 'timestamp') {
* * You should have received a copy of the GNU General Public License * along with LMC; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require_once("modules/inventory/includes/xmlrpc.php"); if (isset($_POST["uuid"])) { $_GET["uuid"] = $_POST["uuid"]; } ?> <h2><?php echo _T("Additionnal informations", 'inventory'); ?> </h2> <?php $table = 'Hardware'; $inv = getLastMachineInventoryPart($table, array('uuid' => $_GET["uuid"])); $date = $inv[0][1][0]['timestamp']; $date = $date[0] . '-' . $date[1] . '-' . $date[2]; ?> <p><?php echo _T("First apparition", 'inventory') . " : " . $date; ?> </p>
} foreach ($content as $line) { # iterate over results if (in_array('timestamp', array_keys($line))) { $line['timestamp'] = _toDate($line['timestamp']); } print "\"{$name}\",\"" . implode('","', array_values($line)) . "\"\n"; } } } } else { # more than one table to display, show them as usual (ie no split) $datum = array(); getLastMachineInventoryPart($tables, array('gid' => $gid, 'uuid' => $get_uuid, 'filter' => $filter)); foreach ($tables as $table) { $machines = getLastMachineInventoryPart($table, array('gid' => $gid, 'uuid' => $get_uuid, 'filter' => $filter)); foreach ($machines as $machine) { $name = $machine[0]; $uuid = $machine[2]; $content = $machine[1]; if ($datum[$uuid] == null) { $datum[$uuid] = array($name, array(), $uuid); } foreach ($content as $k => $v) { $datum[$uuid][1][$k] = $v; // = $datum[$uuid][1] + $content; } } } $firstline = true; foreach (array_values($datum) as $machine) {