From: Florian G. <re...@us...> - 2006-09-13 15:22:38
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22960/phpgui Modified Files: perfparse.php utils.php Log Message: some changes with debug enabled ... in the middle of some work :-) Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** utils.php 13 Sep 2006 10:14:51 -0000 1.23 --- utils.php 13 Sep 2006 15:22:36 -0000 1.24 *************** *** 118,121 **** --- 118,138 ---- } + function get_hostname_from_id(&$db,$hostId) { + // return a array with hostnames and ids + if(!is_array($hostId)) { + $hostId=array($hostId); + } + $n_hids=count($hostId); + if($n_hids==0) { + return(array()); + } + $query='SELECT host_id,host_name FROM perfdata_host '; + $query.='WHERE host_id in ('.str_repeat('?,',$n_hids-1).'?)'; + echo $query; //debug + $ret=$db->GetAssoc($query,$hostId); + return($ret); + } + + function have_host(&$db,$host) { $query='SELECT count(*) FROM perfdata_host where host_name=?'; Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** perfparse.php 13 Sep 2006 10:14:51 -0000 1.32 --- perfparse.php 13 Sep 2006 15:22:36 -0000 1.33 *************** *** 170,174 **** } ! // echo "<pre>"; print_r($metrics); echo "</pre>"; $smarty->assign_by_ref('metrics',$metrics); --- 170,178 ---- } ! // get hostnames ! $hidnames=get_hostname_from_id($db,$host_id); ! ! echo "<pre>metrics:\n"; print_r($metrics); echo "</pre>"; ! echo "<pre>hidnames:\n"; print_r($hidnames); echo "</pre>"; $smarty->assign_by_ref('metrics',$metrics); |