function drawJaahyt($tyyppi, &$joukkue) { $this->p('Jäähyt'); if (count($joukkue->jaahyt) > 0) { ?> <table> <tr> <th> <?php $this->p('nro'); ?> </th> <th> <?php $this->p('# Nimi'); ?> </th> <th> <?php $this->p('Minuutit'); ?> </th> <th> <?php $this->p('Syy'); ?> </th> <th> <?php $this->p('tapahtumisaika'); ?> </th> <th> <?php $this->p('Päättymisaika'); ?> </th> </tr> <?php $i = 1; foreach ($joukkue->jaahyt as $k => $v) { print '<tr> <td>'; print $i; print ' </td> <td>'; $cs = new Select($joukkue->select, $tyyppi . 'jhsaaja' . $i, $v['saaja']); $cs->draw(); print ' </td> <td>'; $cb = new Input($tyyppi . "jhminuutit{$i}", $v['minuutit'], 'text', 5); $cb->draw(); print ' </td> <td>'; $cb = new Input($tyyppi . "jhsyy{$i}", $v['syy'], 'text', 5); $cb->draw(); print ' </td> <td>'; $cb = new Input($tyyppi . "jhtapahtumisaika{$i}", $v['tapahtumisaika'], 'text', 5); $cb->draw(); print ' </td> <td>'; $cb = new Input($tyyppi . "jhpaattymisaika{$i}", $v['paattymisaika'], 'text', 5); $cb->draw(); print '</td> </tr>'; $i++; } print '</table>'; } else { print '<br>'; $this->p('Ei merkintöjä.'); } print '<br>'; }
function drawJoukkeenPelaajat(&$joukkue) { print '<br>'; if (!$this->hasErrors) { $joukkue->sortPelaajat(); } $pelaajat = $joukkue->pelaajat; if (count($pelaajat) > 0) { ?> <table> <tr> <th><?php $this->p('pelaaja'); ?> </th> <th><?php $this->p('Numero'); ?> </th> <th><?php $this->p('Nimi'); ?> </th> <th><?php $this->p('Maalivahti'); ?> </th> <th><?php $this->p('kapteeni'); ?> </th> <th><?php $this->p('(+/-)'); ?> </th> <th><?php $this->p('Peliaika'); ?> </th> <th><?php $this->p('Lisätiedot'); ?> </th> </tr> <?php $toimih = array(); foreach ($pelaajat as $p) { $hid = $p['pelaaja']; print '<tr>'; print '<td>'; array_push($toimih, array($hid, $p['nimi'])); $kp = FALSE; if (isset($p['kokoonpanossa']) and $p['kokoonpanossa']) { $kp = TRUE; } $cb = new Checkbox($joukkue->tyyppi . 'pelaaja' . $hid, 'pelaaja', '', $kp); $cb->draw(); print '</td><td>'; $cb = new Input($joukkue->tyyppi . 'numero' . $hid, $p['numero'], 'text', 2); $cb->draw(); print '</td>'; print '<td>'; print $p['nimi']; ?> </td><td> <?php $cb = new Checkbox($joukkue->tyyppi . 'maalivahti' . $hid, 'maalivahti', '', $p['maalivahti'] == 't' and $kp); $cb->draw(); ?> </td><td> <?php $cb = new Checkbox($joukkue->tyyppi . 'kapteeni' . $hid, 'kapteeni', '', $p['kapteeni'] == 't' and $kp); $cb->draw(); print '</td>'; print '<td>'; $cb = new Input($joukkue->tyyppi . 'plusmiinus' . $hid, $p['plusmiinus'], 'text', 3); $cb->draw(); print '</td>'; print '<td>'; $cb = new Input($joukkue->tyyppi . 'peliaika' . $hid, $p['peliaika'], 'text', 5); $cb->draw(); print '</td>'; print '<td>'; $cb = new Input($joukkue->tyyppi . 'lisatieto' . $hid, $p['lisatieto'], 'text', 500); $cb->draw(); print '</td>'; print '</tr>'; } print '</table>'; print '<br><br>'; print '<table>'; $tar = array(array('', $this->tm->getText('Valitse toimihenkilö'))); usort($toimih, 'toimihenkSort'); $toimih = $tar + $toimih; $t = $joukkue->tyyppi == 'koti' ? 'a' : 'b'; for ($i = 1; $i < 6; $i++) { print '<tr><td>'; $this->p('Toimihenkilö'); print " {$i}"; print '</td><td>'; $cs = new Select($toimih, $t . 'toimihenkilo' . $i, $this->toiminto->tiedot[$t . 'toimihenkilo' . $i][0]->VALUE); $cs->draw(); //print_r($this->toiminto->tiedot[$t.'toimihenkilo'.$i][0]); print '</td></tr>'; } print '</table>'; } else { $this->p('Ei pelaajatietoja'); } print '<br>'; print '<br>'; }