Ejemplo n.º 1
0
 public function get_view()
 {
     $html = '';
     $league_table = new league_table();
     $league_table->set_year(date('Y'));
     $league_table->get_flights();
     $league_table->class = '\\object\\pilot_official';
     /** @var \object\pilot[]|\object\pilot_official[] $array */
     $array = [];
     foreach ($league_table->flights as $t) {
         if ($league_table->options->split_classes && $t->class == 5) {
             $t->ClassID += 8000;
         }
         if (isset($array[$t->ClassID])) {
             $array[$t->ClassID]->add_flight($t);
         } else {
             /** @var $class \object\pilot */
             $class = new $league_table->class();
             $class->output_function = 'csv';
             $class->set_from_flight($t, $league_table->max_flights, $league_table->options->split_classes);
             $array[$t->ClassID] = $class;
         }
     }
     if (isset($array)) {
         usort($array, ['\\module\\tables\\object\\league_table', 'cmp']);
         //if(1)ShowTop4W($WHERE);
         $class1 = 1;
         $class5 = 1;
         $html .= '<pre>Pos ,Name ,Glider ,Club ,Best ,Second ,Third ,Forth ,Fifth ,Sixth ,Total' . "\n";
         for ($j = 0; $j < count($array); $j++) {
             if ($array[$j]->class == 1) {
                 $html .= $array[$j]->output($class1);
                 $class1++;
             } else {
                 $html .= $array[$j]->output($class5);
                 $class5++;
             }
         }
         $html .= '</pre>' . "\n";
         return $html;
     }
     return '';
 }
Ejemplo n.º 2
0
 public function do_submit()
 {
     $table = new _object\league_table();
     $table->use_preset($this->type, $this->year);
     if ($this->type == 10) {
         $table->options->pilot_id = $this->pilot;
     }
     $table->set_year($this->year);
     if ($this->no_min) {
         $table->options->minimum_score = 0;
     }
     if ($this->glider_mode) {
         $table->options->glider_mode = true;
     }
     if ($this->split_classes) {
         $table->options->split_classes = true;
     }
     get::header_redirect($table->get_url() . '?module=core&act=load_page&form=' . $_REQUEST['ajax_origin']);
 }