<?php
$sql = "SELECT * FROM " . PREFIX . "_Artikel WHERE ID =\"" . $_POST['ID'] . "\";";
$result = $db->query($sql);
$nt = $result->fetch_assoc();
echo "<form action=\"index.php?" . $_SERVER['QUERY_STRING'] . "\" method=\"post\">\n";
echo "	<fieldset>\n";
echo "		<legend>Artikel <i>" . $_POST['ID'] . " - " . $nt['Bezeichnung'] . "</i> bearbeiten</legend>\n";
echo "		<input type=\"hidden\" name=\"ID\" value=\"" . $nt['ID'] . "\" />\n";
echo "		<label>Bezeichnung</label>\n";
echo "		<input type=\"text\" name=\"Bezeichnung\" value=\"" . $nt['Bezeichnung'] . "\" />\n";
echo "		<br />\n";
if ("" != $_SESSION['Firma']['Feld1_Name'])
{
	echo "		<label>" . $_SESSION['Firma']['Feld1_Name'] . "</label>\n";
	echo "		<textarea rows=\"10\" class=\"Artikel\" name=\"Feld1\">" . stripslashes($nt['Feld1']) . "</textarea>\n";
	echo "		<br />\n";
}
if ("" != $_SESSION['Firma']['Feld2_Name'])
{
	echo "		<label>" . $_SESSION['Firma']['Feld2_Name'] . "</label>\n";
	echo "		<input type=\"text\" name=\"Feld2\" value=\"" . stripslashes($nt['Feld2']) . "\" />\n";
	echo "		<br />\n";
}
if ("" != $_SESSION['Firma']['Feld3_Name'])
{
	echo "		<label>" . $_SESSION['Firma']['Feld3_Name'] . "</label>\n";
	echo "		<input type=\"text\" name=\"Feld3\" value=\"" . stripslashes($nt['Feld3']) . "\" />\n";
	echo "		<br />\n";
}
if ("" != $_SESSION['Firma']['Feld4_Name'])
{
	echo "		<label>" . $_SESSION['Firma']['Feld4_Name'] . "</label>\n";
	echo "		<input type=\"text\" name=\"Feld4\" value=\"" . stripslashes($nt['Feld4']) . "\" />\n";
	echo "		<br />\n";
}
if ("" != $_SESSION['Firma']['Feld5_Name'])
{
	echo "		<label>" . $_SESSION['Firma']['Feld5_Name'] . "</label>\n";
	echo "		<input type=\"text\" name=\"Feld5\" value=\"" . stripslashes($nt['Feld5']) . "\" />\n";
	echo "		<br />\n";
}
echo "		<label>Preis</label>\n";
echo "		<input type=\"text\" name=\"Preis\" value=\"" . $nt['Preis'] . "\" />\n";
echo "		<br />&nbsp;<br />\n";
echo "	</fieldset>\n";
echo "	<fieldset>\n";
echo "		<legend>Artikel speichern</legend>\n";
echo "		<input type=\"submit\" name=\"formaction\" value=\"save\" title=\"Artikel speichern\" class=\"button_save\" />\n";
echo "	</fieldset>\n";
echo "</form>\n";