Esempio n. 1
0
    $ylaotsikko = "Aihealueet";
    $aihealueet = hae_aihealueet();
    $toimittajat = "";
} else {
    $otsikko = "Tiedostokirjasto";
    $ylaotsikko = "Toimittajat";
    $toimittajat = hae_toimittajat_selectiin();
    $aihealueet = "";
}
echo "<font class='head'>" . t($otsikko) . "</font>";
echo "<hr>";
$params = array("aihealue" => $aihealue, "tiedoston_tyyppi" => $tiedostotyyppi, "valittu_toimittaja" => $toimittaja, "ylaotsikko" => $ylaotsikko, "toimittajat" => $toimittajat, "aihealueet" => $aihealueet, "valittu_aihealue" => $aihealue, "valittu_tiedostotyyppi" => $tiedostotyyppi);
if ($tee == 'hae_tiedostot' and !empty($tiedostotyyppi)) {
    $tiedostot = hae_tiedostot($params);
    piirra_formi($params);
    piirra_tiedostolista($tiedostot);
} else {
    $tee = "";
}
if ($tee == "") {
    if ($toim == "LAATU" and empty($aihealueet)) {
        echo "<font class='error'>" . t("Aihealueita ei ole vielä lisätty") . "</font>";
    } elseif ($toim == "" and empty($toimittajat)) {
        echo "<font class='error'>" . t("Toimittajia ei ole vielä lisätty") . "</font>";
    } else {
        piirra_formi($params);
    }
}
function piirra_formi($params)
{
    global $toim;
Esempio n. 2
0
    $tee = "";
} elseif (!empty($tiedostotyyppi) and empty($selite) and $tallenna_nappi) {
    echo "<font class='error'>" . t("Sinun täytyy valita tiedostolle selite") . "</font>";
    $tee = "";
}
if ($tee == "tallenna_tiedosto" and !empty($aihealue)) {
    $tee = "";
}
if ($tee == "") {
    $aihealueet = hae_aihealueet();
    $params = array("tiedoston_tyyppi" => $tiedostotyyppi, "aihealue" => $aihealue);
    $tiedostot = hae_tiedostot($params);
    if (!empty($aihealueet)) {
        piirra_formi($aihealue, $tiedostotyyppi, $aihealueet);
        if ($tiedostot) {
            piirra_tiedostolista($tiedostot, $aihealue, $tiedostotyyppi);
        }
    } else {
        echo "<font class='error'>" . t("Et ole vielä lisännyt aihealueita avainsanoihin") . "</font>";
    }
}
function piirra_formi($valittu_aihealue, $valittu_tiedostotyyppi, $aihealueet)
{
    $tiedostotyypit = tiedostotyypit($valittu_aihealue);
    echo "<form method='post' enctype='multipart/form-data'>";
    echo "<input type='hidden' name='tee' value='tallenna_tiedosto'>";
    echo "<table>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td><label for='aihealue'>" . t("Aihealue") . "</label></td>";
    echo "<td>";