Changeset 468
- Timestamp:
- Dec 16, 2012, 10:46:34 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Log.php
r438 r468 7 7 function NewRecord($Module, $Operation, $Value = '') 8 8 { 9 $this->Database->insert('Log', array('Time' => 'NOW()', 'User' => $this->System->Modules['User']->User['Id'], 'Module' => $Module, 'Operation' => $Operation, 'Value' => $Value)); 9 if(array_key_exists('User', $this->System->Modules) and 10 array_key_exists('Id', $this->System->Modules['User']->User)) 11 $UserId = $this->System->Modules['User']->User['Id']; 12 else $UserId = NULL; 13 $this->Database->insert('Log', array('Time' => 'NOW()', 14 'User' => $UserId, 'Module' => $Module, 15 'Operation' => $Operation, 'Value' => $Value)); 10 16 //echo($this->Database->LastQuery); 11 17 } -
trunk/Modules/Meteostation/Download.php
r467 r468 4 4 5 5 $MeteoStation = new MeteoStation($System->Database, $System); 6 $MeteoStation->DownloadAll(); 6 while(true) 7 { 8 $MeteoStation->DownloadAll(); 9 sleep(60); 10 } 7 11 8 12 ?> -
trunk/Modules/Meteostation/Meteostation.php
r467 r468 1 1 <?php 2 3 include_once('../../Common/Image.php'); 2 4 3 5 class PageMeteo extends Page … … 11 13 class MeteoStation extends AppModule 12 14 { 13 15 var $Data; 16 14 17 function __construct($Database, $System) 15 18 { … … 48 51 'RelHumidity' => $Data['RelHumidity'], 'AbsHumidity' => $Data['AbsHumidity'], 49 52 'DewPoint' => $Data['DewPoint'])); 53 $this->Data = $Data; 50 54 } 51 55 … … 56 60 { 57 61 $this->DownloadData($DbRow['Id'], $DbRow['URL']); 62 $this->CreateImage('cache/'.$DbRow['Id'].'.png'); 58 63 } 64 } 65 66 function CreateImage($FileName) 67 { 68 $Image = new Image(); 69 $Image->SetSize(150, 150); 70 $Image->Brush->Color = COLOR_WHITE; 71 $Image->FillRect(0, 0, $Image->GetWidth(), $Image->GetHeight()); 72 //$Image->Font->Color = COLOR_RED; 73 //$Image->Line(10, 10, 100, 100); 74 $Image->TextOut(10, 10, 'Meteo Koliba Zděchov'); 75 $Image->TextOut(10, 30, 'Teplote: '.$this->Data['Temperature'].' °C'); 76 $Image->SaveToFile($FileName); 59 77 } 60 78 -
trunk/sql/updates/468.sql
r467 r468 33 33 ALTER TABLE `MeteoStationMeasure` 34 34 ADD CONSTRAINT `MeteoStationMeasure_ibfk_1` FOREIGN KEY (`MeteoStation`) REFERENCES `MeteoStation` (`Id`); 35 36 ALTER TABLE `Log` CHANGE `User` `User` INT( 11 ) NULL DEFAULT NULL ;
Note:
See TracChangeset
for help on using the changeset viewer.