echo "<form method='POST'>"; echo "<table>"; echo "<input type='hidden' name='tee' value='kaikki' />"; $checked = empty($summaa_varastopaikalle) ? '' : 'checked = "checked"'; echo "<tr>"; echo "<th>" . t('Summaa per varasto') . "/" . t('keräysvyöhyke') . "</th>"; echo "<td><input type='checkbox' name='summaa_varastopaikalle' {$checked} /></td>"; echo "</tr>"; $checked = empty($kerayksettomat_tuotepaikat) ? '' : 'checked = "checked"'; echo "<tr>"; echo "<th>" . t("Näytä myös ne tuotepaikat joilta ei ole keräyksiä") . "</th>"; echo "<td><input type='checkbox' name='kerayksettomat_tuotepaikat' {$checked}/> (" . t("Lasketaan keräykset vain aktiivisilta tuotepaikoilta") . ")</td>"; echo "</tr>"; echo "<tr><th>" . t("Syötä alkupäivämäärä (pp-kk-vvvv)") . "</th>\n <td><input type='text' name='ppa' value='{$ppa}' size='3'>\n <input type='text' name='kka' value='{$kka}' size='3' />\n <input type='text' name='vva' value='{$vva}' size='5' /></td>\n </tr><tr><th>" . t("Syötä loppupäivämäärä (pp-kk-vvvv)") . "</th>\n <td><input type='text' name='ppl' value='{$ppl}' size='3' />\n <input type='text' name='kkl' value='{$kkl}' size='3' />\n <input type='text' name='vvl' value='{$vvl}' size='5' /></td>"; echo "<tr><th>" . t("Anna alkuvarastopaikka") . ":</th>\n <td>", hyllyalue("ahyllyalue", $ahyllyalue), "\n <input class='ahylly' type='text' size='6' name='ahyllynro' value='{$ahyllynro}' />\n <input class='ahylly' type='text' size='6' name='ahyllyvali' value='{$ahyllyvali}' />\n <input class='ahylly' type='text' size='6' name='ahyllytaso' value='{$ahyllytaso}' />\n </td></tr>"; echo "<tr><th>" . t("ja loppuvarastopaikka") . ":</th>\n <td>", hyllyalue("lhyllyalue", $lhyllyalue), "\n <input class='lhylly' type='text' size='6' name='lhyllynro' value='{$lhyllynro}' />\n <input class='lhylly' type='text' size='6' name='lhyllyvali' value='{$lhyllyvali}' />\n <input class='lhylly' type='text' size='6' name='lhyllytaso' value='{$lhyllytaso}' />\n </td></tr>"; echo "<tr><th>" . t("Listaa vain näin monta kerätyintä tuotetta") . ":</th>\n <td><input type='text' size='6' name='toppi' value='{$toppi}' /></td>"; echo "<tr>"; echo "<th>" . t("Varastot") . "</th>"; echo "<td>"; foreach ($kaikki_varastot as $varasto_index => $varasto) { echo "<input class='varastot' type='checkbox' name='varastot[]' value='{$varasto_index}' {$varasto['checked']} />"; echo " {$varasto['nimitys']}"; echo "<br/>"; } echo "</td>"; echo "</tr>"; if ($yhtiorow['kerayserat'] == "K" and !empty($kaikki_keraysvyohykkeet)) { echo "<tr>"; echo "<th>" . t("Keräysvyöhykkeet") . "</th>"; echo "<td>";
if ($saldorow["saldo"] != 0 and $saldorow["oletus"] != "") { echo "<td></td>"; } elseif ($saldorow["saldo"] != 0 or $hyllyssa != 0 or $myytavissa != 0) { echo "<td><input type = 'checkbox' name='flagaa_poistettavaksi[{$saldorow['tunnus']}]' value='{$saldorow['tunnus']}' {$chk}> {$poistoteksti}\n <input type = 'hidden' name='flagaa_poistettavaksi_undo[{$saldorow['tunnus']}]' value='{$saldorow['poistettava']}'></td>"; } else { if ($saldorow["poistettava"] != "") { $poistoteksti .= "<br>(" . t("Voit myös poistaa tuotepaikan tästä heti") . ")"; } echo "<td><input type = 'checkbox' name='poista[{$saldorow['tunnus']}]' value='{$saldorow['tunnus']}'> {$poistoteksti}</td>"; } echo "</tr>"; } } echo "<tr><td colspan='10'><input type = 'submit' value = '" . t("Päivitä") . "'></td></table></form><br>"; $ahyllyalue = ''; $ahyllynro = ''; $ahyllyvali = ''; $ahyllytaso = ''; echo "<table><form name = 'valinta' method='post'>\n <input type='hidden' name='tee' value='UUSIPAIKKA'>\n <input type = 'hidden' name = 'toim' value = '{$toim}' />\n <input type='hidden' name='tuoteno' value='{$tuoteno}'>\n <tr><th>" . t("Lisää uusi varastopaikka") . "</th></tr>\n <tr><td>\n " . t("Alue") . " ", hyllyalue('ahyllyalue', $ahyllyalue), "\n " . t("Nro") . " <input type = 'text' name = 'ahyllynro' size = '5' maxlength='5' value = '{$ahyllynro}'>\n " . t("Väli") . " <input type = 'text' name = 'ahyllyvali' size = '5' maxlength='5' value = '{$ahyllyvali}'>\n " . t("Taso") . " <input type = 'text' name = 'ahyllytaso' size = '5' maxlength='5' value = '{$ahyllytaso}'>"; echo " </td></tr>\n <tr><td><input type = 'submit' value = '" . t("Lisää") . "'></td></tr>\n </table></form>"; echo "<br><hr><form name = 'valinta' method='post'>\n <input type='hidden' name='tee' value=''>\n <input type = 'hidden' name = 'toim' value = '{$toim}' />\n <input type = 'submit' value = '" . t("Palaa tuotteen valintaan") . "'>"; } if ($tee == '') { // Tällä ollaan, jos olemme vasta valitsemassa tuotetta echo "<form name = 'valinta' method='post'>\n <input type='hidden' name='tee' value='M'>\n <input type = 'hidden' name = 'toim' value = '{$toim}' />\n <table>\n <tr><th>" . t("Anna tuotenumero") . "</th><td>" . livesearch_kentta("valinta", "TUOTEHAKU", "tuoteno", 210) . "</td></tr>\n </table><br>\n <input type = 'submit' value = '" . t("Hae") . "'>\n </form>"; $kentta = 'tuoteno'; $formi = 'valinta'; } if ($kutsuja == '') { require "inc/footer.inc"; }
echo $tp['hyllyalue'], ' ', $tp['hyllynro'], ' ', $tp['hyllyvali'], ' ', $tp['hyllytaso']; echo "</option>"; } echo "</optgroup>"; } if ($counts['s3'] > 0) { echo "<optgroup label=", t("Paikattomat-lapsivarastot"), ">"; foreach ($s3_options as $va) { echo "<option value='V", $va['tunnus'], "'>"; echo $va['nimitys']; echo "</option>"; } echo "</optgroup>"; } echo "</select><br />"; echo hyllyalue("reklahyllyalue[{$row['tunnus']}]", $reklahyllyalue[$row["tunnus"]]), "\n <input type='text' size='5' name='reklahyllynro[{$row['tunnus']}]' value = '{$reklahyllynro[$row["tunnus"]]}'>\n <input type='text' size='5' name='reklahyllyvali[{$row['tunnus']}]' value = '{$reklahyllyvali[$row["tunnus"]]}'>\n <input type='text' size='5' name='reklahyllytaso[{$row['tunnus']}]' value = '{$reklahyllytaso[$row["tunnus"]]}'>"; } else { echo "{$row['varastopaikka']}"; } echo "<input type='hidden' name='vertaus_hylly[{$row['tunnus']}]' value='{$row['varastopaikka_rekla']}'>"; echo "</td>"; echo "<td>{$row['tuoteno']} <input type='hidden' name='rivin_tuoteno[{$row['tunnus']}]' value='{$row['tuoteno']}'> <input type='hidden' name='rivin_puhdas_tuoteno[{$row['tunnus']}]' value='{$row['puhdas_tuoteno']}'></td>"; echo "<td id='{$row['tunnus']}_varattu'>{$row['varattu']} <input type='hidden' name='rivin_varattu[{$row['tunnus']}]' value='{$row['varattu']}'> </td>"; echo "<td>"; // kaikki gruupatut tunnukset mukaan! if (($toim == "VALMISTUS" and $yhtiorow["valmistus_kerayslistan_jarjestys"] == "S" or $yhtiorow["kerayslistan_jarjestys"] == "S") and strpos($row["rivitunnukset"], ",") !== FALSE) { foreach (explode(",", $row["rivitunnukset"]) as $tunn) { $tunn = trim($tunn); echo "<input type='hidden' name='kerivi[]' value='{$tunn}'>"; } } else {
echo "<input type='checkbox' name='tunnukset[{$i}]' value='{$rivi['tunnus']}'>"; echo "<input type='hidden' name='tuotenumerot[{$i}]' value='{$rivi['tuoteno']}'>"; echo "<input type='hidden' name='saldot[{$i}]' value='{$rivi['saldo']}'>"; } echo "</td>"; echo "</tr>"; $i++; } echo "<input type='hidden' name='org_varasto' value='{$org_varasto}'>"; echo "<tr>"; echo "<th colspan='6'>" . t("Ruksaa kaikki") . "</th>"; echo "<td align='center'><input type='checkbox' name='tun' onclick='toggleAll(this)'></td>"; echo "</tr>"; echo "</table><br>"; // Tähän kohde varasto echo "<table>\n <tr><th>" . t("Minne varastopaikalle siirretään") . "</th></tr>\n <tr><td>\n " . t("Alue") . " ", hyllyalue("ahyllyalue", $thyllyalue), "\n " . t("Nro") . " <input type = 'text' name = 'ahyllynro' size = '5' maxlength='5' value = '{$thyllynro}'>\n " . t("Väli") . " <input type = 'text' name = 'ahyllyvali' size = '5' maxlength='5' value = '{$thyllyvali}'>\n " . t("Taso") . " <input type = 'text' name = 'ahyllytaso' size = '5' maxlength='5' value = '{$thyllytaso}'>\n </td>"; echo "<td colspan='3' class='back'></td>"; echo "<td class='back' >"; echo "<input type='submit' value='" . t("Siirrä") . "'>"; echo "</td></tr>"; echo "</table>"; echo "</form>"; } if ($tee == "W") { echo "<font class='message'>" . "Siirrettiin" . " " . count($tunnukset) . " " . t("tuotetta paikalle") . " {$thyllyalue}-{$thyllynro}-{$thyllyvali}-{$thyllytaso}</font><br>"; foreach ($tunnukset as $key => $arvo) { // Mistä varastosta viedään $mista = $arvo; $tuoteno = $tuotenumerot[$key]; $asaldo = $saldot[$key]; // Minne varastoon tarkistus
$query = "SELECT tuotepaikat.hyllyalue, tuotepaikat.hyllynro, tuotepaikat.hyllyvali, tuotepaikat.hyllytaso,\n concat_ws('-',tuotepaikat.hyllyalue, tuotepaikat.hyllynro, tuotepaikat.hyllyvali, tuotepaikat.hyllytaso) hyllypaikka,\n tuote.tuoteno, tuote.nimitys, varastopaikat.tunnus, tuotepaikat.oletus, tuotepaikat.halytysraja, tuotepaikat.tilausmaara, tuotepaikat.tunnus,\n concat(rpad(upper(tuotepaikat.hyllyalue) ,5,' '),lpad(tuotepaikat.hyllynro ,5,' ')) ihmepaikka\n FROM tuotepaikat, varastopaikat, tuote\n WHERE tuotepaikat.yhtio = varastopaikat.yhtio and tuotepaikat.yhtio = tuote.yhtio\n and concat(rpad(upper(tuotepaikat.hyllyalue) ,5,'0'),lpad(upper(tuotepaikat.hyllynro) ,5,'0')) >= concat(rpad(upper(alkuhyllyalue) ,5,'0'),lpad(upper(alkuhyllynro) ,5,'0'))\n and concat(rpad(upper(tuotepaikat.hyllyalue) ,5,'0'),lpad(upper(tuotepaikat.hyllynro) ,5,'0')) <= concat(rpad(upper(loppuhyllyalue) ,5,'0'),lpad(upper(loppuhyllynro) ,5,'0'))\n and tuotepaikat.tuoteno = tuote.tuoteno\n and tuotepaikat.yhtio = '{$kukarow['yhtio']}'\n and tuotepaikat.tuoteno = '{$tuoteno[$id]}'\n and varastopaikat.tunnus = '{$tuvarasto}'\n order by 1"; $result2 = pupe_query($query); if (mysql_num_rows($result2) == 0) { $korj++; if ($korj == 1) { echo "<tr><th>" . t("Tuoteno") . "</th><th>" . t("Nimitys") . "</th><th>" . t("Hälytysraja") . "</th><th>" . t("Tilausmäärä") . "</th><th>" . t("Huomautus") . "</th><th>" . t("Paikka") . "</th></tr>"; } echo "<tr><td>{$id} {$tuoteno[$id]}</td>"; $query = "SELECT tuoteno, nimitys\n FROM tuote\n WHERE yhtio = '{$kukarow['yhtio']}'\n and tuoteno = '{$tuoteno[$id]}'"; $nimresult = pupe_query($query); if (mysql_num_rows($nimresult) == 1) { $nimrow = mysql_fetch_assoc($nimresult); if ($error == '') { $error = t("Paikkaa ei löytynyt tästä varastosta, anna uusi paikka"); } echo " <td>" . t_tuotteen_avainsanat($nimrow, 'nimitys') . "</td>\n <td align='right'>{$halytysraja[$id]}</td>\n <td align='right'>{$tilattava[$id]}</td>\n <td>{$error}</td>\n <td nowrap>\n <input type='hidden' name='tuoteno[{$id}]' value='{$tuoteno[$id]}'>\n <input type='hidden' name='halytysraja[{$id}]' value='{$halytysraja[$id]}'>\n <input type='hidden' name='tilattava[{$id}]' value='{$tilattava[$id]}'>\n <input type='hidden' name='rivipaikka[{$id}]' value=''>\n <input type='hidden' name='uusipaikka[{$id}]' value='uusi'>\n ", hyllyalue("hyllyalue[{$id}]", $hyllyalue[$id]), "\n <input type='text' id='hyllynro[{$id}]' name='hyllynro[{$id}]' value='{$hyllynro[$id]}' maxlength='2' size='2'>\n <input type='text' id='hyllyvali[{$id}]' name='hyllyvali[{$id}]' value='{$hyllyvali[$id]}' maxlength='2' size='2'>\n <input type='text' id='hyllytaso[{$id}]' name='hyllytaso[{$id}]' value='{$hyllytaso[$id]}' maxlength='2' size='2'></td>"; $paikkasyot++; } else { echo "<td></td><td></td><td></td><td>" . t("TUOTENUMERO EI LÖYDY") . "!!!</td><td></td>"; } echo "</tr>"; } elseif (mysql_num_rows($result2) > 1) { if ($rivipaikka[$id] == '') { $korj++; if ($korj == 1) { echo "<tr><th>" . t("Tuoteno") . "</th><th>" . t("Nimitys") . "</th><th>" . t("Hälytysraja") . "</th><th>" . t("Tilausmäärä") . "</th><th>" . t("Huomautus") . "</th><th>" . t("Paikka") . "</th></tr>"; } echo "<tr><td>{$id} {$tuoteno[$id]}</td>"; $query = "SELECT tuoteno, nimitys\n FROM tuote\n WHERE yhtio = '{$kukarow['yhtio']}'\n and tuoteno = '{$tuoteno[$id]}'\n LIMIT 1"; $nimresult = pupe_query($query); if (mysql_num_rows($nimresult) == 1) {
unlink($filenimi . ".ps"); $tee = ""; } } } if (!isset($tee) or $tee == "") { echo "<table>"; echo "<form method='post'>"; echo "<input type='hidden' name='tee' value='TULOSTA'>"; echo "<tr><th>" . t("Alkuhylly") . " (" . t("alue-nro-väli-taso") . "):</th>"; echo "<td align='right'>", hyllyalue("ahyllyalue", $ahyllyalue), "</td>"; echo "<td><input type='text' name='ahyllynro' value='{$ahyllynro}' size='4'></td>"; echo "<td><input type='text' name='ahyllyvali' value='{$ahyllyvali}' size='4'></td>"; echo "<td><input type='text' name='ahyllytaso' value='{$ahyllytaso}' size='4'></td></tr>"; echo "<tr><th>" . t("Loppuhylly") . " (" . t("alue-nro-väli-taso") . "):</th>"; echo "<td align='right'>", hyllyalue("lhyllyalue", $lhyllyalue), "</td>"; echo "<td><input type='text' name='lhyllynro' value='{$lhyllynro}' size='4'></td>"; echo "<td><input type='text' name='lhyllyvali' value='{$lhyllyvali}' size='4'></td>"; echo "<td><input type='text' name='lhyllytaso' value='{$lhyllytaso}' size='4'></td></tr>"; $sel = $jarjestys == "hylly" ? "hylly" : "tuoteno"; echo "<tr><th>" . t("Valitse listausjärjestys") . "</th><td align='right' colspan='4'><select name='jarjestys'>"; echo "<option value='tuoteno' "; if ($sel == "tuoteno") { echo "selected"; } echo ">" . t("Tuotenumero") . "</option>"; echo "<option value='hylly' "; if ($sel == "hylly") { echo "selected"; } echo ">" . t("Paikka") . "</option>";
echo "<tr><th>" . t("Listaa vain myydyimmät:") . "</th>"; echo "<td><input type='text' size='6' name='top'> " . t("tuotetta"); echo "</td></tr>"; echo "<tr><th>" . t("Näytä eniten varastonarvoon vaikuttavaa") . "</th>"; echo "<td><input type='text' size='6' name='varastoonvaikutus'> " . t("tuotetta"); echo "</td></tr>"; echo "<tr><th>" . t("Näytä vain tuotteet joiden varaston arvo on yli") . "</th>"; echo "<td><input type='text' size='9' name='varastonarvo'> " . $yhtiorow["valkoodi"] . "</td>"; echo "</tr>"; echo "<tr><td class='back'>", t("ja/tai"), "...</td></tr>"; echo "<tr><th>" . t("Anna alkuvarastopaikka:") . "</th>"; echo "<td>", hyllyalue("ahyllyalue", ''); echo " <input type='text' size='6' maxlength='5' name='ahyllynro'>\n <input type='text' size='6' maxlength='5' name='ahyllyvali'>\n <input type='text' size='6' maxlength='5' name='ahyllytaso'>"; echo "</td></tr>"; echo "<tr><th>" . t("ja loppuvarastopaikka:") . "</th>"; echo "<td>", hyllyalue("lhyllyalue", ''); echo " <input type='text' size='6' maxlength='5' name='lhyllynro'>\n <input type='text' size='6' maxlength='5' name='lhyllyvali'>\n <input type='text' size='6' maxlength='5' name='lhyllytaso'>"; echo "</td></tr>"; $query = "SELECT *\n FROM varastopaikat\n WHERE yhtio = '{$kukarow['yhtio']}'\n AND tyyppi != 'P'\n ORDER BY nimitys"; $kresult = pupe_query($query); echo "<tr><th>", t("Varastot"), "</th>"; echo "<td><select name='varasto'>"; echo "<option value=''>", t("Valitse"), "</option>"; while ($krow = mysql_fetch_assoc($kresult)) { $sel = (!empty($oletusvarasto_chk) and $oletusvarasto_chk == $krow['tunnus']) ? "selected" : ""; echo "<option value='{$krow['tunnus']}' {$sel}>{$krow['nimitys']}</option>"; } echo "</select></td></tr>"; if ($yhtiorow['kerayserat'] != '') { // Haetaan keraysvyohykkeet $query = "SELECT tunnus, nimitys\n FROM keraysvyohyke\n WHERE yhtio = '{$kukarow['yhtio']}'\n AND nimitys != ''";
echo "<form method='post' autocomplete='off'>"; echo "<input type='hidden' name='tee' value='H'>"; echo "<input type='hidden' name='toim' value='{$toim}'>"; echo "<br>"; echo "<table>"; echo "<tr><th colspan='2'><center>" . t("Tulostetaan tuotetarrat hyllyjen väliltä") . "</center></th><tr>"; echo "<tr><th>" . t("Alkuosoite") . "</th>"; echo "<td>", hyllyalue("ahyllyalue", $ahyllyalue); echo "-"; echo "<input type='text' name='ahyllynro' size='5' maxlength='5' value='{$ahyllynro}'>"; echo "-"; echo "<input type='text' name='ahyllyvali' size='5' maxlength='5' value='{$ahyllyvali}'>"; echo "-"; echo "<input type='text' name='ahyllytaso' size='5' maxlength='5' value='{$ahyllytaso}'>\n </td>\n </tr>"; echo "<tr><th>" . t("Loppuosoite") . "</th>"; echo "<td>", hyllyalue("lhyllyalue", $lhyllyalue); echo "-"; echo "<input type='text' name='lhyllynro' size='5' maxlength='5' value='{$lhyllynro}'>"; echo "-"; echo "<input type='text' name='lhyllyvali' size='5' maxlength='5' value='{$lhyllyvali}'>"; echo "-"; echo "<input type='text' name='lhyllytaso' size='5' maxlength='5' value='{$lhyllytaso}'>\n </td>\n </tr>"; echo "<tr><th>" . t("Vain tuotteet joilla on saldoa hyllyillä") . "</th><td><input type='checkbox' name='saldo' value='1' {$sel}> </td>"; echo "<tr><th>" . t("KPL") . "</th><td><input type='text' name='tulostakappale' size='3' value='{$tulostakappale}'>\n </td>\n <tr>"; echo "<tr><th>" . t("Kirjoitin") . "</th><td><select name='kirjoitin'>"; echo "<option value=''>" . t("Ei kirjoitinta") . "</option>"; mysql_data_seek($kires, 0); while ($kirow = mysql_fetch_array($kires)) { if ($kirow['tunnus'] == $kirjoitin) { $select = 'SELECTED'; } else {
pupe_query($query); } } // haetaan keräysvyöhykkeen takaa keräysjärjestys $query = "SELECT keraysjarjestys\n FROM keraysvyohyke\n WHERE yhtio = '{$kukarow['yhtio']}'\n AND tunnus = '{$kerattavat_rivit_row['keraysvyohyke']}'"; $keraysjarjestys_res = pupe_query($query); $keraysjarjestys_row = mysql_fetch_assoc($keraysjarjestys_res); $orderby_select = $keraysjarjestys_row['keraysjarjestys'] == "V" ? "," . generoi_sorttauskentta("3") : ""; $orderby = $keraysjarjestys_row['keraysjarjestys'] == 'P' ? "kokonaismassa" : ($keraysjarjestys_row['keraysjarjestys'] == "V" ? "sorttauskentta" : "vh.indeksi"); $query = "SELECT keraysvyohyke.nimitys AS ker_nimitys,\n tilausrivi.hyllyalue, tilausrivi.hyllynro, tilausrivi.hyllyvali, tilausrivi.hyllytaso,\n IFNULL(vh.varmistuskoodi, '00') AS varmistuskoodi,\n tilausrivi.tuoteno, ROUND(kerayserat.kpl, 0) AS varattu, tilausrivi.yksikko, tuote.nimitys,\n kerayserat.pakkausnro, kerayserat.sscc, kerayserat.tunnus AS kerayseran_tunnus,\n (tuote.tuotemassa * ROUND(kerayserat.kpl, 0)) AS kokonaismassa,\n kerayserat.nro, tuote.kerayskommentti\n {$orderby_select}\n FROM tilausrivi\n JOIN kerayserat ON (kerayserat.yhtio = tilausrivi.yhtio AND kerayserat.tilausrivi = tilausrivi.tunnus AND kerayserat.nro = {$kerattavat_rivit_row['nro']})\n JOIN tuote ON (tuote.yhtio = tilausrivi.yhtio AND tuote.tuoteno = tilausrivi.tuoteno)\n JOIN varaston_hyllypaikat vh ON (vh.yhtio = tilausrivi.yhtio AND vh.hyllyalue = tilausrivi.hyllyalue AND vh.hyllynro = tilausrivi.hyllynro AND vh.hyllyvali = tilausrivi.hyllyvali AND vh.hyllytaso = tilausrivi.hyllytaso)\n JOIN keraysvyohyke ON (keraysvyohyke.yhtio = vh.yhtio AND keraysvyohyke.tunnus = vh.keraysvyohyke)\n WHERE tilausrivi.yhtio = '{$kukarow['yhtio']}'\n AND tilausrivi.tunnus IN ({$kerattavat_rivit_row['tilausrivit']})\n ORDER BY {$orderby}"; $rivi_result = pupe_query($query); while ($rivi_row = mysql_fetch_assoc($rivi_result)) { $rivi_row['kerayskommentti'] = str_replace(array("'", ","), "", $rivi_row['kerayskommentti']); $pakkauskirjain = strtoupper(chr(64 + $rivi_row['pakkausnro'])); $tuotteen_nimitys = str_replace(array("'", ","), "", $rivi_row['nimitys']); $hyllypaikka = hyllyalue('', $rivi_row["hyllyalue"], 'riisuttu'); $hyllypaikka = trim($rivi_row['hyllynro']) != '' ? $hyllypaikka . " " . $rivi_row['hyllynro'] : $hyllypaikka; $hyllypaikka = trim($rivi_row['hyllyvali']) != '' ? $hyllypaikka . " " . $rivi_row['hyllyvali'] : $hyllypaikka; $hyllypaikka = trim($rivi_row['hyllytaso']) != '' ? $hyllypaikka . " " . $rivi_row['hyllytaso'] : $hyllypaikka; $hyllypaikka = implode(" ", str_split(strtoupper(trim($hyllypaikka)))); // W7 12 80 => W71280 => w71280 => w 7 128 0 $rivi_row['tuoteno'] = strtoupper(str_replace(" ", "", $rivi_row['tuoteno'])); $_tmp = str_split($rivi_row['tuoteno']); $_cnt = count($_tmp); $_arr = array(); for ($i = 0; $i < $_cnt; $i++) { if ($i < $_cnt - 1 and !is_numeric($_tmp[$i])) { array_push($_arr, $_tmp[$i], " "); } elseif ($i < $_cnt - 1 and is_numeric($_tmp[$i]) and isset($_tmp[$i + 1]) and !is_numeric($_tmp[$i + 1])) { array_push($_arr, $_tmp[$i], " "); } else {
} if ($laskuri > 0) { echo "<br>{$laskuri} ", t("riviä") . ".<br>"; echo "<br><input type='submit' value='" . t("Päivitä tapahtumille oletuspaikka") . "'>"; } else { echo t("Kaikki tapahtumien tuotepaikat löytyvät") . "!<br><br>"; $tee = ""; } echo "</form>"; } if ($tee == "" and !$_cli) { //Käyttöliittymä echo "<table><form name='piiri' method='post'>"; echo "<input type='hidden' name='tee' value='LISTAA'>"; echo "<tr><th>" . t("Alkuvarastopaikka:") . "</th>\n <td>", hyllyalue("ahyllyalue", ''), "\n <input type='text' size='6' name='ahyllynro'>\n <input type='text' size='6' name='ahyllyvali'>\n <input type='text' size='6' name='ahyllytaso'>\n </td></tr>"; echo "<tr><th>" . t("Loppuvarastopaikka:") . "</th>\n <td>", hyllyalue("lhyllyalue", ''), "\n <input type='text' size='6' name='lhyllynro'>\n <input type='text' size='6' name='lhyllyvali'>\n <input type='text' size='6' name='lhyllytaso'>\n </td></tr>"; echo "<tr>"; echo "<th>" . t("Näytä vain paikat joiden saldo on muuttunut ennen päivämäärää (pp-kk-vvvv)") . "</th>"; echo "<td>\n <input type='text' name='ppa' value='{$ppa}' size='3'>-\n <input type='text' name='kka' value='{$kka}' size='3'>-\n <input type='text' name='vva' value='{$vva}' size='6'>\n </td>"; echo "</tr>"; echo "<tr><th>" . t("Valitse varasto") . ":</th>"; echo "<td><select name='varasto'>\n <option value=''>" . t("Näytä kaikki") . "</option>\n <option value='EI'>" . t("Näytä paikat jotka ei kuulu mihinkään varastoon") . "</option>"; $query = "SELECT *\n FROM varastopaikat\n WHERE yhtio = '{$kukarow['yhtio']}' AND tyyppi != 'P'\n ORDER BY tyyppi, nimitys"; $vares = pupe_query($query); while ($varow = mysql_fetch_array($vares)) { $sel = ''; if ($varow['tunnus'] == $varasto) { $sel = 'selected'; } echo "<option value='{$varow['tunnus']}' {$sel}>{$varow['nimitys']}</option>"; }
echo "<br><font class='error'>" . t("Materiaalissasi oli virheitä! Korjaa ensin kaikki virheet, vasta sitten saldojen siirto onnistuu") . "!</font><br>"; $tee = ""; } echo "<br>" . t("Tiedostossa oli") . " {$lask} " . t("riviä") . "!<br>"; } else { echo "<font class='error'>" . t("Luettavaa tiedostoa ei löytynyt") . "!</font><br>"; $tee = ""; } } if ($tee == '') { // Tällä ollaan, jos olemme syöttämässä tiedostoa ja muuta echo "<font class='message'>" . t("Tiedostomuoto") . ":</font><br>\n\n <table>\n <tr><th colspan='2'>" . t("Tabulaattorilla eroteltu tekstitiedosto") . ".</th></tr>\n <tr><td>" . t("Tuoteno") . "</td><td>" . t("Määrä") . "</td></tr>\n </table>\n <br>"; echo "<form name = 'valinta' enctype='multipart/form-data' method='post'>\n <input type='hidden' name='tee' value='M'>\n <table>"; echo "<tr><td class='back'></td><th>" . t("Hyllyalue") . "</th><th>" . t("Hyllynro") . "</th><th>" . t("Hyllyväli") . "</th><th>" . t("Hyllytaso") . "</th>"; echo "<tr><td>" . t("Tuotteet joilla ei ole paikkaa kohdevarastossa laitetaan tälle paikalle") . ":</td>"; echo "<td>", hyllyalue("hyllyalue", $hyllyalue), "</td>"; echo "<td><input type='text' size='5' name='hyllynro' value='{$hyllynro}'></td>"; echo "<td><input type='text' size='5' name='hyllyvali' value='{$hyllyvali}'></td>"; echo "<td><input type='text' size='5' name='hyllytaso' value='{$hyllytaso}'></td></tr>"; echo "<tr><td>" . t("Lähdevarasto") . ":</td>"; echo "<td colspan='4'><select name='lahdevarasto'><option value=''>" . t("Valitse") . "</option>"; $query = "SELECT tunnus, nimitys\n FROM varastopaikat\n WHERE yhtio='{$kukarow['yhtio']}'\n ORDER BY tyyppi, nimitys"; $vares = pupe_query($query); while ($varow = mysql_fetch_array($vares)) { $sel = ''; if ($varow['tunnus'] == $lahdevarasto) { $sel = 'selected'; } echo "<option value='{$varow['tunnus']}' {$sel}>{$varow['nimitys']}</option>"; } echo "</select></td></tr>";
$select = ''; } echo "<option value='{$pohja}' {$select}>{$pohja}</option>"; } echo "</select></td>"; echo "<td class='back'><input type='submit' value='" . t("Tulosta") . "'></td>"; echo "</tr></table></form><br><br><br>"; // Annetaan mahollisuus tulostaa yksittäinen tarra echo "Yksittäinen osoite"; echo "<table><tr>"; echo "<th>" . t("Hyllyosoite") . "</th><th>" . t("Kirjoitin") . "</th><th>" . t("Malli") . "</th>"; echo "<tr><form method='post' name='kala' autocomplete='off'>"; echo "<input type='hidden' name='tee' value='Z'>"; echo "<input type='hidden' name='lisa' value='yks'>"; echo "<input type='hidden' name='toim' value='{$toim}'>"; echo "<td>", hyllyalue("yhyllyalue", $yhyllyalue); echo "-"; echo "<input type='text' name='yhyllynro' size='5' maxlength='5' value='{$yhyllynro}'>"; echo "-"; echo "<input type='text' name='yhyllyvali' size='5' maxlength='5' value='{$yhyllyvali}'>"; echo "-"; echo "<input type='text' name='yhyllytaso' size='5' maxlength='5' value='{$yhyllytaso}'></td>"; echo "<td><select name='kirjoitin'>"; echo "<option value=''>" . t("Ei kirjoitinta") . "</option>"; while ($kirow = mysql_fetch_array($kires)) { if ($kirow['tunnus'] == $kirjoitin) { $select = 'SELECTED'; } else { $select = ''; } echo "<option value='{$kirow['tunnus']}' {$select}>{$kirow['kirjoitin']}</option>";