Source for file StatsController.php

Documentation is available at StatsController.php

  1. <?php
  2. /**
  3.  * Controller class for managing competition statistics.
  4.  * 
  5.  * @author Margus Sellin <margus@bitweb.ee>
  6.  * @copyright Copyright (C) 2011. All rights reserved. Margus Sellin
  7.  * @category Controller
  8.  * @project olymp
  9.  * 
  10.  */
  11. class StatsController extends Zend_Controller_Action
  12. {
  13.     /**
  14.      * Index action.
  15.      * User chooses a competition, a year and a class from dropdownlists.
  16.      * Based on parameters chosen by user, the statistics table is displayed.
  17.      * 
  18.      * Not all the parameters are required.
  19.      */
  20.     public function indexAction()
  21.     {
  22.         $modelPiirkondKoond new Model_Piirkondkoond();
  23.         $modelValikKoond new Model_Valikkoond();
  24.         $modelLoppKoond new Model_Loppkoond();
  25.         $modelLahtineKoond new Model_Lahtinekoond();
  26.         
  27.         if($this->_request->isPost()) {
  28.             $competition $this->_getParam('competition');
  29.             $year $this->_getParam('year');
  30.             $class $this->_getParam('class');
  31.             
  32.             $competitionName '';
  33.             if($competition != 0{
  34.                 switch($competition{
  35.                     case 11:
  36.                         $stats $modelPiirkondKoond->fetchAreaStatistics($year$class);
  37.                         $competitionName .= 'Piirkonnavoor 'break;
  38.                     case 13:
  39.                         $stats $modelValikKoond->fetchAreaStatistics($year$class);
  40.                         $competitionName .= 'Valivõistlus 'break;
  41.                     case 2:
  42.                         $stats $modelLoppKoond->fetchAreaStatistics($year$class);
  43.                         $competitionName .= 'Lõppvoor 'break;
  44.                     case 15:
  45.                         $stats $modelLahtineKoond->fetchAreaStatistics($year$class);
  46.                         $competitionName .= 'Lahtine võistlus 'break;
  47.                 }
  48.                 $competitionName .= $year '.a ' $class '.klass';
  49.                 $this->view->competitionName $competitionName;
  50.                 $this->view->stats $stats;
  51.             }
  52.         }
  53.     }
  54.  
  55. }

Documentation generated on Tue, 14 Jun 2011 20:06:17 +0300 by phpDocumentor 1.4.1