source: branches/mvc/Application/Controller/Add.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: 828 bytes
Line 
1<?php
2
3include_once(dirname(__FILE__).'/../../Base/Controller.php');
4include_once(dirname(__FILE__).'/../Model/Measure.php');
5
6class AddController extends Controller
7{
8 function Show()
9 {
10 $this->System->Output->FullPage = false;
11
12 $Output = '';
13 if(!array_key_exists('MeasureId', $_GET)) return('Nebylo zadáno Id měření.');
14 if(!array_key_exists('Value', $_GET)) return('Nebyla zadána hodnota.');
15 $Measure = new Measure($this->System);
16 $Measure->Load($_GET['MeasureId']);
17 if(!isset($Measure->Data['Id'])) return('Měření s Id '.$_GET['MeasureId'].' nenalezeno.');
18 $Measure->AddValue(array('Min' => $_GET['Value'], 'Avg' => $_GET['Value'], 'Max' => $_GET['Value']));
19 //$View = new MeasureView($this->System);
20 //return($View->Add());
21 return($Output);
22 }
23}
Note: See TracBrowser for help on using the repository browser.