<?php
$eins = rand(20, 30);
$zwei = rand(1, 10);
$drei = rand(0, 1);
if (0 == $drei)
{
	$ergebnis = $eins + $zwei;
	$abfrage = $eins . " + " . $zwei . " = ";
}
else
{
	$ergebnis = $eins - $zwei;
	$abfrage = $eins . " - " . $zwei . " = ";
}
if ("start_00" == $_POST['prod'])
{
	$month_cost = 10;
}
elseif ("start_01" == $_POST['prod'])
{
	$month_cost = 7.5;
}
elseif ("start_02" == $_POST['prod'])
{
	$month_cost = 5;
}
if ("Post" == $_POST['Versand'])
{
	$send_cost = 5;
}
else
{
	$send_cost = 0;
}
$ein_cost = 0;
if ("3" == $_POST['Zahlung'])
{
	$month_cost = $month_cost * 1.2;
	$ein_cost = 10;
}
elseif ("6" == $_POST['Zahlung'])
{
	$month_cost = $month_cost * 1.1;
	$ein_cost = 5;
}

$cost = $month_cost * $_POST['Zahlung'] + $send_cost + $ein_cost;

echo "<fieldset>\n";
echo "	<legend>Bestellübersicht</legend>\n";
echo "	<form action=\"bestellung.php\" method=\"post\">\n";
echo "		<input type=\"hidden\" name=\"prod\" value=\"" . $_POST['prod'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"aktstep\" value=\"5\" />\n";
echo "		<input type=\"hidden\" name=\"Ergebnis\" value=\"" . $ergebnis . "\" />\n";
echo "		<input type=\"hidden\" name=\"Firma_Name\" value=\"" . $_POST['Firma_Name'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Anrede\" value=\"" . $_POST['Anrede'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Vorname\" value=\"" . $_POST['Vorname'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Nachname\" value=\"" . $_POST['Nachname'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Strasse\" value=\"" . $_POST['Strasse'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Nummer\" value=\"" . $_POST['Nummer'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"PLZ\" value=\"" . $_POST['PLZ'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Ort\" value=\"" . $_POST['Ort'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Land\" value=\"" . $_POST['Land'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Telefon\" value=\"" . $_POST['Telefon'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Mobil\" value=\"" . $_POST['Mobil'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Email\" value=\"" . $_POST['Email'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Email2\" value=\"" . $_POST['Email2'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"User\" value=\"" . $_POST['User'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Passwort\" value=\"" . $_POST['Passwort'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Passwort2\" value=\"" . $_POST['Passwort2'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Zahlung\" value=\"" . $_POST['Zahlung'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"Versand\" value=\"" . $_POST['Versand'] . "\" />\n";
echo "		<input type=\"hidden\" name=\"agb_ok\" value=\"" . $_POST['agb_ok'] . "\" />\n";
echo "		<input type=\"submit\" class=\"button_prev\" name=\"step\" value=\"4\" />\n";
include __DIR__ . "/start_prod.php";
echo "		<input type=\"submit\" class=\"button_next\" name=\"step\" value=\"6\" />\n";
echo "		<br />\n";
echo "		<hr />\n";
echo "		<br />\n";
echo "		<label>Firmenname</label><label>" . $_POST['Firma_Name'] . "</label><br />\n";
echo "		<label>Ansprechpartner</label><label>" . $_POST['Anrede'] . " " . $_POST['Vorname'] . " " . $_POST['Nachname'] . "</label><br />\n";
echo "		<label>Anschrift</label><label>" . $_POST['Strasse'] . " " . $_POST['Nummer'] . "</label><br />\n";
echo "		<label>PLZ / Ort</label><label>" . $_POST['PLZ'] . " " . $_POST['Ort'] . "</label><br />\n";
echo "		<label>Land</label><label>" . $_POST['Land'] . "</label><br />\n";
echo "		<label>Telefon</label><label>" . $_POST['Telefon'] . "</label><br />\n";
echo "		<label>Mobil</label><label>" . $_POST['Mobil'] . "</label><br />\n";
echo "		<label>Email</label><label>" . $_POST['Email'] . "</label><br />\n";
echo "		<hr />\n";
echo "		<label>Benutzername</label><label>" . $_POST['User'] . "</label><br />\n";
echo "		<hr />\n";
echo "		<label>Zahlungszeitraum</label><label>";
if ("12" == $_POST['Zahlung'])
{
	echo "Jährlich";
}
elseif ("6" == $_POST['Zahlung'])
{
	echo "Halbjährlich";
}
elseif ("3" == $_POST['Zahlung'])
{
	echo "Vierteljährlich";
}
echo "</label><label style=\"text-align: right; width: 100px;\">" . $_POST['Zahlung'] . " x " . number_format($month_cost, '2', ',', '.') . " €</label><br />\n";
echo "		<label>Rechnungsversand</label><label>" . $_POST['Versand'] . "</label><label style=\"text-align: right; width: 100px;\">" . number_format($send_cost, '2', ',', '.') . " €</label><br />\n";
echo "		<label>Einrichtungsgebühr</label><label>&nbsp;</label><label style=\"text-align: right; width: 100px;\">" . number_format($ein_cost, '2', ',', '.') . " €</label><br />\n";
echo "		<label class=\"warn\">Kosten für den Abrechnungszeitraum</label>\n";
echo "		<label>&nbsp;</label>\n";
echo "		<label class=\"warn\" style=\"text-align: right; width: 100px;\" >" . number_format($cost, '2', ',', '.') . " €</label>\n";
echo "		<br /><hr /><br />\n";
echo "		<label\n";
if ($check_sicher)
{
	echo " class=\"warn\"";
}
echo ">Sicherheitsabfrage: " . $abfrage . "</label>\n";
echo "		<input type=\"text\" name=\"Abfrage\" />\n";
echo "		<br />&nbsp;<br /><hr /><br />\n";
echo "		<input type=\"submit\" class=\"button_prev\" name=\"step\" value=\"4\" />\n";
include __DIR__ . "/warnings.php";
echo "		<input type=\"submit\" class=\"button_next\" name=\"step\" value=\"6\" />\n";
echo "	</form>\n";
echo "</fieldset>\n";