2011-09-20 09:55:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< ? php 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  LibreNMS 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  This  program  is  free  software :  you  can  redistribute  it  and / or  modify  it 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  under  the  terms  of  the  GNU  General  Public  License  as  published  by  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  Free  Software  Foundation ,  either  version  3  of  the  License ,  or  ( at  your 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  option )  any  later  version .   Please  see  LICENSE . txt  at  the  top  level  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  the  source  code  distribution  for  details . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  @ package     LibreNMS 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  @ subpackage  webui 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  @ link        http :// librenms . org 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  @ copyright   2017  LibreNMS 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  @ author      LibreNMS  Contributors 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/ 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-14 13:38:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								use  LibreNMS\Authentication\LegacyAuth ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-04-07 15:55:28 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								$pagetitle []  =  'Services' ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-10-18 14:41:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								require_once  'includes/html/modal/new_service.inc.php' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require_once  'includes/html/modal/delete_service.inc.php' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-15 22:16:08 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								?> 
 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< div  class = " container-fluid " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        < div  class = " panel panel-default " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            < div  class = " panel-heading " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                < span  style = " font-weight: bold; " > Services </ span >  & #187;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                < ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $menu_options  =  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    'basic'  =>  'Basic' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! $vars [ 'view' ])  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $vars [ 'view' ]  =  'basic' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $status_options  =  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    'all'  =>  'All' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    'ok'  =>  'Ok' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    'warning'  =>  'Warning' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    'critical'  =>  'Critical' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! $vars [ 'state' ])  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $vars [ 'state' ]  =  'all' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                // The menu option - on the left
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $sep  =  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                foreach  ( $menu_options  as  $option  =>  $text )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( empty ( $vars [ 'view' ]))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $vars [ 'view' ]  =  $option ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    echo  $sep ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $vars [ 'view' ]  ==  $option )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  " <span class='pagemenu-selected'> " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    echo  generate_link ( $text ,  $vars ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        'view'  =>  $option 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $vars [ 'view' ]  ==  $option )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '</span>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $sep  =  ' | ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                unset ( $sep ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                // The status option - on the right
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                echo  '<div class="pull-right">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $sep  =  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                foreach  ( $status_options  as  $option  =>  $text )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( empty ( $vars [ 'state' ]))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $vars [ 'state' ]  =  $option ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    echo  $sep ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $vars [ 'state' ]  ==  $option )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  " <span class='pagemenu-selected'> " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    echo  generate_link ( $text ,  $vars ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        'state'  =>  $option 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $vars [ 'state' ]  ==  $option )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '</span>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $sep  =  ' | ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                unset ( $sep ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                echo  '</div>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                echo  '</div>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                echo  '<div style="margin:10px 10px 0px 10px;" id="message"></div>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                echo  '<div class="panel-body">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $sql_param  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( isset ( $vars [ 'state' ]))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $vars [ 'state' ]  ==  'ok' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $state  =  '0' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    }  elseif  ( $vars [ 'state' ]  ==  'critical' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $state  =  '2' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    }  elseif  ( $vars [ 'state' ]  ==  'warning' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $state  =  '1' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( isset ( $state ))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $where  .=  "  AND service_status= ? AND service_disabled='0' AND `service_ignore`='0' " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $sql_param []  =  $state ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                if  ( LegacyAuth :: user () -> hasGlobalRead ())  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-05 15:34:00 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    $host_sql  =  'SELECT `D`.`device_id`,`D`.`hostname`,`D`.`sysName` FROM devices AS D, services AS S WHERE D.device_id = S.device_id GROUP BY `D`.`hostname`, `D`.`device_id`, `D`.`sysName` ORDER BY D.hostname' ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    $host_par  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-05 15:34:00 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    $host_sql  =  'SELECT `D`.`device_id`,`D`.`hostname`,`D`.`sysName` FROM devices AS D, services AS S, devices_perms AS P WHERE D.device_id = S.device_id AND D.device_id = P.device_id AND P.user_id = ? GROUP BY `D`.`hostname`, `D`.`device_id`, `D`.`sysName` ORDER BY D.hostname' ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    $host_par  =  array ( LegacyAuth :: id ()); 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                $shift  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                foreach  ( dbFetchRows ( $host_sql ,  $host_par )  as  $device )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $device_id  =  $device [ 'device_id' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $device_hostname  =  $device [ 'hostname' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $device_sysName  =  $device [ 'sysName' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $devlink  =  generate_device_link ( $device ,  null ,  array ( 'tab'  =>  'services' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    if  ( $shift  ==  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        array_unshift ( $sql_param ,  $device_id ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $shift  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $sql_param [ 0 ]  =  $device_id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    $header  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $footer  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $service_iteration  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $services  =  dbFetchRows ( " SELECT * FROM `services` WHERE `device_id` = ?  $where  ORDER BY service_type " ,  $sql_param ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    $services_count  =  count ( $services ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    foreach  ( $services  as  $service )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                        if  ( $service [ 'service_status' ]  ==  '2' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $label  =  'label-danger' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $title  =  'CRITICAL' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        }  elseif  ( $service [ 'service_status' ]  ==  '1' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $label  =  'label-warning' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $title  =  'WARNING' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        }  elseif  ( $service [ 'service_status' ]  ==  '0' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $label  =  'label-success' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $title  =  'OK' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $label  =  'label-info' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $title  =  'UNKNOWN' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $service_iteration ++ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        if  ( $service_iteration  <  2  &&  $header )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<div class="panel panel-default">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<div class="panel-heading"><h3 class="panel-title">'  .  $devlink  .  '</h3>'  .  $device_sysName  .  '</div>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<div class="panel-body">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<table class="table table-hover table-condensed">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<thead>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th style="width:1%;max-width:1%;"></th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th style="width:10%;max-width: 10%;">Service</th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th style="width:15%;max-width: 15%;">Last Changed</th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th style="width:15%;max-width: 15%;">Description</th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th >Message</th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '<th style="width:5%;max-width:5%;"></th>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '</thead>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        $header  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<tr id="row_'  .  $service [ 'service_id' ]  .  '">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<td><span data-toggle="tooltip" title="'  .  $title  .  '" class="alert-status '  .  $label  .  '"></span></td>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<td>'  .  nl2br ( display ( $service [ 'service_type' ]))  .  '</td>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<td>'  .  formatUptime ( time ()  -  $service [ 'service_changed' ])  .  '</td>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<td>'  .  nl2br ( display ( $service [ 'service_desc' ]))  .  '</td>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '<td>'  .  nl2br ( display ( $service [ 'service_message' ]))  .  '</td>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                        if  ( LegacyAuth :: user () -> hasGlobalAdmin ())  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                            echo  " <td>
 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                    < button  type = 'button'  class = 'btn btn-primary btn-sm'  aria - label = 'Edit'  data - toggle = 'modal'  data - target = '#create-service'  data - service_id = '{$service[' service_id ']}'  name = 'edit-service' >< i  class = 'fa fa-pencil'  aria - hidden = 'true' ></ i ></ button > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                    < button  type = 'button'  class = 'btn btn-danger btn-sm'  aria - label = 'Delete'  data - toggle = 'modal'  data - target = '#confirm-delete'  data - service_id = '{$service[' service_id ']}'  name = 'delete-service' >< i  class = 'fa fa-trash'  aria - hidden = 'true' ></ i ></ button > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                    </ td > " ;
 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        echo  '</tr>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        if  ( $service_iteration  >=  $services_count )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            $footer  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        if  ( $footer )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '</table>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '</div>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                            echo  '</div>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                unset ( $samehost ); 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-25 00:46:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                ?> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    </ div > 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 05:20:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								</ div >