Changeset 873 for trunk/Modules/Map/Map.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Map/Map.php
r865 r873 13 13 function Show() 14 14 { 15 if (!$this->System->User->CheckPermission('Map', 'Show'))16 return ('Nemáte oprávnění');17 18 if (count($this->System->PathItems) > 1)19 { 20 if ($this->System->PathItems[1] == 'show-position') return($this->ShowPosition());21 else return (PAGE_NOT_FOUND);22 } else return ($this->ShowMain());15 if (!$this->System->User->CheckPermission('Map', 'Show')) 16 return ('Nemáte oprávnění'); 17 18 if (count($this->System->PathItems) > 1) 19 { 20 if ($this->System->PathItems[1] == 'show-position') return ($this->ShowPosition()); 21 else return (PAGE_NOT_FOUND); 22 } else return ($this->ShowMain()); 23 23 } 24 24 … … 26 26 { 27 27 $DbResult = $this->Database->select('MapPosition', '*', '`Id`='.$_GET['i']); 28 if ($DbResult->num_rows > 0)28 if ($DbResult->num_rows > 0) 29 29 { 30 30 $DbRow = $DbResult->fetch_assoc(); … … 40 40 $MapApi->Markers[] = $Marker; 41 41 $Output = $MapApi->ShowPage($this); 42 return ($Output);43 } else return ('Položka nenalezena');42 return ($Output); 43 } else return ('Položka nenalezena'); 44 44 } 45 45 … … 59 59 'WHERE (`NetworkDevice`.`Used`=1) AND (`NetworkDevice`.`MapPosition` IS NOT NULL) '. 60 60 'GROUP BY `NetworkDevice`.`MapPosition`'); 61 while ($Device = $DbResult->fetch_assoc())61 while ($Device = $DbResult->fetch_assoc()) 62 62 { 63 63 $Pos = explode(';', $Device['Pos']); … … 69 69 70 70 $DbResult = $this->Database->query('SELECT * FROM `NetworkLink` WHERE (`Interface1` <> 0) AND (`Interface2` <> 0)'); 71 while ($Link = $DbResult->fetch_assoc())71 while ($Link = $DbResult->fetch_assoc()) 72 72 { 73 73 $DbResult2 = $this->Database->query('SELECT `NetworkDevice`.`Used`, `MapPosition`.`Pos` FROM `NetworkDevice` '. … … 77 77 'JOIN `MapPosition` ON `MapPosition`.`Id` = `NetworkDevice`.`MapPosition` '. 78 78 'WHERE `NetworkDevice`.`Id` = (SELECT `NetworkInterface`.`Device` FROM `NetworkInterface` WHERE `NetworkInterface`.`Id` = '.$Link['Interface2'].')'); 79 if (($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0))79 if (($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0)) 80 80 { 81 81 $Device1 = $DbResult2->fetch_assoc(); … … 83 83 $Device2 = $DbResult3->fetch_assoc(); 84 84 $Pos2 = explode(';', $Device2['Pos']); 85 if (($Device1['Used'] == 1) and ($Device2['Used'] == 1))85 if (($Device1['Used'] == 1) and ($Device2['Used'] == 1)) 86 86 { 87 87 $PolyLine = new MapPolyLine(); … … 146 146 NetworkLinks = ['; 147 147 $DbResult = $this->Database->query('SELECT * FROM `NetworkLink` WHERE (`Interface1` <> 0) AND (`Interface2` <> 0)'); 148 while ($Link = $DbResult->fetch_assoc())148 while ($Link = $DbResult->fetch_assoc()) 149 149 { 150 150 $DbResult2 = $this->Database->query('SELECT `NetworkDevice`.`Used`, `MapPosition`.`Pos` FROM `NetworkDevice` '. … … 154 154 'JOIN `MapPosition` ON `MapPosition`.`Id` = `NetworkDevice`.`MapPosition` '. 155 155 'WHERE `NetworkDevice`.`Id` = (SELECT `NetworkInterface`.`Device` FROM `NetworkInterface` WHERE `NetworkInterface`.`Id` = '.$Link['Interface2'].')'); 156 if (($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0))156 if (($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0)) 157 157 { 158 158 $Device1 = $DbResult2->fetch_assoc(); … … 160 160 $Device2 = $DbResult3->fetch_assoc(); 161 161 $Pos2 = explode(';', $Device2['Pos']); 162 if (($Device1['Used'] == 1) and ($Device2['Used'] == 1))162 if (($Device1['Used'] == 1) and ($Device2['Used'] == 1)) 163 163 $Output .= 'new google.maps.Polyline([new google.maps.LatLng('.$Pos1[0].', '. 164 164 $Pos1[1].'),new google.maps.LatLng('.$Pos2[0].', '.$Pos2[1].')], "#4F4FBF", 3, 0.8), '; … … 198 198 'WHERE (`NetworkDevice`.`Used`=1) AND (`NetworkDevice`.`MapPosition` IS NOT NULL) '. 199 199 'GROUP BY `NetworkDevice`.`MapPosition`'); 200 while ($Device = $DbResult->fetch_assoc())200 while ($Device = $DbResult->fetch_assoc()) 201 201 { 202 202 $Pos = explode(';', $Device['Pos']); … … 236 236 </table>'; 237 237 */ 238 return ($Output);238 return ($Output); 239 239 } 240 240 } … … 245 245 { 246 246 $Output = parent::OnEdit($Item); 247 if ($this->FormManager->ShowRelation)247 if ($this->FormManager->ShowRelation) 248 248 $Output .= '<img src="'.$this->FormManager->Root.'/images/select.png" alf="Vybrat" language="javascript" '. 249 249 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=mapselect&r='. 250 250 $Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>'; 251 return ($Output);251 return ($Output); 252 252 } 253 253 }
Note:
See TracChangeset
for help on using the changeset viewer.