<?php

// <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
ini_set('date.timezone', 'Europe/Berlin');
setlocale(LC_TIME, "de_DE.UTF-8");
//setlocale(LC_TIME, "de_DE.ISO8859-1");
setlocale(LC_ALL, 'de_DE');
header('Content-Type: text/html; charset=utf-8'); 



$Nummer   =    $_GET['nr'];
$Nummer1  =	   $Nummer++; 
$Nummer2  =	   $Nummer++; 
$Nummer3  =	   $Nummer++; 
$Nummer4  =	   $Nummer++; 
$Nummer5  =	   $Nummer++; 

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

$ptxt2= array($Nummer1, "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("", $Nummer1, ".jpg");
$jpg = implode("", $jpg2);
echo '<font size="4" face="Arial, Helvetica, Univers">';
echo 'Artikel: ', $Nummer1; 
echo '<br>'; 
echo '<a href="https://www.a4w.ch/ruffle-Plug-in/Bilder/';
echo $Nummer1;
echo '.jpg"><img src="', $jpg, '" width="300" height="169"></a><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
echo '<br><hr />';
// 


$txt2= array($Nummer2, ".txt");
$txt = implode("", $txt2);

$ptxt2= array($Nummer2, "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);

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

$jpg2 = array("", $Nummer2, ".jpg");
$jpg = implode("", $jpg2);
echo '<font size="4" face="Arial, Helvetica, Univers">';
echo 'Artikel: ', $Nummer2; 
echo '<br>'; 
echo '<a href="https://www.a4w.ch/ruffle-Plug-in/Bilder/';
echo $Nummer2;
echo '.jpg"><img src="', $jpg, '" width="300" height="169"></a><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
echo '<br><hr />';


$txt2= array($Nummer3, ".txt");
$txt = implode("", $txt2);

$ptxt2= array($Nummer3, "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);

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

$jpg2 = array("", $Nummer3, ".jpg");
$jpg = implode("", $jpg2);
echo '<font size="4" face="Arial, Helvetica, Univers">';
echo 'Artikel: ', $Nummer3; 
echo '<br>'; 
echo '<a href="https://www.a4w.ch/ruffle-Plug-in/Bilder/';
echo $Nummer3;
echo '.jpg"><img src="', $jpg, '" width="300" height="169"></a><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
echo '<br><hr />';


$txt2= array($Nummer4, ".txt");
$txt = implode("", $txt2);

$ptxt2= array($Nummer4, "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);

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

$jpg2 = array("", $Nummer4, ".jpg");
$jpg = implode("", $jpg2);
echo '<font size="4" face="Arial, Helvetica, Univers">';
echo 'Artikel: ', $Nummer4; 
echo '<br>'; 
echo '<a href="https://www.a4w.ch/ruffle-Plug-in/Bilder/';
echo $Nummer4;
echo '.jpg"><img src="', $jpg, '" width="300" height="169"></a><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
echo '<br><hr />';

$txt2= array($Nummer5, ".txt");
$txt = implode("", $txt2);

$ptxt2= array($Nummer5, "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);

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

$jpg2 = array("", $Nummer5, ".jpg");
$jpg = implode("", $jpg2);
echo '<font size="4" face="Arial, Helvetica, Univers">';
echo 'Artikel: ', $Nummer5; 
echo '<br>';  
echo '<a href="https://www.a4w.ch/ruffle-Plug-in/Bilder/';
echo $Nummer5;
echo '.jpg"><img src="', $jpg, '" width="300" height="169"></a><br><br>';
echo '<font size="4" face="Arial, Helvetica, Univers">',$rest1,'</font>';
echo '<br><br><font size="4" face="Arial, Helvetica, Univers">',$rest2,'</font>';
echo '<br><hr />';
?>


<!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: #FFFFFF;
	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(){
if(document.form1.elements[0].value!=""){
parent.addieren(document.form1.elements[0].value + " mal ");
}
if(document.form1.elements[1].value!=""){
parent.addieren(" Typ " + document.form1.elements[1].value + " ");
}
if(document.form1.elements[4].value!="1"){
Total =	(document.form1.elements[4].value*document.form1.elements[0].value);
}
parent.addieren(document.form1.elements[3].value + " ****** ");
parent.addieren2(Total);
}


</script>

</head>
<body>
</body>
</html>