From d37ccfe13d17220efdab474327494045560d8191 Mon Sep 17 00:00:00 2001 From: Dan Tucny Date: Sat, 4 Mar 2017 22:08:48 +0800 Subject: [PATCH] tidy up getgraph and header --- getgraph.php | 54 ++++++++++++++++++++----------------------------- inc/stdhead.php | 15 ++++---------- 2 files changed, 26 insertions(+), 43 deletions(-) diff --git a/getgraph.php b/getgraph.php index bec0aeb..c63d313 100644 --- a/getgraph.php +++ b/getgraph.php @@ -1,37 +1,27 @@ hostname; + $bug_t=$row2->bug; + $sec_t=$row2->sec; + $url_t="/view_page.php?action=viewallpkgs&servername=$host_t"; + $arr_t['hostname']=$host_t; + $arr_t['bug']=$bug_t; + $arr_t['sec']=$sec_t; + $arr_t['url']=$url_t; + + $data[] = $arr_t; + } +} - require_once './inc/db.php'; -// header("Content-type: image/png"); -//$output_file='/tmp/myimage.png'; - $dblink = db_connect(); - - // Packages with updates -// $dbquery2 = "select packagename,count(*) as cunt from packages WHERE packtype='bug' group by packagename order by cunt DESC, packagename ASC;"; - $dbquery2 = "select hostname, sum(if (packtype='bug',1,0)) as bug, sum(if (packtype='sec',1,0)) as sec from packages group by hostname;"; - $dbresult2 = mysqli_query($dblink, $dbquery2); -// echo "\n"; -// echo "
\n"; - $data=array(); - if ($dbresult2 && mysqli_num_rows($dbresult2)) { - while ($row2 = mysqli_fetch_object($dbresult2)) { - $arr_t=array(); - - $host_t=$row2->hostname; - $bug_t=$row2->bug; - $sec_t=$row2->sec; - $url_t="https://man.pmalaty.com/view_page.php?action=viewallpkgs&servername=$host_t"; - $arr_t['hostname']=$host_t; - $arr_t['bug']=$bug_t; - $arr_t['sec']=$sec_t; - $arr_t['url']=$url_t; - - //print_r($row2); - $data[] = $arr_t; - } - } - - -//print_r($data); $json_dataset = json_encode($data); echo $json_dataset; diff --git a/inc/stdhead.php b/inc/stdhead.php index cd9ccd1..9ad57dd 100644 --- a/inc/stdhead.php +++ b/inc/stdhead.php @@ -32,6 +32,10 @@ PMSpiderSyPUMDEV"; ?> +
+

SyPUM

+
+ \n"; - -/* - echo "My Dashboard"; - echo "DNS"; - echo "Shell"; - echo "Voice/Video"; - echo "IPv6"; - echo "Web Hosting"; - echo "Tools"; -*/ - } ?>
PackageShort DescNum of Affected servers