<FORM name="readvalues" method="GET" action="kundenbearbeiten.php" >
<?php
echo "Die Enter-Taste bewirkt NUR das Auslesen der Werte";
echo "</br>";
echo "Kundennummer:";
?>
<input type='text' name='kdnr' maxlength='6' required='required'>
<input type='submit' name='readvalues' value='Werte Auslesen'>
<input type='submit' name='writevalues' value='Werte in Datenbank schreiben'">
<?php //Um die Fehlermeldung der Initial-Variable(welche Leer ist) zu unterdrücken setzen wir diese If-Schleife hinten dran.
if (isset($_GET['kdnr']) AND $_GET['kdnr']){
$temp = $_GET['kdnr'];
}
if (isset($temp) AND $temp){
echo ($temp);
}
echo "</br>";
echo "</br>";
echo "</br>";
echo "</br>";
//Hier werden die Werte von der Datenbank in die Formularfelder eingefügt
if (isset($_GET['kdnr']) AND $_GET['kdnr']){
$result = send_sql($globalDbName, "Select * from kundentbl where debitor =".$_GET['kdnr']."");
while ($zeile=mysql_fetch_array($result)){
echo "Debitor:";
echo "</br>";
echo "<input type='text' name='debitor' value=".$zeile['debitor'].">";
echo "</br>";
echo "Firma:";
echo "</br>";
echo "<input type='text' name='firma' value='".$zeile['firma']."'>";
echo "</br>";
echo "Waren Nummer:";
echo "</br>";
echo "<input type='text' name='wnr' value='".$zeile['wnr']."'>";
echo "</br>";
echo "Start Vertrags-Datum:";
echo "</br>";
echo "<input type='text' name='start_date' value='".$zeile['start_date']."'>";
echo "</br>";
echo "Ende Vertrags-Datum:";
echo "</br>";
echo "<input type='text' name='end_date' value='".$zeile['end_date']."'>";
echo "</br>";
echo "Ort:";
echo "</br>";
echo "<input type='text' name='ort' value='".$zeile['ort']."'>";
echo "</br>";
echo "Bodenmatten Abrechnungs Zeitraum:";
echo "</br>";
echo "<input type='text' name='bm_abr_zeitr' value='".$zeile['bm_abr_zeitr']."'>";
echo "</br>";
echo "Flachwaesche:";
echo "</br>";
echo "<input type='text' name='fw' value='".$zeile['fw']."'>";
echo "</br>";
echo "Boden Matten:";
echo "</br>";
echo "<input type='text' name='bm' value='".$zeile['bm']."'>";
echo "</br>";
echo "Miet und Berufskleidung:";
echo "</br>";
echo "<input type='text' name='mbk' value='".$zeile['mbk']."'>";
echo "</br>";
echo "WP:";
echo "</br>";
echo "<input type='text' name='wp' value='".$zeile['wp']."'>";
echo "</br>";
echo "Kundeneigentum:";
echo "</br>";
echo "<input type='text' name='ke' value='".$zeile['ke']."'>";
echo "</br>";
echo "Splitting:";
echo "</br>";
echo "<input type='text' name='splitting' value='".$zeile['splitting']."'>";
echo "</br>";
echo "Miete:";
echo "</br>";
echo "<input type='text' name='miete' value='".$zeile['miete']."'>";
echo "</br>";
echo "Webservice:";
echo "</br>";
echo "<input type='text' name='webservice' value='".$zeile['webservice']."'>";
echo "</br>";
echo "Schrankfach Service:";
echo "</br>";
echo "<input type='text' name='schrankfservice' value='".$zeile['schrankfservice']."'>";
echo "</br>";
echo "Lieferpreis:";
echo "</br>";
echo "<input type='text' name='lp' value='".$zeile['lp']."'>";
echo "</br>";
}
}
if(isset($_GET['writevalues']) AND $_GET['writevalues']){
send_sql($globalDbName,"Update kundentbl set debitor=".$_GET['debitor'].",
firma='".$_GET['firma']."',
wnr='".$_GET['wnr']."',
start_date='".$_GET['start_date']."',
end_date='".$_GET['end_date']."',
ort='".$_GET['ort']."',
bm_abr_zeitr='".$_GET['bm_abr_zeitr']."',
fw='".$_GET['fw']."',
bm='".$_GET['bm']."',
mbk='".$_GET['mbk']."',
wp='".$_GET['wp']."',
ke='".$_GET['ke']."',
splitting='".$_GET['splitting']."',
miete='".$_GET['miete']."',
webservice='".$_GET['webservice']."',
schrankfservice='".$_GET['schrankfservice']."',
lp='".$_GET['lp']."'
where debitor=".$temp."");
echo "<meta http-equiv=\"refresh\" content=\"0; URL=kundenbearbeiten.php\">";
}
?>
</FORM>