/**
 * funkcios preskaux same kiel sercxu() (el iloj_html), sed kun nova implementado.
 *
 * Diferencoj:
 *
 * $sumoj - por cxiu sum-linio ekzistas array (en $sumoj). En cxiu linio-array
 *      estas po element-array por kolono, kun tri elementoj:
 *   [0] - La teksto de la kampo. Se vi uzas XX, tie aperos la rezulto
 *         de la sumado.
 *   [1] - La speco de la sumado. eblecoj:
 *              A - simple nur kalkulu, kiom da linioj estas.
 *              J - kalkulu, kiom ofte aperas 'J' en la koncerna kampo
 *              E - kalkulu, kiom ofte enestas io en la koncerna kampo
 *              N - adiciu la numerojn en la koncerna kampo.
 *   [3] - arangxo ('l', 'r', 'z' - vidu cxe $kolumoj - [3].)
 * $identifikilo - estas uzata por la ligoj por reordigi, tiel cxe pluraj
 *                 tabeloj en la sama pagxo la gxusta estos montrita.
 * $extra - ['Spaltenrechnung'] ne plu funkcias.
 *
 */
function sercxu_nova($sql, $ordigo, $kolumnoj, $sumoj, $identifikilo, $extra, $csv, $antauxteksto, $almenuo, $proprakapo = "jes")
{
    if ($csv < 2 and $proprakapo == 'jes') {
        HtmlKapo();
        eoecho("<p>{$antauxteksto}</p>");
    } else {
        if ($csv >= '2') {
            header("Content-Type: application/octet-stream");
            //csv als Download anbieten
            header("Content-Disposition: attachment; filename='csv_export.txt'");
        }
    }
    $eigenlink = "sercxrezultoj.php?elekto=memligo&id={$identifikilo}";
    $_SESSION["memligo"][$identifikilo]["sql"] = $sql;
    $_SESSION["memligo"][$identifikilo]["antauxteksto"] = $antauxteksto;
    $_SESSION["memligo"][$identifikilo]["kolumnoj"] = $kolumnoj;
    $_SESSION["memligo"][$identifikilo]["sumoj"] = $sumoj;
    $_SESSION["memligo"][$identifikilo]["aldone"] = $extra;
    $_SESSION['memligo'][$identifikilo]["almenuo"] = $almenuo;
    $klaso = array("para", "malpara");
    $arangxo = array("r" => "dekstren", "d" => "dekstren", "l" => "maldekstren", "m" => "maldekstren", "z" => "centren", "c" => "centren");
    $inversa = array("asc" => "desc", "desc" => "asc");
    if ($csv == 0) {
        echo "<table>\n";
        echo "<tr class='titolo'>";
    }
    $i = 0;
    while (isset($kolumnoj[$i])) {
        if ($csv == 0) {
            echo "<th class='" . $arangxo[$kolumnoj[$i][3]] . "'>";
            if ($ordigo[0] == $kolumnoj[$i][0]) {
                ligu($eigenlink . "&orderby=" . $kolumnoj[$i][0] . "&asc=" . $inversa[$ordigo[1]], $kolumnoj[$i][1] . "<img src='bildoj/" . $ordigo[1] . "_order.gif' />");
            } else {
                if (is_numeric($kolumnoj[$i][0])) {
                    echo $kolumnoj[$i][1];
                } else {
                    ligu($eigenlink . "&orderby=" . $kolumnoj[$i][0] . "&asc=asc", $kolumnoj[$i][1]);
                }
            }
            echo "</th>";
        } else {
            eoecho($kolumnoj[$i][0] . ";");
        }
        $i++;
    }
    if ($csv >= '2') {
        echo "\n";
    } else {
        if ($csv == 1) {
            echo "<br/>\n";
        } else {
            echo "</tr>\n";
        }
    }
    $result = sql_faru($sql . " order by " . $ordigo[0] . " " . $ordigo[1]);
    if (DEBUG) {
        var_export($result);
    }
    $linionumero = 0;
    while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
        $linionumero += 1;
        if ($csv == 0) {
            echo "<TR  onmouseover='marku(this)' onmouseout='malmarku(this)' " . " class='" . $klaso[$linionumero % 2] . "'>\n";
            // TODO: Javascript ausprobieren
        }
        $i = 0;
        while (isset($kolumnoj[$i])) {
            $kolumno = $kolumnoj[$i];
            $temp = $kolumno[0];
            $textinhalt = $kolumno[2];
            $aus = $kolumno[3];
            $linkk = $kolumno[4];
            if ($kolumno[5] != '-1') {
                $doselectWert = $row[$kolumno[5]];
            } else {
                $doselectWert = '-1';
            }
            //echo "<TD align=$ausrichtung[$aus]>$row[$temp]</TD>";
            if ($csv == 0) {
                echo "<td align={$ausrichtung[$aus]}>";
            }
            if ($linkk != '' and $csv == 0) {
                $ausgeben = str_replace('XXXXX', $row[$temp], $linkk);
                echo "<A href=" . $ausgeben;
                if ($doselectWert && $doselectWert != '-1') {
                    echo " onClick='doSelect(" . $doselectWert . ");'";
                }
                echo ">";
            }
            $ez &= $extra['Zeichenersetzung'];
            if (isset($ez[$i][$row[$temp]])) {
                $ausgeben = str_replace('XXXXX', $extra['Zeichenersetzung'][$i][$row[$temp]], $textinhalt);
            } else {
                if (isset($extra['anstatauxo_funkcio'][$i])) {
                    $nova_teksto = $extra['anstatauxo_funkcio'][$i]($row[$temp]);
                    $ausgeben = str_replace('XXXXX', $nova_teksto, $textinhalt);
                } else {
                    $ausgeben = str_replace('XXXXX', $row[$temp], $textinhalt);
                }
            }
            if (isset($extra['okupigxtipo']) and $extra['okupigxtipo'] == $i) {
                $ausgeben = okupigxtipo($row[$temp]);
            }
            if ($csv != '2') {
                eoecho($ausgeben);
            } else {
                echo utf8_decode($ausgeben);
            }
            // eldonas en ISO-8859-1
            if ($csv != 0) {
                echo ";";
            } else {
                if ($linkk != '') {
                    echo "</a></td>\n";
                } else {
                    echo "</td>\n";
                }
            }
            //Zusammenzählen
            $SummenIndex = 0;
            while (isset($sumoj[$SummenIndex])) {
                $ii = $i;
                switch ($sumoj[$SummenIndex][$i][1]) {
                    case 'A':
                        $summe[$SummenIndex][$i] += 1;
                        break;
                    case 'J':
                        if ($row[$temp] == 'J') {
                            $summe[$SummenIndex][$i] += 1;
                        }
                        break;
                    case 'Z':
                        if ($row[$temp] != 0) {
                            $summe[$SummenIndex][$i] += 1;
                        }
                        break;
                    case 'E':
                        if ($row[$temp] != '') {
                            $summe[$SummenIndex][$i] += 1;
                        }
                        break;
                    case 'N':
                        if ($row[$temp] != '') {
                            $summe[$SummenIndex][$i] += $row[$temp];
                        }
                        break;
                }
                $SummenIndex += 1;
            }
            $i++;
        }
        if ($csv == 0 and isset($extra['litomanko'])) {
            $manko = eltrovu_litojn($row[$extra['litomanko']]);
            for ($i = 1; $i <= 7; $i++) {
                if ($manko[$i] == '1') {
                    echo "<td>X</td>";
                } else {
                    echo "<td>-</td>";
                }
            }
            echo "<td>";
            rajtligu("cxambroj.php?cx_ago=forgesu&partoprenID=" . $row[$extra['litomanko']], "serc^u", "", "cxambrumi");
            echo "</td>";
        }
        if ($csv == 0 and isset($extra['tutacxambro'])) {
            $partoprenanto = new Partoprenanto($row[0]);
            $partopreno = new Partopreno($row[1]);
            // echo "CX: ".eltrovu_cxambrojn($row[$extra['tutacxambro']]);
            $cxambro = mysql_fetch_array(eltrovu_cxambrojn($row[$extra['tutacxambro']]));
            if ($cxambro[0] != '') {
                echo "</tr>\n<tr><td colspan='" . count($kolumnoj) . "'>";
                montru_kunlogxantojn($cxambro[0]);
                montru_cxambron($cxambro[0], $_SESSION["renkontigxo"], $partoprenanto, $partopreno, 'granda');
                echo "</td>\n";
            }
        }
        if ($csv == 0) {
            echo "</tr>\n";
        } else {
            if ($csv == 1) {
                echo "<br/>\n";
            } else {
                echo "\n";
            }
        }
    }
    if ($csv == 0) {
        // sumoj
        // TODO: rerigardu indeksojn
        $SummenIndex = 0;
        while (isset($sumoj[$SummenIndex][0])) {
            echo "<tr class='sumoj'>";
            $i = 0;
            while (isset($sumoj[$SummenIndex][$i])) {
                $aus = $sumoj[$SummenIndex][$i][2];
                echo "<td class='{$arangxo[$aus]}'>" . str_replace('XX', $summe[$SummenIndex][$i], $sumoj[$SummenIndex][$i][0]) . "</td>";
                $i += 1;
            }
            echo "</tr>\n";
            $SummenIndex += 1;
        }
        echo "</table>\n";
        if ($almenuo != "") {
            ligu("menuo.php?sercxfrazo={$sql}", "Enmeti en la maldekstran menuon", "is-aligilo-menuo");
        }
        if ($proprakapo == "jes") {
            echo "</body>\n</html>";
        }
    }
}
/**
 * Montras la aktualan staton de cxambro.
 *  $grandeco: - se ne donita aux "malgranda", montras nur 
 *             - se "granda", ...
 * verda se estas tauxga
 * rugxa se ne tauxgas (pro sekso)
 */
function montru_cxambron($cxambro, $renkontigxo, $partoprenanto, $partopreno, $grandeco = "malgranda")
{
    $cxam_sql = datumbazdemando(array("litonombro", "nomo", "tipo", "etagxo", "dulita", "rimarkoj"), "cxambroj", "ID = '{$cxambro}'");
    $cxam_rezulto = sql_faru($cxam_sql);
    $row = mysql_fetch_array($cxam_rezulto, MYSQL_BOTH);
    if (tauxgas($partopreno->datoj[cxambrotipo], $partoprenanto->datoj[sekso], $row[tipo])) {
        $koloro = "green";
    } else {
        if ($row[tipo] == '') {
            $koloro = "black";
        } else {
            $koloro = "red";
        }
    }
    if ($grandeco == "granda") {
        ligu("cxambroj.php?etagxo=" . $row[etagxo], "Etag^o " . $row[etagxo]);
        echo " |";
    }
    ligu("cxambroj.php?cxambronombro={$cxambro}", "C^ambro: {$row['nomo']}");
    echo "<font color={$koloro}><strong>";
    if ($row[tipo] == "v") {
        echo " (vira)";
    } else {
        if ($row[tipo] == "i") {
            echo " (ina)";
        } else {
            if ($row[tipo] == "g") {
                echo " (gea)";
            } else {
                echo " (nedifinita)";
            }
        }
    }
    echo "</strong></font>\n";
    rajtligu("kreu_cxambron.php?id={$cxambro}", $grandeco == 'granda' ? "redaktu bazajn informojn" : "red.", "", "teknikumi", "ne");
    if ($grandeco == "granda") {
        //sxangxi la cxambrotipon
        echo "<form action='cxambroj.php?cxambronombro={$cxambro}' method='post'>";
        entajpbutono("(", "tipo", $row[tipo], "g", "g", 'gea');
        entajpbutono("", "tipo", $row[tipo], "v", "v", 'vira');
        entajpbutono("", "tipo", $row[tipo], "i", "i", 'ina)');
        entajpbokso("[", dulita, $row[dulita], J, J, "dulita c^ambro]");
        entajpejo("<BR>Rimarkoj:", "rimarkoj", $row[rimarkoj], 20);
        send_butono("Ek!");
        echo "</form>";
    }
    $renkontigxdauxro = kalkulu_tagojn($renkontigxo->datoj[de], $renkontigxo->datoj[gxis]);
    $partoprentagoj = kalkulu_tagojn($partopreno->datoj[de], $partopreno->datoj[gxis]);
    if ($partoprenanto->datoj[ID] and $grandeco == "granda") {
        echo "<form ACTION='cxambroj.php?cxambronombro={$cxambro}' METHOD='POST'>\n";
    }
    echo "<Table border><TR><TD>Nokto: ";
    if ($grandeco == "granda") {
        $manko = eltrovu_litojn($partopreno->datoj[ID]);
        $ar = JMTdisigo($renkontigxo->datoj[de]);
        $tago = $ar[tago];
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            $ar = JMTdisigo(sekvandaton($renkontigxo->datoj[de], $noktoj));
            $sektago = $ar[tago];
            echo "<TD align=\"center\"> {$tago} / {$sektago}";
            $tago = $sektago;
        }
        echo "<TD><TD align=\"center\">tuta tempo";
    } else {
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            echo "<TD>{$noktoj}</noktoj>";
        }
    }
    for ($litoj = 1; $litoj <= $row[litonombro]; $litoj++) {
        echo "<TR valign = center>\n<TD nowrap>Lito: " . $litoj;
        $uzata = false;
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            $r = cxambro_uzata($cxambro, $noktoj, $litoj);
            $diferenco = $r[nokto_gxis] - $noktoj;
            echo "<TD align = center ";
            if ($diferenco > 0) {
                $noktoj += $diferenco++;
                //TODO:? hehe [respondo de Martin:] Das ist einfach nur eine geniale Funktion.
                echo "colspan = {$diferenco} ";
            }
            if ($r[rezervtipo] == "d") {
                echo " bgcolor=green> ";
                $uzata = true;
            } else {
                if ($r[rezervtipo] == "r") {
                    echo " bgcolor=yellow> ";
                    $uzata = true;
                } else {
                    if ($partoprenanto and $grandeco == "granda" and sekvandaton($renkontigxo->datoj[de], $noktoj - 1) >= $partopreno->datoj[de] and sekvandaton($renkontigxo->datoj[de], $noktoj) <= $partopreno->datoj[gxis] and $manko[$noktoj] != "1") {
                        echo "";
                        entajpbokso(">", "nokto[{$noktoj}]", "falseoderso", "", "{$litoj}", "", "", "ne");
                    } else {
                        echo " bgcolor=white>--";
                    }
                }
            }
            echo "<A href = \"partrezultoj.php?partoprenidento={$r['3']}&partoprenantoidento={$r['0']}\" onClick=\"doSelect({$r['0']});\">";
            if (($grandeco == "granda" or $diferenco > 3) and $r[partoprenantoID]) {
                $loka_partoprenanto = new Partoprenanto($r[partoprenantoID]);
                $teksto = $loka_partoprenanto->datoj[personanomo] . " " . $loka_partoprenanto->datoj[nomo] . " (" . eltrovu_landon($loka_partoprenanto->datoj[lando]) . " / " . $loka_partoprenanto->datoj[sekso] . "/" . $loka_partopreno->datoj[agxo] . ")";
                if ($grandeco == "granda") {
                    eoecho($teksto . "<BR> ");
                } else {
                    eoecho($teksto);
                }
                //eoecho (/*substr*/($teksto,0,$diferenco*3));
            }
            if ($diferenco > 3 and !$r[partoprenantoID] or $grandeco == "granda") {
                switch ($r[rezervtipo]) {
                    case "d":
                        echo "disdonita";
                        break;
                    case "r":
                        echo "rezervita";
                        break;
                }
            } else {
                if ($diferenco < 4) {
                    echo $r[rezervtipo];
                }
            }
            echo "</A>";
        }
        if ($partoprenanto and $grandeco == "granda") {
            echo "<TD>&nbsp;&nbsp;<TD align=center>";
            if ($uzata == false and $partoprentagoj == $renkontigxdauxro and $manko[sumo] == 0) {
                entajpbokso("", "tute", "falseoderso", "", "{$litoj}", "", "", "ne");
            }
        }
    }
    echo "</Table>";
    if ($partoprenanto->datoj[ID] and $grandeco == "granda") {
        echo "<select name=\"tipo\" size=1>\n";
        echo "<option selected>rezervi\n";
        echo "<option>disdoni\n";
        echo "</select><BR>\n";
        send_butono("Faru!");
        echo "</FORM>";
    }
    if ($grandeco != "granda") {
        eoecho($row[rimarkoj]);
    }
}
Пример #3
0
 $rezulto = eltrovu_cxambrojn($_SESSION["partopreno"]->datoj[ID]);
 while ($row = mysql_fetch_array($rezulto, MYSQL_NUM)) {
     $sql = datumbazdemando("nomo", "cxambroj", "id = '{$row['0']}'");
     $cxambronomo = mysql_fetch_array(sql_faru($sql), MYSQL_NUM);
     eoecho(sekvandaton($partopreno_renkontigxo->datoj[de], $row[1] - 1) . " - " . sekvandaton($partopreno_renkontigxo->datoj[de], $row[2]) . " ({$row['3']})\n");
     if (rajtas("cxambrumi")) {
         ligu("cxambroj.php?cxambronombro={$row['0']}", "c^ambro: {$cxambronomo['0']}");
     } else {
         eoecho("c^ambro: " . $cxambronomo[0] . " ");
     }
     rajtligu("partrezultoj.php?forgesendalito={$row['4']}", "forgesu", "", "cxambrumi", "jes");
     echo "<br/>";
     $valoro = "true";
 }
 // TODO: Anzeigen, ob für jede Nacht ein Zimmer da ist.      FEHLT Im Moment noch
 $manko = eltrovu_litojn($_SESSION["partoprenanto"]->datoj[ID]);
 if ($_SESSION["partopreno"]->datoj[domotipo] == "J") {
     if (!$valoro) {
         eoecho($_SESSION["partoprenanto"]->personapronomo . " g^is nun ne havas c^ambron.<BR>");
         rajtligu("cxambroj.php?cx_ago=forgesu", "elektu unu", "", "cxambrumi", "jes");
     } else {
         rajtligu("cxambroj.php?cx_ago=forgesu", "elektu plian", "", "cxambrumi");
     }
     rajtligu("cxambro_sxangxo.php", "s^ang^i kun aliulo", "", "cxambrumi", "");
 }
 echo "</TD><TD>";
 if (nova_kunlogxado) {
     $ri = $_SESSION['partoprenanto']->personapronomo;
     $Ri = ucfirst($ri);
     eoecho("Kunlog^deziroj de kaj pri {$ri}:");
     // !!!!!!!!!!!!!!!!
 /**
  * kreas konfirmilon en unu el du lingvoj.
  * $partopreno    - Partopreno-objekto
  * $partoprenanto - la Partoprenanto-objekto
  * $renkontigxo   - Renkontigxo-objekto
  * $kotizo        - Kotizo-objekto (estu kreita el la tri antauxe
  *                   menciitaj objektoj)
  * $lingvo - aux "de" aux "eo".
  */
 function kreu_konfirmilon_unulingve($partopreno, $partoprenanto, $renkontigxo, $kotizo, $lingvo)
 {
     $this->pdf->AddPage();
     $this->pdf->SetLeftMargin(20);
     $this->pdf->SetRightMargin(20);
     if ($lingvo == "eo") {
         $jesne = array('J' => 'jes', 'N' => 'ne', 'n' => 'ne', '' => 'ne');
     } else {
         $jesne = array('J' => 'ja', 'N' => 'nein', 'n' => 'nein', '' => 'nein');
     }
     $this->pdf->Image('bildoj/eo-logo.png', 162, 10, 28);
     $this->pdf->SetFont($this->font, '', 30);
     $this->pdf->text(39, 17, "germana esperanto-junularo");
     $this->pdf->text(43 + 2, 25, "deutsche esperanto-jugend");
     $this->pdf->SetFont('Arial', 'I', 12);
     $this->pdf->text(105, 34, ".... wir machen Völkerverständigung");
     $this->pdf->SetFont($this->font, '', 8);
     // $this->pdf->SetFont('Arial','',8);
     // TODO: an 2005 anpassen
     //TODO: aus der DB nehmen
     $this->pdf->text(20, 51, "Julia Noe, August-Bebel-Str. 42/42, 15234 Frankfurt/Oder, Germanio");
     // $this->pdf->text(20,51, "Martin Sawitzki, Max-Planck-Ring 8d, 98693 Ilmenau, Germanio");
     $this->pdf->line(20, 53, 97, 53);
     // falc- kaj truil-markiloj
     $this->pdf->line(4, 100, 9, 100);
     $this->pdf->line(4, 147, 7, 147);
     $this->pdf->line(4, 198, 9, 198);
     // adreso de la partoprenanto
     $this->pdf->SetFont($this->font . 'D', '', 12);
     $this->esso($partoprenanto->datoj[personanomo] . $partoprenanto->datoj[adresaldonajxo] . $partoprenanto->datoj[strato] . $partoprenanto->datoj[posxtkodo]);
     $this->pdf->setY(59);
     $this->pdf->write(5, eo($partoprenanto->datoj[personanomo] . " " . $partoprenanto->datoj[nomo]));
     $this->pdf->ln();
     if ($partoprenanto->datoj[adresaldonajxo] != '') {
         $this->pdf->write(5, eo($partoprenanto->datoj[adresaldonajxo]));
         $this->pdf->ln();
     }
     $this->pdf->write(5, eo($partoprenanto->datoj[strato]));
     $this->pdf->ln();
     $this->pdf->write(5, eo($partoprenanto->datoj[posxtkodo] . " " . $partoprenanto->datoj[urbo]));
     $this->pdf->ln();
     $this->pdf->write(5, eo(eltrovu_landon_lokalingve($partoprenanto->datoj[lando])));
     $this->pdf->SetFont($this->font, '', 10);
     $this->pdf->setY(90);
     $this->pdf->write(5, "Saluton!");
     $this->pdf->ln();
     $this->pdf->write(5, eo(donu_tekston_lauxlingve("konf2-enkonduko", $lingvo, $renkontigxo)));
     //    $this->pdf->write(5,
     // 					 dulingva("La organiza teamo tre g^ojas ke vi intencas veni al la".
     // 							  " c^ijara IS en " . $renkontigxo->datoj['loko'].
     // 							  ". Jen viaj datumoj:",
     // 							  "Das Organisationsteam freut sich sehr, dass du zum diesjährigen IS in Wetzlar kommen willst. Hier deine Daten:", $lingvo));
     $this->pdf->ln();
     $this->pdf->SetFontSize(10);
     $this->pdf->setXY(30, 102);
     if ($kotizo->landakategorio == 'C') {
         $this->pdf->cell(40, 4, dulingva("Alveno de via alig^ilo:", "Ankunft der Anmeldung:", $lingvo), 0, 2, 'R');
     } else {
         $this->pdf->cell(40, 4, eo("Alveno de via antau^pago:", "Ankunft der Anzahlung:", $lingvo), 0, 2, 'R');
     }
     $this->pdf->cell(40, 4, eo("Via log^landa kategorio:", "Deine Landeskategorie", $lingvo), 0, 2, 'R');
     $this->pdf->cell(40, 4, eo("Via ag^kategorio:", "Deine Alterskategorie", $lingvo), 0, 2, 'R');
     $this->pdf->cell(40, 4, eo("Partoprentagoj:", "Teilnahmetage", $lingvo), 0, 2, 'R');
     // TODO: Se ni dekuplas memzorgo kaj amaslogxejo (aux junulargasto kaj mangxado),
     // kreu diversajn kampojn
     $this->pdf->cell(40, 4, eo("Memzorganto:", "Selbstversorger:"), 0, 2, 'R');
     $this->pdf->cell(40, 4, eo("Dulita c^ambro:", "Zweibettzimmer:", $lingvo), 0, 2, 'R');
     $this->pdf->SetFont($this->font . 'D', '', 10);
     $kategoritekstoj = array("de" => array("antaux" => "vor dem", "post" => "nach dem", "ne" => "überhaupt nicht"), "eo" => array("antaux" => "antau^ la", "post" => "post la", "ne" => "ankorau^ ne"));
     if ($kotizo->krom_surloka > 0.05) {
         $alk = $kategoritekstoj[$lingvo]['ne'];
     } else {
         if ($kotizo->aligxkategorio == 2) {
             $alk = $kategoriteksto[$lingvo]['antaux'] . ' ' . $renkontigxo->datoj['meza'];
         } else {
             $alk = $kategoriteksto[$lingvo]['post'] . " " . $renkontigxo->datoj['meza'];
         }
     }
     //    switch ($kotizo->aligxkategorio)
     // 	 {
     // 	 case 2: $alk="antau^ la 01.11.2004";break;   //TODO: aus der DB holen
     // 	 case 1: $alk="post la 01.11.2004";break;
     // 	   // case 0: $alk="post la 01.12.2003";break;
     // 	 }
     //    // TODO: Kam überhaupt schon Anzahlung?
     //    if ($kotizo->krom_surloka > 5)
     // 	 {
     // 	   $alk = "ankorau^ ne";
     // 	 }
     $this->pdf->setXY(70, 102);
     $this->pdf->cell(40, 4, eo($alk), 0, 2, 'L');
     $this->pdf->cell(40, 4, eo($kotizo->landakategorio), 0, 2, 'L');
     //  switch ($kotizo->agxkategorio)
     //  {
     //     case 2: $aka="g^is 20 jaroj";break;   //TODO: aus der DB holen
     //     case 1: $aka="21 g^is 26 jaroj";break;
     //     case 0: $aka="pli ol 26 jaroj";break;
     //  }
     $aka = $kotizo->formatu_agxkategorion($renkontigxo);
     $this->pdf->cell(40, 4, eo($aka), 0, 2, 'L');
     $this->pdf->cell(40, 4, eo($kotizo->partoprentagoj), 0, 2, 'L');
     if ($partopreno->datoj[domotipo] == 'M') {
         $memzorganto = dulingva("jes", "ja", $lingvo);
         $domotipo = 'memzorgantejo';
         $en_domo = dulingva("en la memzorgantejo", "im Memzorgantejo", $lingvo);
     } else {
         $memzorganto = dulingva("ne", "nein", $lingvo);
         $domotipo = 'junulargastejo';
         $en_domo = dulingva("en la junulargastejo", "in der Jugendherberge", $lingvo);
     }
     $this->pdf->cell(40, 4, $memzorganto, 0, 2, 'L');
     //certigi, ke vere estas dulita cxambro
     if ($kotizo->litoj == '2') {
         $this->pdf->cell(40, 4, $jesne['J'], 0, 2, 'L');
     } else {
         $this->pdf->cell(40, 4, $jesne['N'], 0, 2, 'L');
     }
     $this->pdf->SetFont($this->font, '', 10);
     $this->pdf->setXY(120, 102);
     $this->pdf->cell(40, 4, dulingva("Via kotizo estas:", "Dein Beitrag ist:", $lingvo), 0, 2, 'R');
     if ($kotizo->kromekskurso > 0) {
         $this->pdf->cell(40, 4, dulingva("ekskursa bileto:", "Teilnahme am Ausflug:", $lingvo), 0, 2, 'R');
     }
     $this->pdf->cell(40, 4, dulingva("Vi antau^pagis:", "Anzahlung:", $lingvo), 0, 2, 'R');
     $this->pdf->cell(40, 4, dulingva("Krompagoj:", "Zuzahlungen", $lingvo), 0, 2, 'R');
     $this->pdf->cell(40, 4, dulingva("Rabato:", "Rabatt:", $lingvo), 0, 2, 'R');
     $this->pdf->cell(40, 4, dulingva("Restas pagenda:", "Bleibt zu zahlen:", $lingvo), 0, 2, 'R');
     $this->pdf->SetFont($this->font . 'D', '', 8);
     // TODO: bessere Formulierung: Bitte den Rest zum IS bar mitbringen
     $this->pdf->cell(65, 4, dulingva("Dum la IS ni akceptos nur eu^ropajn eu^rojn!", "Während des IS nehmen wir nur europäische Euro an!", $lingvo), 0, 2, 'R');
     $this->pdf->SetFont($this->font . 'D', '', 10);
     $this->pdf->setXY(165, 102);
     $this->pdf->cell(20, 4, number_format($kotizo->bazakotizo, 2) . " EUR", 0, 2, 'R');
     if ($kotizo->kromekskurso > 0) {
         $this->pdf->cell(20, 4, number_format($kotizo->kromekskurso, 2) . " EUR", 0, 2, 'R');
     }
     $this->pdf->cell(20, 4, number_format($kotizo->antauxpago, 2) . " EUR", 0, 2, 'R');
     $this->pdf->cell(20, 4, number_format($kotizo->krompago - $kotizo->kromekskurso, 2) . " EUR", 0, 2, 'R');
     $this->pdf->cell(20, 4, number_format($kotizo->rabato, 2) . " EUR", 0, 2, 'R');
     $this->pdf->cell(20, 4, number_format($kotizo->pagenda, 2) . " EUR", 0, 2, 'R');
     $this->pdf->SetFont($this->font, '', 10);
     $this->pdf->setY(130);
     $litoj = eltrovu_litojn($partopreno->datoj[ID]);
     //echo "Litoj: ".$litoj["sumo"] ;
     //echo "K:".$kotizo->antauxpago." and ".$kotizo->landakategorio;
     if ($partopreno->datoj[partoprentipo] != 't' and $domotipo == 'junulargastejo') {
         $teksto = donu_tekston_lauxlingve("konf2-parttempa", $lingvo, $renkontigxo);
     } else {
         // TODO: (Cxu ankaux en Wetzlar?) In Trier haben wir genügend Betten
         if ($kotizo->krom_surloka > 5) {
             $teksto = anstatauxu(donu_tekston_lauxlingve("konf2-mankas-antauxpago", $lingvo, $renkontigxo), array("{{sumo}}" => $kotizo->minimuma_antauxpago() - $kotizo->antauxpago));
         } else {
             if ($litoj["sumo"] < $kotizo->partoprentagoj and $domotipo == 'junulargastejo') {
                 if ($litoj["sumo"] != '0') {
                     erareldono("Malg^usta litonombro. Mankus noktoj: (noktonombro:" . $litoj["sumo"] . ")");
                     halt();
                 } else {
                     $teksto = donu_tekston_lauxlingve("mankas-cxambro", $lingvo, $renkontigxo);
                 }
             } else {
                 //se cxio enordas
                 $teksto = anstatauxu(donu_tekston_lauxlingve("konf2-cxio-enordas", $lingvo, $renkontigxo), array("{{en_domo}}" => $en_domo));
                 $cioenordo = 'jes';
             }
         }
     }
     echo "<!-- teksto: {$teksto} -->\n";
     $this->pdf->write(5, eo($teksto));
     $this->pdf->ln(10);
     //$this->pdf->setY(155);
     $this->pdf->SetFont($this->font . 'D', '', 12);
     $this->pdf->cell(20, 5, dulingva("Gravaj informoj:", "Wichtige Informationen", $lingvo), 0, 2);
     $this->pdf->SetFont($this->font, '', 10);
     $this->pdf->setX(25);
     $teksto = donu_tekston_lauxlingve("konf2-gravaj-informoj", $lingvo, $renkontigxo);
     if ($partopreno->datoj['agxo'] < 18) {
         $teksto .= donu_tekston_lauxlingve("konf2-junulo", $lingvo, $renkontigxo);
     }
     if ($domotipo == 'junulargastejo' and $cioenordo == 'jes') {
         $teksto .= donu_tekston_lauxlingve("konf2-21a-horo", $lingvo, $renkontigxo);
         //aus der DB zaubern
         // 	   $teksto.="Ni povas garantii, ke vi ricevos liton, se vi alvenas g^is la 21a horo. Se vi alvenos pli poste, bonvolu sciigi nin pri via alventempo, por ke ni povu rezervi liton por vi. Alikaze vi riskas, ke vi ne ricevos liton.\n";
     } else {
         if ($domotipo == 'memzorgantejo') {
             $teksto .= donu_tekston_lauxlingve("konf2-memzorganto", $lingvo, $renkontigxo);
             // 	   $teksto.="Kiel memzorganto ni povas garantii al vi, ke c^iam estas loko en la amaslog^ejo. Kunportu vian dormsakon, aermatracon, mang^ilaron kaj c^ion ajn, kion vi bezonas.\n";
         }
     }
     if ($partoprenanto->datoj[lando] == HEJMLANDO) {
         $teksto .= donu_tekston_lauxlingve("konf2-membreco-averto", $lingvo, $renkontigxo);
     }
     $teksto .= ' ';
     $this->pdf->multicell(170, 5, eo($teksto));
     // $this->pdf->ln(5);
     // $this->pdf->setY(200);
     // TODO: cxu sencas absoluta pozicio?
     $this->pdf->setY(232);
     $this->pdf->write(5, eo(donu_tekston_lauxlingve("konf2-elkonduko", $lingvo, $renkontigxo)));
     $this->pdf->Image('bildoj/julia-subskribo-transparent.png', 100, 251, 80);
     // TODO: allgemein
     $this->pdf->Ln(10.0);
     $this->pdf->SetFont($this->font . 'D', '', 12);
     $this->pdf->cell(20, 5, dulingva("Enhavo:", "Inhalt", $lingvo), 0, 2);
     $this->pdf->SetFont($this->font, '', 10);
     $enhavo = dulingva("- tiu c^i konfirmilo\n" . "- la 2a informilo\n", "- Diese Bestätigung\n" . "- Die Esperanto-Version dieser Bestätigung\n" . "- Das zweite Informilo\n", $lingvo);
     if ($this->germane and $lingvo == "eo") {
         $enhavo .= "- la germanlingva versio de tiu c^i konfirmilo\n";
     }
     if ($partopreno->datoj['agxo'] < '18') {
         $enhavo .= dulingva("- gepatra permeso de via IS-partopreno", "- Elterliche Erlaubnis deiner IS-Teilnahme", $lingvo);
     }
     // $this->pdf->setXY(25,205);
     $this->pdf->multicell(170, 5, eo($enhavo));
 }
/**
 * Montras la aktualan staton de ĉambro.
 *  $grandeco: - se ne donita aŭ "malgranda", montras nur 
 *             - se "granda", ...
 * verda se estas taŭga
 * ruĝa se ne taŭgas (pro sekso)
 *
 * @todo transformu en pli bone uzeblan funkcio(j)n
 */
function montru_cxambron($cxambroID, $renkontigxo, $partoprenanto, $partopreno, $grandeco = "malgranda", $reenligo = "")
{
    $cxambro = new Cxambro($cxambroID);
    $row = $cxambro->datoj;
    if ($grandeco == "granda") {
        ligu("cxambroj.php?etagxo=" . $row['etagxo'], "Etag^o " . $row['etagxo']);
        echo " |";
    }
    ligu("cxambro-detaloj.php?cxambronumero=" . $cxambroID, "C^ambro: " . $row['nomo']);
    montru_cxambrosekson($row['tipo'], $partopreno, $partoprenanto);
    rajtligu("kreu_cxambron.php?id={$cxambroID}", $grandeco == 'granda' ? "redaktu bazajn informojn" : "red.", "", "teknikumi", "ne");
    if ($grandeco == "granda") {
        //formularo por sxangxi la cxambrotipon
        formularo_por_bazaj_cxambroinformoj($cxambro);
    }
    $renkontigxdauxro = $renkontigxo->renkontigxonoktoj();
    $partoprentagoj = is_object($partopreno) ? $partopreno->partoprennoktoj() : 0;
    echo "<form action='cxambroago.php' method='POST'>\n";
    tenukasxe("cxambronumero", $cxambroID);
    if (!$reenligo) {
        if ($_SERVER['REQUEST_METHOD'] == "GET") {
            $reenligo = $_SERVER['PHP_SELF'];
            if ($_SERVER['QUERY_STRING']) {
                $reenligo .= "?" . $_SERVER['QUERY_STRING'];
            }
        }
    }
    if ($reenligo) {
        tenukasxe("reiru", $reenligo);
    }
    echo "<table class='cxambrolisto-{$grandeco}'><tr><th>Nokto:</th>";
    if ($grandeco == "granda") {
        $manko = eltrovu_litojn($partopreno->datoj['ID']);
        $ar = JMTdisigo($renkontigxo->datoj['de']);
        $tago = $ar['tago'];
        $estis_elektebleco = false;
        // cxu estis ebla elekti liton por nokto?
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            $ar = JMTdisigo(sekvandaton($renkontigxo->datoj['de'], $noktoj));
            $sektago = $ar['tago'];
            echo "<th align='center'> {$tago} / {$sektago} </th>";
            $tago = $sektago;
        }
        if ($partoprenanto) {
            // ebleco mendi tutan tempon
            echo "<td/><th>tuta tempo</th>";
        }
        echo "</th>";
    } else {
        // simpla noktolisto
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            echo "<th>{$noktoj}</th>";
        }
    }
    echo "</tr>";
    for ($litoj = 1; $litoj <= $row['litonombro']; $litoj++) {
        echo "<tr >\n<th class='litonomo'>Lito: " . $litoj . "</th>";
        $uzata = false;
        for ($noktoj = 1; $noktoj <= $renkontigxdauxro; $noktoj++) {
            // detaloj pri la rezervado
            $r = cxambro_uzata($cxambroID, $noktoj, $litoj);
            if ($r) {
                $uzata = true;
                $noktoj += metu_partoprenant_litan_keston($r, $noktoj, $partopreno->datoj['ID'], $grandeco);
            } else {
                if ($partoprenanto and $grandeco == "granda" and sekvandaton($renkontigxo->datoj['de'], $noktoj - 1) >= $partopreno->datoj['de'] and sekvandaton($renkontigxo->datoj['de'], $noktoj) <= $partopreno->datoj['gxis'] and $manko[$noktoj] != "1") {
                    // ebligu mendi tiun liton por tiu nokto
                    echo "<td class='elektebla'>";
                    entajpbokso("", "nokto[{$noktoj}]", "falseoderso", "", "{$litoj}", "", "", "ne");
                    echo "</td>";
                    $estis_elektebleco = true;
                } else {
                    echo "<td class='malplena'>--</td>";
                }
            }
            // else
        }
        // for (noktoj)
        if ($partoprenanto and $grandeco == "granda") {
            // mendi cxiujn noktojn?
            echo "<td>&nbsp;&nbsp;</td><td class='elektebla'>";
            if ($uzata == false and $partoprentagoj == $renkontigxdauxro and $manko['sumo'] == 0) {
                entajpbokso("", "tute", "falseoderso", "", "{$litoj}", "", "", "ne");
            }
            echo "</td>";
        }
        echo "</tr>";
    }
    // for (litoj)
    echo "</table>";
    if ($partoprenanto->datoj['ID'] and $grandeco == "granda") {
        if ($estis_elektebleco) {
            // butono por rezervi
            butono('rezervu', "Rezervu elektitajn litojn");
            // butono por disdoni - TODO: aux cxu nur surloke?
            butono('disdonu', "Disdonu elektitajn litojn");
        }
        //     echo "<select name='tipo' size='1'>\n";
        //     echo "<option selected>rezervi\n";
        //     echo "<option>disdoni\n";
        //     echo "</select><BR>\n";
        //     send_butono("Faru!");
    }
    echo "</form>";
    if ($grandeco != "granda") {
        eoecho($row[rimarkoj]);
    }
}