<?php

ini_set('date.timezone', 'Europe/Berlin');
setlocale(LC_TIME, "de_DE.ISO8859-1");
setlocale(LC_ALL, 'de_DE');
header('Content-Type: text/html; charset=ISO-8859-1');



$Nummer =    $_GET['nr'];	

// Variablen erstellen zum Oeffnen von 1.txt und 1p.txt
$txt2= array($Nummer, ".txt");
$txt = implode("", $txt2);

$ptxt2= array($Nummer, "p.txt");
$ptxt = implode("", $ptxt2);


$datei1 = fopen($txt,"r");
$zeile1 = fgets($datei1,3000);
fclose($datei1);


$datei2 = fopen($ptxt,"r");
$zeile2 = fgets($datei2,200);
fclose($datei2);


// Messen der Länge des Variablen-Namens
// $rest = substr("abcdef", -3, 1); // gibt "d" zurück
// $rest1 = substr($zeile1, 5);    Preis1=
// $rest2 = substr($zeile2, 7);    txt1=
// substr($str, -$length);
// strlen($txt);
// strlen($ptxt);
$Laenge1 = strlen($txt);
$Laenge2 = strlen($ptxt);


// Reduzieren um die Anzahl Zeichen des Variablen-Namens

$rest1 = substr($zeile1, $Laenge1);  
$rest2 = substr($zeile2, ($Laenge2+1)); 

$jpg2 = array("", $Nummer, ".jpg");
$jpg = implode("", $jpg2);
 
echo '<img src="', $jpg, '" width="800" height="450"><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
// 
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body {
	background-color: #FFF0C4;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
#Feld8-Schrift {
	font-family: Arial, Helvetica, sans-serif;
}
.Arial {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 20px;
}
.Stil11 {
	font-family: Arial, Helvetica, sans-serif;
	color: #000000;
	font-size: 22px;
	background-color: #FFF0C4;
}
.Stil12 {
	font-family: Arial, Helvetica, sans-serif;
	color: #000000;
	font-size: 22px;
	background-color: #FFF0C4;
}
</style>

<script type="text/javascript">

function einsetzen(){
parent.addieren(document.form1.elements[1].value + " ****** ");
parent.addieren2(document.form1.elements[2].value);
}


</script>

</head>
<body>
<form id="form1" name="form1" method="post" action="javascript:einsetzen()">
  <p>
    <label for="Feld1"></label>
    <input name="Einsetzen" type="submit" class="Stil12" id="Einsetzen" value="in Warenkorb" />
  </p>
  <p>
    <textarea name="Feld1" cols="35" rows="40" id="Feld1" hidden="yes"><?php echo $rest1?></textarea>
    <br />
    <br />
    <label for="Feld2"></label>
    <input name="Feld2" type="text" id="Feld2" value="<?php echo $rest2?>" size="16" maxlength="16" hidden="yes" />
  </p>
</form>
</body>
</html>