source: branches/mvc/Application/Model/Measurement/MeasureClient.php

Last change on this file was 47, checked in by chronos, 10 years ago
  • Odstraněno: Zbytečná PHP ukončovací značka "?>" z konce všech souborů.
File size: 1.3 KB
Line 
1<?php
2
3include_once(dirname(__FILE__).'/../../../Base/Model.php');
4
5class MeasureClient extends Model
6{
7 function Process()
8 {
9 $DbResult = $this->Database->select('MeasureClient', '*');
10 while($MeasureClient = $DbResult->fetch_assoc())
11 {
12 $DbResult2 = $this->Database->select('MeasureMethod', '*', 'Id='.$MeasureClient['Method']);
13 $MeasureMethod = $DbResult2->fetch_assoc();
14 echo($MeasureClient['MeasureId'].',');
15 include_once(dirname(__FILE__).'/'.$MeasureMethod['MeasureClass'].'.php');
16 $MeasureMethod['MeasureClass'] .= 'Measurement';
17 if(class_exists($MeasureMethod['MeasureClass']))
18 {
19 $MeasureClass = new $MeasureMethod['MeasureClass']($this->System);
20 if(method_exists($MeasureClass, $MeasureMethod['Method']))
21 {
22 if($MeasureClient['Parameter'] != '') $Value = $Measure->$MeasureMethod['Method']($MeasureClient['Parameter']);
23 else $Value = $MeasureClass->$MeasureMethod['Method']();
24 echo(file_get_contents('http://'.$MeasureClient['Host'].$MeasureClient['Path'].'/?M=Add&MeasureId='.$MeasureClient['MeasureId'].'&Value='.addslashes($Value)));
25 } else echo('Metoda '.$MeasureMethod['Method'].' neexistuje.');
26 } else echo('Třída '.$MeasureMethod['MeasureClass'].' neexistuje.');
27 }
28 }
29}
Note: See TracBrowser for help on using the repository browser.