Exemplo n.º 1
0
      <div class="form-group">
        <label for="region"><?php 
echo Yii::t('common', 'Region');
?>
</label>
        <?php 
echo CHtml::dropDownList('region', $region, Region::getWCARegions(), array('class' => 'form-control'));
?>
      </div>
      <div class="form-group">
        <label for="Competition_year"><?php 
echo Yii::t('common', 'Gender');
?>
</label>
        <?php 
echo CHtml::dropDownList('gender', $gender, Persons::getGenders(), array('class' => 'form-control'));
?>
      </div>
      <?php 
foreach (Results::getRankingTypes() as $_type) {
    ?>
      <?php 
    echo CHtml::tag('button', array('type' => 'submit', 'name' => 'type', 'value' => $_type, 'class' => 'btn btn-' . ($type == $_type ? 'warning' : 'theme')), Yii::t('common', ucfirst($_type)));
    ?>
      <?php 
}
?>
    </div>
  <?php 
$this->endWidget();
?>
Exemplo n.º 2
0
 private function statTop100()
 {
     $region = $this->sGet('region', 'China');
     $type = $this->sGet('type', 'single');
     $event = $this->sGet('event', '333');
     $gender = $this->sGet('gender', 'all');
     if (!in_array($type, Results::getRankingTypes())) {
         $type = 'single';
     }
     if (!array_key_exists($gender, Persons::getGenders())) {
         $gender = 'all';
     }
     if (!array_key_exists($event, Events::getNormalEvents())) {
         $event = '333';
     }
     if (!Region::isValidRegion($region)) {
         $region = 'China';
     }
     $statistic = array('class' => 'Top100', 'type' => $type, 'event' => $event, 'gender' => $gender, 'region' => $region);
     $this->title = Yii::t('statistics', 'Chinese Top 100 Results');
     $this->pageTitle = array('Fun Statistics', $this->title);
     $this->breadcrumbs = array('Results' => array('/results/index'), 'Statistics' => array('/results/statistics'), $this->title);
     $data = Statistics::buildRankings($statistic);
     extract($data);
     $this->render('stat/top100', array('statistic' => $statistic, 'time' => $time, 'region' => $region, 'gender' => $gender, 'event' => $event, 'type' => $type));
 }