Um Ihre Bestellung aufzunehmen, benötigen wir Ihre Anschrift Anrede
Vorname* / Name *
  (evtl. Adresszusatz wie Firma, c/o oder Ähnliches)
Straße*
PLZ* / Ort*
  Telefon** / Fax
  Email-Adresse**
* Die mit Sternchen gekennzeichneten Felder müssen für eine Bestellung zwingend ausgefüllt werden. ** Zur Ausführung Ihrer Bestellung muss mindestens eines der beiden Felder (Telefonnummer oder Email-Adresse) ausgefüllt werden. Lieferart  
"; $lh=str_replace("[artikel]",$out,$lh); $lh=str_replace("[menuout]",genmenu($rid),$lh); } function proc_bestellen() { global $lh, $PHP_SELF,$sid; global $anrede,$vname,$name,$adradd,$str,$plz,$ort,$tel,$fax,$email; global $summe,$rabatt,$wwert,$vk,$lieferart; //echo $vname,$name,$adradd,$str,$plz,$ort,$tel,$fax,$email; $lh=implode("",file("shop.tpl")); $errcnt=0; if (strlen($str)<2) { $errstring.=" Straße ";$errcnt++;} if (strlen($ort)<2) { $errstring.=" Ort ";$errcnt++;} if (strlen($plz)<2) { $errstring.=" PLZ ";$errcnt++;} if (strlen($vname)<2) { $errstring.=" Vorname ";$errcnt++;} if (strlen($name)<2) { $errstring.=" Name ";$errcnt++;} if (strlen($tel)<2 and strlen($email)<2) { $errstring.=" Telefon oder Email ";$errcnt++;} if ($errcnt>0) { // Felder unvollständig ausgefüllt if ($errcnt==1) $out.="Das Feld $errstring muß ausgefüllt werden !"; else $out.="Die Felder: $errstring müssen ausgefüllt werden !"; $out.="

Zurück "; } else { $out.="
Ich akzeptiere die allgemeinen Geschäftsbedingungen.
Nur dann kann eine Auslieferung erfolgen!
 
"; } $lh=str_replace("[artikel]",$out,$lh); $lh=str_replace("[menuout]",genmenu($rid),$lh); } function end_bestellen() { global $lh, $PHP_SELF,$sid; global $anrede,$vname,$name,$adradd,$str,$plz,$ort,$tel,$fax,$email; global $summe,$rabatt,$wwert,$vk,$lieferart; //echo $vname,$name,$adradd,$str,$plz,$ort,$tel,$fax,$email; if ($lieferart=="express") $lieferart=" EXPRESS - BITTE ABWEICHENDE VERSANDKOSTEN BERÜCKSICHTIGEN"; $kunde= "Der Kunde
Andrede : $anrede
Vorname : $vname
Name : $name
Adresszusatz: $adradd
Strasse : $str
PLZ/Ort : $plz $ort
Tel. : $tel
Fax : $fax
Email : $email
Lieferart: $lieferart
möchte folgendes bestellen: "; $mtxt=""; $mtxt.=genwk($sid); $mtxt.="
$kunde
"; mail("concerto@t-online.de", "CONCERTO Bestellung über das Internet", $mtxt, "MIME-Version: 1.0\r\n"."Content-type: text/html; charset=iso-8859-1\r\n"."From: $email\r\n"); $out.="
Vielen Dank.
Wir haben Ihre Bestellung entgegengenommen und werden umgehend liefern!
 
"; $lh=str_replace("[artikel]",$out,$lh); $lh=str_replace("[menuout]",genmenu($rid),$lh); } function wk() { global $lh,$PHP_SELF,$sid; $lh=implode("",file("shop.tpl")); $out=genwk ($sid); $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",$out,$lh); } function genwk ($sid) { global $PHP_SELF; $out=""; $stwk=mysql_query("select * from shop_session where sid='$sid'"); if ($stwk and mysql_num_rows($stwk)>0) { $out.=""; for ($i=0;$i<128;$i++) {$rubrikcnt[$i]=0;$rubriksumme[$i]=0;} while ($lwk=mysql_fetch_array($stwk)) { $aid=$lwk["aid"]; $menge=$lwk["anzahl"]; $groesse=$lwk["groesse"]; $farbe=$lwk["farbe"]; $varianten="$groesse $farbe"; $stmt=mysql_query("select * from artikel where id=$aid"); $l1=mysql_fetch_array($stmt); $name=$l1["name"]; $preis=$l1["preis"]; $image=$l1["image"]; $artnummer=$l1["artnummer"]; $rid=$l1["rubrik"]; if ($groesse) { // groessen-variante hat evtl. abweichenden preis: also nachgucken $st=mysql_query("select * from artvargroesse where id_artikel=$aid and groesse='$groesse'"); $lg=mysql_fetch_array($st); $diffpreis=$lg["preis"]; if ($diffpreis) $preis=$diffpreis; } $einzelpreis=$preis; $mengemalpreis=$einzelpreis*$menge; $rubrikcnt[$rubrik]=$rubrikcnt[$rubrik]+$menge; $rubriksumme[$rubrik]=$rubriksumme[$rubrik]+$mengemalpreis; $summe=$summe+$mengemalpreis; $out.=""; } // while $out.=""; $wwert=$summe; //--- eventuelle aktionen einberechnen $st=mysql_query("select * from aktionen"); while($l=mysql_fetch_array($st)) { $akop=$l["op"]; $akanzahl=$l["anzahl"]; $akrubrik=$l["rubrik"]; $akmode=$l["mode"]; $akvalue=$l["value"]; switch ($akop) { case ">" : if ($rubrikcnt[$akrubrik] > $akanzahl) { //---rubrik-match gefunden : $akdata.="rubrik-match $akrubrik gefunden"; if ($akmode=="Rabatt") { $rabatt=$rabatt+($rubriksumme[$akrubrik] * $akvalue)/100; } } } } //---------rabattregeln---------- $rabatt=0; if ($rabatt>0) {$out.=""; $summe=$summe-$rabatt;} //------ Versandkostenberechnung ------ if ($summe>150) $vk=0; else $vk=5; $out.=""; $out.=""; $out.=" "; } //if ($stwk ..:w else $out.=""; $out.="
BildArtikelArt.No.VariantenEinzelpreisMengeBestellwert
$name $artnummer  $varianten ".nice($einzelpreis)." EUR $menge ".nice($mengemalpreis)." EUR
Warenwert Summe : ".nice($summe)." EUR
Rabatt gesamt : ".nice($rabatt)." EUR
Versandkosten (Inland, normal) : ".nice($vk)." EUR
Gesamtsumme : ".nice($summe+$vk)." EUR

 
Erst aussuchen, dann bestellen ... :)

Ihr Warenkorb ist leer.

<<< zurück zur vorhergehenden Seite.

"; return ($out); } function genartikel($rid) { global $PHP_SELF,$sid,$aid; if($aid) { // ---artikeldetail --- $stmt=mysql_query("select * from artikel where pubflag=1 and lieferbar!=3 and id=$aid "); if (! ($stmt>0 and mysql_num_rows($stmt)>0)) {$out.=" kein Artikel."; } else { $l1=mysql_fetch_array($stmt); $name=$l1["name"]; $artnummer=$l1["artnummer"]; $kurzbeschr=$l1["kurzbeschr"]; $preis=$l1["preis"]; $image=$l1["image"]; $subline=$l1["subline"]; $flag_sonder=$l1["flag_sonder"]; $mw=$l1["mw"]; $rid=$l1["rubrik"]; $lieferbar=$l1["lieferbar"]; $granum1=$l1["granum1"]; $granum2=$l1["granum2"]; $granum3=$l1["granum3"]; $pubflag=$l1["pubflag"]; $formaction=$PHP_SELF; $bestellbutton=" "; // --- dazugehörige artikel generieren ---- for ($i=1;$i<4;$i++) { $acnum=${"granum$i"}; if ($acnum) { $st2=mysql_query("select * from artikel where artnummer='$acnum' and pubflag=1 and lieferbar!=3 "); if ($l2=mysql_fetch_array($st2)) { $acname=$l2["name"]; $acbesch=$l2["kurzbeschr"]; $acpreis=$l2["preis"]; $acid=$l2["id"]; $artdazu.="Bestellen Sie dazu passend:
$acname
$acbesch
Bestell.Nr.: $acnum
EUR ".nice($acpreis)."

"; } } } // --- groessen+farbvarianten bilden ------ $st=mysql_query("select * from artvargroesse where id_artikel=$aid order by groesse"); if ( !$st or mysql_num_rows($st)==0) {$groessen="

Größe einheitlich.

"; } else { $groessen="

Größe

"; } $st=mysql_query("select * from artvarfarbe where id_artikel=$aid order by farbe"); if ( !$st or mysql_num_rows($st)==0) {$farben="

Farbe wie abgebildet

"; } else { $farben="

Farbe

"; } if (file_exists("$artnummer.tpl")) {$tpl=implode("",file("$artnummer.tpl"));} else { if (file_exists("artikel-$unterrubrik.tpl")) {$tpl=implode("",file("artikel-$unterrubrik.tpl"));} else {$tpl=implode("",file("artikel.tpl"));} } if ($image) {if (file_exists("produkte/$image-high1.jpg")) $tpl=str_replace("0000-high1.gif","$image-high1.jpg",$tpl);} if ($image) {if (file_exists("produkte/$image-high2.jpg")) $tpl=str_replace("0000-high2.gif","$image-high2.jpg",$tpl);} $tpl=str_replace("[artikelbezeichnung]",$name,$tpl); $tpl=str_replace("[artikel-nummer]",$artnummer,$tpl); $tpl=str_replace("[artikelbeschreibung]",$kurzbeschr,$tpl); $tpl=str_replace("[subline]",$subline,$tpl); $tpl=str_replace("[preis]",nice($preis),$tpl); $tpl=str_replace("[bestellen]",$bestellbutton,$tpl); $tpl=str_replace("[groessen]",$groessen,$tpl); $tpl=str_replace("[farben]",$farben,$tpl); $tpl=str_replace("[artikel-dazu]",$artdazu,$tpl); $tpl=str_replace("[formaction]",$formaction,$tpl); // mac hat hier die einzelartikel-pruefung erweitert $tpl=preg_replace("/\[snip-(\S+).tpl\]/e","implode('',file('snip-$1.tpl'))",$tpl); $out.=$tpl; } // else keine artikel } // if aid else { // ---artikellist --- if ($oberrubrik and !$unterrubrik) { //$out=implode("",file("rubrik.tpl")); $tplfn=preg_replace("/[\s\/\\']/","_",strtolower("$oberrubrik.tpl")); $out=implode("",file($tplfn)); $out=preg_replace("/\[snip-(\S+).tpl\]/e","implode('',file('snip-$1.tpl'))",$out); $out=str_replace("[go_artikel]","zu den Artikeln",$out); } //if ($unterrubrik) if ($rid) { //$tpl=implode("",file("artikel-rubrik.tpl")); if (file_exists("r$rid.tpl")) { $tplfn=preg_replace("/[\s\/\\\']/","_",strtolower("r$rid.tpl")); $tpl=implode("",file($tplfn));} else {$tpl=implode("",file("artikel-rubrik.tpl"));} //} //$tplfn=preg_replace("/[\s\/\\\']/","_",strtolower("r$rid.tpl")); //$tpl=implode("",file($tplfn)); list($uptpl,$trtpl,$downtpl) = preg_split ("/\[\[spoolarea\]\]/", $tpl); $out="".id2rubname($rid).""; $out.=$uptpl; $stmt=mysql_query("select * from artikel where rubrik=$rid and pubflag=1 and lieferbar!=3 order by name "); if (! ($stmt>0 and mysql_num_rows($stmt)>0)) { //$out.=" noch keine Artikel."; } else { //$out.="ArtikelPreis (EUR)"; while ($l1=mysql_fetch_array($stmt)) { $trline=$trtpl; $aid=$l1["id"]; $name=$l1["name"]; $artnummer=$l1["artnummer"]; $kurzbeschr=$l1["kurzbeschr"]; $preis=$l1["preis"]; $image=$l1["image"]; $subline=$l1["subline"]; $flag_sonder=$l1["flag_sonder"]; $mw=$l1["mw"]; $rid=$l1["rubrik"]; $lieferbar=$l1["lieferbar"]; $granum1=$l1["granum1"]; $granum2=$l1["granum2"]; $granum3=$l1["granum3"]; $pubflag=$l1["pubflag"]; if ($image) {if (file_exists("produkte/$image-low1.jpg")) $trline=str_replace("0000-low1.gif","$image-low1.jpg",$trline);} $trline=str_replace("[artikelbezeichnung]",$name,$trline); $trline=str_replace("[artikel-nummer]",$artnummer,$trline); $trline=str_replace("[artikelbeschreibung]",$kurzbeschr,$trline); $trline=str_replace("[subline]",$subline,$trline); $trline=str_replace("[preis]",nice($preis),$trline); $trline=str_replace("[link-zum-artikel]","Mehr Infos
zu diesem Artikel
> > >
",$trline); $out.=$trline; } } $out.=$downtpl; } } // else aid return ($out); } function add() { global $lh, $PHP_SELF,$sid,$rid,$aid,$menge,$name,$artnummer,$groesse,$farbe; global $artdazu1,$dazuid1,$artdazu2,$dazuid2,$artdazu3,$dazuid3; $lh=implode("",file("shop.tpl")); if ($groesse) $ifgroesse="and groesse='$groesse'"; if ($farbe) $iffarbe="and farbe='$farbe'"; $st=mysql_query("select * from shop_session where sid='$sid' and aid=$aid $ifgroesse $iffarbe"); if ($st and mysql_num_rows($st)==1) { mysql_query("update shop_session set anzahl=anzahl+$menge where sid='$sid' and aid=$aid"); } else { mysql_query("insert into shop_session (sid,aid,anzahl,groesse,farbe) values ('$sid',$aid,$menge,'$groesse','$farbe')"); } for ($i=1;$i<4;$i++) { $artdazu=${"artdazu$i"}; $dazuid=${"dazuid$i"}; if ($artdazu>0) { $pl++; $st=mysql_query("select * from shop_session where sid='$sid' and aid=$dazuid"); if ($st and mysql_num_rows($st)==1) mysql_query("update shop_session set anzahl=anzahl+$artdazu where sid='$sid' and aid=$dazuid"); else mysql_query("insert into shop_session (sid,aid,anzahl) values ('$sid',$dazuid,$artdazu)"); } } if ($pl>0) $pl="(+ Zusätze) wurden"; else $pl="wurde"; $out.="
Artikel $name $pl in den Warenkorb gelegt.

"; $lh=str_replace("[menuout]",genmenu($rid),$lh); $lh=str_replace("[artikel]",$out,$lh); } function rm() { global $lh, $PHP_SELF,$sid,$rid,$aid,$menge,$farbe,$groesse; if ($groesse) $ifgroesse="and groesse='$groesse'"; if ($farbe) $iffarbe="and farbe='$farbe'"; mysql_query("delete from shop_session where sid='$sid' and aid=$aid $ifgroesse $iffarbe"); $out.="
Der Artikel wurde aus dem Warenkorb entfernt.
 
"; $lh=str_replace("[menuout]",genmenu($rid),$lh); $lh=str_replace("[artikel]",$out,$lh); } function show_kat() { global $lh, $PHP_SELF,$sid,$rid,$rid,$act,$aid; if (!$sid) {$sid=uniqid("");} $lh=str_replace("[menuout]",genmenu($rid),$lh); if ($rid or $aid) $lh=str_replace("[artikel]",genartikel($rid),$lh); else $lh=str_replace("[artikel]",implode("",file("home.tpl")),$lh); } function a_hinweise() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("agb.tpl")),$lh); } function a_aktionen() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("aktionen.tpl")),$lh); } function a_shops() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("shops.tpl")),$lh); } function a_prospekt() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("prospekt.tpl")),$lh); } function a_kontakt() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("kontakt.tpl")),$lh); } function a_impressum() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("impressum.tpl")),$lh); } function a_lieferbed() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("lieferbedingungen.tpl")),$lh); } function a_agb() { global $lh, $PHP_SELF,$sid; $lh=str_replace("[menuout]",genmenu("",""),$lh); $lh=str_replace("[artikel]",implode("",file("agb.tpl")),$lh); } function id2rubname($rid) { while ($rid!=0) { $st=mysql_query("SELECT * from rubtree where id=$rid"); $l=mysql_fetch_array($st); $rid=$l["pid"]; $name=$l["name"]." / ".$name; } return($name); } function convtree2 ($pid,$depth,$parent,$name,$path,$acrid) { global $PHP_SELF,$sid; static $content; reset ($parent); if ($pid>0) $path.=$name[$pid]."/"; while (list($key,$val)=each($parent)) { if ($parent[$key]==$pid) { $rubid[$cnt][$depth]=$key; // check if $key has $acrid as child in some depth $flag=0; $ikey=$acrid; while ($ikey>0) { if ($key==$ikey) $flag=1; $ikey=$parent[$ikey]; } if ($flag==1) {$class="class='menuehl'";} else $class="class='body'"; $content.="
"; for ($i=0;$i<$depth;$i++) {$content.= "--";} $content.="".$name[$key]."\n"; $content.="
"; if ($flag==1) { convtree2($key,$depth+1,$parent,$name,$path,$acrid); } } } return ($content); } function selrubtree($rid) { // --- tree serialization $content=""; $s0=mysql_query("select * from rubtree order by pid"); while ($l=mysql_fetch_array($s0)) { $id=$l["id"]; $parent[$id]=$l["pid"]; $name[$id]=$l["name"]; } $content=convtree2 (0,0,$parent,$name,$content,$rid); return ($content); } function genmenu($rid) { global $PHP_SELF,$sid,$aid,$rid; $menuout=""; if ($aid) { $st=mysql_query("select * from artikel where id=$aid"); $l=mysql_fetch_array($st); $rid=$l["rubrik"]; } //--------- rubrikenbaumausgabe ---------- return selrubtree($rid); } switch ($act) { case "wk": wk();break; case "add": add();break; case "rm": rm();break; case "bestellen": bestellen();break; case "proc_bestellen": proc_bestellen();break; case "end_bestellen": end_bestellen();break; case "hinweise": a_hinweise();break; case "aktionen": a_aktionen();break; case "shops": a_shops();break; case "prospekt": a_prospekt();break; case "kontakt": a_kontakt();break; case "impressum": a_impressum();break; case "agb": a_agb();break; case "lieferbed":a_lieferbed();break; default: show_kat (); } $lh=str_replace("[hinweise]","Hinweise",$lh); $lh=str_replace("[aktionen]","Aktionen",$lh); $lh=str_replace("[shops]","Shops",$lh); $lh=str_replace("[prospekte]","Prospekt",$lh); $lh=str_replace("[kontakt]","Kontakt",$lh); $lh=str_replace("[impressum]","Impressum",$lh); $lh=str_replace("[wkurl]","\"Warenkorb\"",$lh); //$lh=str_replace("[agb]","",$lh)a $lh=str_replace("[agb]","\"AGB\"",$lh); $lh=str_replace("[lieferbed]","\"Lieferbedingungen\"",$lh); $lh=str_replace("[home]","Concerto Shop",$lh); echo $lh; ?>