#!/usr/bin/perl

use common;

@PRICES = common::read();

print <<EOD;
content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html lang="de">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<title>McLoop: Bestellung</title> 
	<link rel="Stylesheet" href="../Skins/Styles/All.css" media="all">
  <script language="javascript">
    function check(form) {
      var P = 0;
      for(i=0;i<=17;i++) {
        if(form.elements["prod_"+i].value != 0) {
          P = 1;
        }
      }
      if(P > 0) {
        return(true);
      }else{
      	window.alert("Sie haben kein Produkt ausgewählt!");
        return(false);
      }
    }
  </script>
</head>
<body>
<div class="Header">
    <img class="Logo" src="../Skins/Images/Logo.gif" alt="McLoop">
</div>
<div class="Navigation">
	<p class="MainNav">
		<a href="index.html">Home</a> 
	</p>
	<p class="MainNav">
		<a href="Leuchten/McLoopI-Motiv.html">Leuchten</a> 
	</p>
	<p class="MainNav">
		<a href="Publikationen/McLoop1/index.html">Publikationen</a> 
	</p>
	<p class="MainNav">
		<a href="Events/index.html">Events</a> 
	</p>
	<p class="MainActual">
		Bestellung
	</p>
	<p class="MainNav">
		<a href="Vita.html">Vita</a> 
	</p>
	<p class="MainNav">
		<a href="Impressum.html">Impressum</a> 
	</p>
</div>
<div class="Content">
	<h1>
		Bestellung
	</h1>
	<p>
		Jedes Motiv existiert 25 mal. Es wird nummeriert und signiert.
		<br>
		Ist ein Motiv ersch&ouml;pft, wird eine neue Vorlage geschaffen.
	</p>
<form action="Bestellung2.pl" method="get" onSubmit="return check(this);">
<table>
	<tr>
		<td class="left" colspan="3">
			<h2>McLoop Deckenleuchten</h2>
		</td>
	</tr>
EOD
printprod_best(0,9);
print <<EOD;
	<tr>
		<td class="left" colspan="3">
			<h2>McLoop Motivscheiben mit Wandhalterung</h2>
		</td>
	</tr>
EOD

printprod_best(10,17);

print <<EOD;
</table>
<p>
	Nettopreise zzgl. 16%&nbsp;Mwst.
	<br>
	Bei Bestellung 50%&nbsp;Anzahlung, bei Lieferung komplett.
	<br>
	Die Lieferbedingungen sind individuell zu vereinbaren.
</p>
<p>
	<input class="button" type="submit" value="weiter&hellip;">
</p>
</form>
</div>
</body>
</html>
EOD


exit(0);


sub printprod_best{
my ($from,$to) = @_;
for($i=$from;$i<=$to;$i++){
  my $akt = $PRICES[$i];
  my $Lamp = $akt->[2];
  my $Desc = $akt->[3];
  my $Price = $akt->[4];
  chop($Price);
print <<EOD;
	<tr>
		<td>
			<input class="Pieces" type="text" name="prod_$i" value="0">
		</td>
		<td class="Lamp">
      $Lamp
		</td>
		<td class="Description">
      $Desc
		</td>
		<td class="Price">
      $Price&nbsp;EUR
		</td>
		<td class="Price">
			&nbsp;
		</td>
	</tr>
EOD
}
}

