Changeset 7 for trunk/Packages/Common/Form/Types/GPS.php
- Timestamp:
- Apr 14, 2020, 11:13:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Form/Types/GPS.php
r1 r7 10 10 11 11 $DbResult = $Database->query('SELECT * FROM `SystemGPS` WHERE `Id`='.$Item['Value']); 12 if ($DbResult->num_rows > 0)12 if ($DbResult->num_rows > 0) 13 13 { 14 14 $DbRow = $DbResult->fetch_assoc(); … … 17 17 $Output = '<a href="http://www.mapy.cz/?st=search&fr=loc:'.$DbRow['Latitude'].' '.$DbRow['Longitude'].'">'.$Latitude[0].'°'.$Latitude[1]."'".$Latitude[2].'" '.$Longitude[0].'°'.$Longitude[1]."'".$Longitude[2].'"</a>'; 18 18 } 19 return ($Output);19 return $Output; 20 20 } 21 21 … … 24 24 global $Database; 25 25 26 if ($Item['Value'] != '')26 if ($Item['Value'] != '') 27 27 { 28 28 $DbResult = $Database->query('SELECT * FROM `SystemGPS` WHERE `Id`='.$Item['Value']); 29 if ($DbResult->num_rows > 0)29 if ($DbResult->num_rows > 0) 30 30 { 31 31 $DbRow = $DbResult->fetch_assoc(); … … 40 40 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-min" value="'.$Value[1].'"/>\''; 41 41 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-sec" value="'.$Value[2].'"/>"'; 42 return ($Output);42 return $Output; 43 43 } 44 44 … … 50 50 $Longitude = $this->Implode($_POST[$Item['Name'].'-lon-deg'], $_POST[$Item['Name'].'-lon-min'], $_POST[$Item['Name'].'-lon-sec']); 51 51 $Database->query('INSERT INTO SystemGPS (`Latitude`, `Longitude`) VALUES ("'.$Latitude.'", "'.$Longitude.'")'); 52 return ($Database->insert_id);52 return $Database->insert_id; 53 53 } 54 54 … … 61 61 $Float = ($Float - intval($Float)) * 60; 62 62 $Seconds = round($Float, 3); 63 return (array($Degrees, $Minutes, $Seconds));63 return array($Degrees, $Minutes, $Seconds); 64 64 } 65 65 66 66 function Implode($Degrees, $Minutes, $Seconds) 67 67 { 68 if ($Degrees < 0) return(-(abs($Degrees) + ($Minutes + $Seconds / 60) / 60));69 else return ($Degrees + ($Minutes + $Seconds / 60) / 60);68 if ($Degrees < 0) return -(abs($Degrees) + ($Minutes + $Seconds / 60) / 60); 69 else return $Degrees + ($Minutes + $Seconds / 60) / 60; 70 70 } 71 71 }
Note:
See TracChangeset
for help on using the changeset viewer.