function restart_squid() { $tpl = new templates(); $hostid = $_POST["restart-squid"]; $q = new blackboxes($hostid); if (!$q->restart_squid()) { $tpl->javascript_parse_text("{failed}: {$q->ipaddress}"); return; } echo $tpl->javascript_parse_text("{success}: {$q->ipaddress}"); }