Changeset 757 for trunk/Modules/Notify/Notify.php
- Timestamp:
- Oct 26, 2015, 12:27:20 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Notify/Notify.php
r754 r757 51 51 { 52 52 if($Category['SysName'] == 'NetworkReachability') { 53 $DbResult3 = $this->Database->query('SELECT `Id`, `Name`, `Online`, `LastOnline` FROM `NetworkDevice` WHERE 54 (`LastOnline` > "'.$User['LastTime'].'") AND (`LastOnline` <= "'.TimeToMysqlDateTime($Time).'") '. 55 'AND (`PermanentOnline` = 1)'); 53 $DbResult3 = $this->Database->query('SELECT CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) AS `Name`, '. 54 '`NetworkInterfaceUpDown`.`State`, `NetworkInterfaceUpDown`.`Duration`, `NetworkInterfaceUpDown`.`Time` FROM `NetworkInterfaceUpDown` '. 55 'LEFT JOIN `NetworkInterface` ON `NetworkInterface`.`Id` = `NetworkInterfaceUpDown`.`Interface` '. 56 'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 57 'WHERE (`Time` > "'.$User['LastTime'].'") AND (`Time` <= "'.TimeToMysqlDateTime($Time).'") AND (`NetworkDevice`.`PermanentOnline`=1)'); 56 58 if($DbResult3->num_rows > 0) { 57 59 $Output .= 'Category '.$Category['Name'].":\n"; 58 60 $Content .= 'Category '.$Category['Name']."<br>\n"; 59 $Content .= '<table><tr><th >Jméno</th><th>Stav</th><th>Čas</th></tr>'."\n";61 $Content .= '<table><tr><th align="center">Jméno</th><th align="center">Stav</th><th align="center">Čas</th><th align="center">Trvání</th></tr>'."\n"; 60 62 while($Item = $DbResult3->fetch_assoc()) 61 63 { 62 $Content .= '<tr><td>'.$Item['Name'].'</td><td>'.$OnlineText[$Item['Online']].'</td><td>'.$Item['LastOnline'].'</td></tr>'."\n"; 64 $Duration = sprintf('%02d', floor($Item['Duration'] / 3600 % 24)).':'. 65 sprintf('%02d', floor($Item['Duration'] / 60 % 60)).':'. 66 sprintf('%02d', floor($Item['Duration'] % 60)); 67 $Days = floor($Item['Duration'] / (60 * 60 * 24)); 68 if($Days > 0) $Duration = $Days.' dnů '.$Duration; 69 70 $Content .= '<tr><td>'.$Item['Name'].'</td><td>'.$OnlineText[$Item['State']]. 71 '</td><td>'.$Item['Time'].'</td><td>'.$Duration.'</td></tr>'."\n"; 63 72 } 64 73 $Content .= '</table>'."\n";
Note:
See TracChangeset
for help on using the changeset viewer.