function getLabel() { $data['hostname'] = 'test'; $data['ip'] = "192.168.1.1"; $data['port'] = "3306"; $data['version'] = "MariaDB 10.0.19"; $data['uptime'] = 154; $data['timezone'] = 'UTC'; $data['binlog_format'] = 'ROW'; $data['date'] = "14:02:21"; $label = '<<table border="0" cellborder="0" cellspacing="0" cellpadding="2" bgcolor="white">' . '<tr>' . '<td bgcolor="black" color="white" align="center" href="' . LINK . 'monitoring/query/' . str_replace('_', '-', $data['hostname']) . '/' . '"><font color="white">' . str_replace('_', '-', $data['hostname']) . '</font></td>' . '</tr>' . '<tr>' . '<td bgcolor="grey" align="left">' . $data['ip'] . ':' . $data['port'] . '</td>' . '</tr>'; $label .= '<tr><td bgcolor="grey" align="left">' . $data['version'] . '</td></tr>' . '<tr><td bgcolor="grey" align="left">Uptime : ' . Date::secToTime($data['uptime']) . '</td></tr>' . '<tr><td bgcolor="grey" align="left">(' . $data['date'] . ') : ' . $data['timezone'] . '</td></tr>' . '<tr><td bgcolor="grey" align="left">Binlog format : ' . $data['binlog_format'] . '</td></tr>'; // DATABASES $label .= '</table>>'; return $label; }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ use Glial\Date\Date; //echo "<h1>Work in progress ...</h1><br />"; echo '<div class="well" style="text-align: center;">'; $filename = TMP . 'gg.svg'; if (file_exists($filename)) { echo "Last refresh : " . date("F d Y H:i:s", filemtime($filename)) . " <b>UTC</b><br />"; } if (time() - filemtime($filename) > 120) { echo '<span class="danger">Not refreshed since : <b>' . Date::secToTime(time() - filemtime($filename)) . '</b></span><br /><br />'; } $svg = 'tmp/replication.svg'; //echo '<div style="background: url('.IMG.$svg.')"></div>'; //echo '<embed src="'.IMG.$svg.'" type="image/svg+xml" />'; echo '<div id="svg">'; $handle = fopen($filename, "r"); $remove = true; if ($handle) { while (($buffer = fgets($handle, 4096)) !== false) { if ("<svg" != substr($buffer, 0, 4) && $remove) { $remove = false; continue; } echo $buffer; }
private function displayServer(&$fp, $data) { $color = ['blue', 'red', 'green']; if (!in_array($data['color'], $color)) { throw new Exception("PMACLI-085 Impossible to get the color !"); } fwrite($fp, "\t node [color=" . $data['color'] . "];" . PHP_EOL); fwrite($fp, ' "' . $data['id_mysql_server'] . '" [style="" penwidth="3" fillcolor="yellow" fontname="arial" label =<<table border="0" cellborder="0" cellspacing="0" cellpadding="2" bgcolor="white"><tr><td bgcolor="black" color="white" align="center" href="' . LINK . 'monitoring/query/' . str_replace('_', '-', $data['hostname']) . '/' . '"><font color="white">' . str_replace('_', '-', $data['hostname']) . '</font></td></tr><tr><td bgcolor="grey" align="left">' . $data['ip'] . ':' . $data['port'] . '</td></tr>'); fwrite($fp, '<tr><td bgcolor="grey" align="left">' . $data['version'] . '</td></tr>' . PHP_EOL); fwrite($fp, '<tr><td bgcolor="grey" align="left">Uptime : ' . Date::secToTime($data['uptime']) . '</td></tr>'); fwrite($fp, '<tr><td bgcolor="grey" align="left">(' . $data['date'] . ') : ' . $data['timezone'] . '</td></tr>'); fwrite($fp, '<tr><td bgcolor="grey" align="left">Binlog format : ' . $data['binlog_format'] . '</td></tr>'); //fwrite($fp, '<tr><td bgcolor="red" align="left">Date : <b>' . $ob->date.'</b></td></tr>'); // DATABASES fwrite($fp, '</table>> ];' . PHP_EOL); }