[racktables-users] Re: new report

  • From: "Vater, Wolfgang" <wolfgang.vater@xxxxxxxxxxxxx>
  • To: "racktables-users@xxxxxxxxxxxxx" <racktables-users@xxxxxxxxxxxxx>
  • Date: Thu, 16 Feb 2017 22:09:22 +0000

Thanks Denis,

I tried that now. but this renders a blank page with just the word Report on it.

Any hint on what I do wrong?

Code:

<?php

/********************************************
 *
 * Display the IP-Addresses by VLAN Domain
 *
 */

$tab['ipv4space']['report'] = 'Report';
$tabhandler['ipv4space']['report'] = 'ipreport_tabhandler';

function ipreport_tabhandler()
{
        $result = usePreparedSelectBlade('SELECT VLANDomain.description as 
VLAN_Domain,VLANIPv4.vlan_id as VLAN_ID,IPv4Network.name as 
VLAN_Description,inet_ntoa(IPv4Network.ip) as Subnet,IPv4Network.mask as 
Netmask  FROM racktables.IPv4Network left join racktables.VLANIPv4 ON 
(IPv4Network.id = VLANIPv4.ipv4net_id) left join racktables.VLANDomain ON 
(VLANIPv4.domain_id = VLANDomain.id) order by 
VLANDomain.description,VLANIPv4.vlan_id,IPv4Network.name');

        $rows = $result->fetchAll(PDO::FETCH_ASSOC);

        startPortlet("Report");

        $columns = array
        (
                array ('th_text' => 'VLAN_Domain'    , 'th_class' => 'tdleft', 
'row_key' => 0, 'td_escape' => FALSE, 'td_class' => 'tdleft'),
                array ('th_text' => 'VLAN_ID'           , 'th_class' => 
'tdleft', 'row_key' => 1, 'td_escape' => FALSE, 'td_class' => 'tdleft'),
                array ('th_text' => 'VLAN_Decription', 'th_class' => 'tdleft', 
'row_key' => 2, 'td_escape' => FALSE, 'td_class' => 'tdleft'),
                array ('th_text' => 'Subnet'             , 'th_class' => 
'tdleft', 'row_key' => 3, 'td_escape' => FALSE, 'td_class' => 'tdleft'),
                array ('th_text' => 'NetMask'           , 'th_class' => 
'tdleft', 'row_key' => 4, 'td_escape' => FALSE, 'td_class' => 'tdleft'),
        );


        renderTableViewer ($columns, $rows);

        finishPortlet("Report");
}

?>


Wolfgang Vater | Lead Client Architect | Enterprise Services
Unisys Deutschland GmbH | +49 162 255 9338 | wolfgang.vater@xxxxxxxxxx | 
Philipp-Reis-Str. 2 | 65795 Hattersheim



Unisys Deutschland GmbH | Geschäftsführer: Sandro Lindner & Dr. Uwe Heckert | 
Sitz der Gesellschaft: Hattersheim | Amtsgericht: Frankfurt/Main HRB  7929
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers. 
DIESE E-MAIL IST AUSSCHLIESSLICH FÜR DEN ADRESSATEN BESTIMMT UND KANN 
VERTRAULICHE INFORMATIONEN ENTHALTEN. Sollten Sie nicht der Adressat dieser 
Informationen sein, bitten wir Sie, sich mit dem Absender in Verbindung zu 
setzen und die Informationen von Ihren Endgeräten zu entfernen.
   

-----Original Message-----
From: racktables-users-bounce@xxxxxxxxxxxxx 
[mailto:racktables-users-bounce@xxxxxxxxxxxxx] On Behalf Of Denis Ovsienko
Sent: Wednesday, February 15, 2017 20:24
To: racktables-users@xxxxxxxxxxxxx
Subject: [racktables-users] Re: new report

---- On Wed, 15 Feb 2017 17:12:24 +0000  Wolfgang Vater  wrote ---- 

   Sorry, the script was truncated. Use this one, please.
 
<?php
 
/********************************************
*
* Display the IP-Addresses by VLAN Domain
*
*/
[...]

Hello Wolfgang.

You may want to consider the function renderTableViewer(), which will produce 
the required HTML for you if you feed it with a PHP array. You can find 
examples in the source code.

-- 
    Denis Ovsienko



Other related posts: