<?php
if(!isset($_POST['lieferscheinnr']) AND !isset($_POST['post1'])){
?>
<form id="form1" name="form1" method="post" action="">
Geben Sie die Lieferscheinnummer ein:
<label for="lieferscheinnr"></label>
<input type="text" name="lieferscheinnr" id="lieferscheinnr" />
<input type="submit" name="weiter" id="weiter" value="Weiter" />
</form>
<?
}
else {
?>
Aktueller Lieferschein: <?php echo $_POST['lieferscheinnr'];
?>
<br/><br/>
<?php
if(isset($_POST['weiter2'])){
$sql2="SELECT * FROM suchmaschine WHERE lieferscheinnr = '".$_POST['lieferscheinnr']."'";
$result2 = mysql_query($sql2) OR die(mysql_error());// gucken ob was im Query drinsteckt
if(mysql_num_rows($result2)) { ?>
<table width="900px" border="1">
<tr>
<td width="11%">Lieferant:</td>
<td width="35%"> </td>
<td width="6%"> </td>
<td colspan="3">Datum:</td>
<td width="34%" colspan="2"> </td>
</tr>
<tr>
<td colspan="8"> </td>
</tr>
<tr>
<td>LieferscheinNr:</td>
<td> </td>
<td> </td>
<td colspan="3">Rechnungsnr.</td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="8"> </td>
</tr>
</table>
<table width="900" border="1">
<tr>
<td width="91" id="paket" align="center">PaketNr.</td>
<td width="82" id="holzart" align="center">Holzart</td>
<td width="92" id="partie" align="center">Partie</td>
<td width="92" id="menge" align="center">Menge</td>
<td width="104" id="lvon" align="center">Länge von</td>
<td width="97" id="lbis" align="center">Länge bis</td>
<td width="87" id="hauptl" align="center">Hauptlänge</td>
<td width="76" id="preis" align="center">Preis</td>
<td width="51" id="hf" align="center">HF</td>
<td width="64" id="stk" align="center">STK</td>
</tr>
</table><?
while($row = mysql_fetch_object($result2))
{
echo ('<tr>');
echo ('<td class="paketnr">'.(utf8_decode($row->paketnr)).'</td>');
echo ('<td class="holzart">'.(utf8_decode($row->Holzart)).'</td>');
echo ('<td class="partie">'.(utf8_decode($row->Partie)).'</td>');
echo ('<td class="menge">'.(utf8_decode($row->Menge)).'</td>');
echo ('<td class="langevon">'.(utf8_decode($row->langevon)).'</td>');
echo ('<td class="langebis">'.(utf8_decode($row->langebis)).'</td>');
echo ('<td class="hauptl">'.(utf8_decode($row->Hauptlange)).'</td>');
echo ('<td class="preis">'.(utf8_decode($row->preis)).'</a></td>');
echo ('<td class="hf">'.(utf8_decode($row->Trockenheit)).'</td>');
echo ('<td class="stk">'.(utf8_decode($row->stk)).'</td>');
echo ('</tr>');
}
}else{
echo ('<tr><td class="fehler" colspan="8">Keine Datensätze vorhanden!</td></tr>');
}
}
echo ('</table>');
?>
<br/><form id="form2" name="form2" method="post" action="">
<table border="1">
<tr>
<th scope="col">PaketNr</th>
<th scope="col">Holzart</th>
<th scope="col">PartieNr.</th>
<th scope="col">Menge</th>
<th scope="col">Stärke</th>
<th scope="col">Länge von</th>
<th scope="col">Länge bis</th>
<th scope="col">Länge</th>
<th scope="col">Preis</th>
<th scope="col">HF</th>
<th scope="col">Klasse</th>
<th scope="col">STK</th>
</tr>
<tr>
<td><label for="paketnr"></label>
<input name="paketnr" type="text" id="paketnr" size="25" /></td>
<td><label for="holzart"></label>
<input name="holzart" type="text" id="holzart" size="25" /></td>
<td><?php $sql1="SELECT MAX(Partie) AS Partie FROM suchmaschine";
$ergebnis = mysql_result(mysql_query($sql1), 0);
$partienr = $ergebnis + 1;
?> <label for="partienr"></label>
<input name="partienr" type="text" id="partienr" value="<?php echo $partienr;?> " size="20" /></td>
<td><label for="menge"></label>
<input name="menge" type="text" id="menge" size="20" /></td>
<td><label for="starke"></label>
<input name="starke" type="text" id="starke" size="10" /></td>
<td><label for="langevon"></label>
<input name="langevon" type="text" id="langevon" size="15" /></td>
<td><label for="langebis"></label>
<input name="langebis" type="text" id="langebis" size="15" /></td>
<td><label for="hauptl"></label>
<input name="hauptl" type="text" id="hauptl" size="15" /></td>
<td><label for="preis"></label>
<input name="preis" type="text" id="preis" size="15" /></td>
<td><label for="feuchte"></label>
<input name="feuchte" type="text" id="feuchte" size="15" /></td>
<td><label for="klasse"></label>
<input name="klasse" type="text" id="klasse" size="15" /></td>
<td><label for="stuck"></label>
<input name="stuck" type="text" id="stuck" size="15" /></td>
</tr>
</table>
<input type="submit" name="weiter2" id="weiter2" value="Nächster Datensatz" />
<input type="hidden" name="post1" id="post1" value="<?php $_POST['lieferscheinnr']; ?>"/>
<br/>
</form>
<?php
}
if(isset($_POST['weiter2'])){
print_r($_POST);
}
?>