/** * Draw the control body */ function draw_body($parent = "0", $depth = 0) { $data = $this->getFunctionData($parent); for ($i = 0; $i < count($data); $i++) { echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; echo "<tr>"; echo "<td width=\"25\">" . drawSpacer(1, 1). "</td>"; echo "<td width=\"" . (250 - $depth * 25) . "\">" . drawSpacer(1, 1). "</td>"; echo "<td width=\"300\">" . drawSpacer(1, 1). "</td>"; echo "</tr>"; if ($depth == 0) { echo "<tr>"; echo "<td width=\"25\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>"; echo "<td width=\"250\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>"; echo "<td width=\"300\" style=\"border-bottom:1px solid black;\">" . drawSpacer(1, 1). "</td>"; echo "</tr>"; } echo "<tr>"; if (in_array($data[$i][ID], $this->configData)) { $checked = true; } else { $checked = false; } $chkbox = new Checkbox($data[$i][ID], "1", "embedded", $checked); $chkbox->draw(); $lbl = new Label("lbl", $data[$i][NAME], "bcopy"); $lbl->draw(); $lbl = new Label("lbl", $data[$i][DESC], "bcopy"); $lbl->draw(); echo "</tr>"; echo "<tr>"; echo "<td width=\"15\">" . drawSpacer(1, 1). "</td>"; echo "<td colspan=\"2\">" . drawSpacer(1, 1); $this->draw_body($data[$i][ID], ($depth + 1)); echo "</td>"; echo "</tr>"; echo "</table>"; } }
function drawEpaonnistuneet($tyyppi, &$joukkue) { $tekijat =& $joukkue->epaonnisrankut; $this->p('Epäonnistuneet rangaistuslaukaukset'); if (count($tekijat) > 0) { ?> <table> <tr> <th> <?php $this->p('nro'); ?> </th> <th> <?php $this->p('aika'); ?> </th> <th> <?php $this->p('tekijä'); ?> </th> <th> <?php $this->p('av/yv/tasa'); ?> </th> <th> <?php $this->p('Siirretyn rangaistuksen aikana'); ?> <br> <?php $this->p('tyhjämaali'); ?> </th> </tr> <?php $tyypit = array('no' => $this->tm->getText('Normaali'), 'yv' => $this->tm->getText('Ylivoima'), 'av' => $this->tm->getText('Alivoima')); $i = 1; foreach ($tekijat as $k => $v) { print '<tr> <td>'; print $i; print ' </td> <td>'; $cb = new Input($tyyppi . 'ertapahtumisaika' . $i, $v['tapahtumisaika'], 'text', 5); $cb->draw(); print ' </td> <td>'; $kotim = $this->toiminto->tiedot['kotimaalit']; $cs = new Select($joukkue->select, $tyyppi . 'ertekija' . $i, $v['tekija']); $cs->draw(); ?> </td> <td> <?php $cs = new Radiobutton($tyypit, $tyyppi . 'ertyyppi' . $i, $v['tyyppi']); //$cs = new Input('tyyppi'.$i,$v['tyyppi'],'text',8); $cs->LINEBREAK = '<br>'; $cs->draw(); ?> </td> <td> <?php $s = (isset($v['tyhjamaali']) and $v['tyhjamaali'] == 't'); $cs = new Checkbox($tyyppi . "tyhjamaali{$i}", 't', 'Tyhjä maali', $s); $cs->draw(); ?> <br> <?php $s = (isset($v['siirrangaikana']) and $v['siirrangaikana'] == 't'); $cs = new Checkbox($tyyppi . "siirrangaikana{$i}", 't', 'siirretyn rangaistuksen aikana', $s); $cs->draw(); ?> </td> </tr> <?php $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>'; }