Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1); // -1 = alle Bits gesetzt, alle Fehler anzeigen
- session_start();
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <title>Pizza da Mamma</title>
- <meta http-equiv="Content-typee" content="text/html; charset=iso-8859-1" />
- <link rel="stylesheet" typee="text/css" href="../css/style.css" />
- </head>
- <body>
- <div id="header">
- <img src="../images/logo/171x37.png" alt="" width="171" height="37" />
- <div class="small">
- <a href="../index.html"><img src="../images/small1.gif" alt="" width="13" height="13" /></a>
- <a href="../html/überuns.html"><img src="../images/small2.gif" alt="" width="16" height="13" /></a>
- <a href="mailto:alex.waelchli@bluewin.ch"><img src="../images/small3.gif" alt="" width="16" height="13" /></a>
- </div>
- </div>
- <div class="menu">
- <img src="../images/lefttop.png" alt="" width="37" height="56" />
- <ul>
- <li><a href="../index.html" ><img src="../images/but1.gif.png" alt="" onmouseover="this.src='../images/but1_hover.gif.png';" onmouseout="this.src='../images/but1.gif.png'" width="109" height="30" /></a></li>
- <li><a href="../html/überuns.html"><img src="../images/but2.gif.png" alt="" onmouseover="this.src='../images/but2_hover.gif.png';" onmouseout="this.src='../images/but2.gif.png'" width="109" height="30" /></a></li>
- <li><a href="../html/sortiment.html"><img src="../images/but3.gif.png" alt="" onmouseover="this.src='../images/but3_hover.gif.png';" onmouseout="this.src='../images/but3.gif.png'" width="109" height="30" /></a></li>
- <li><a href="bestellung.php"><img src="../images/but5_active.png" alt="" onmouseover="this.src='../images/but5_hover.png';" onmouseout="this.src='../images/but5_active.png'" width="109" height="30" /></a></li>
- <li><a href="../html/standort.html"><img src="../images/but4.gif.png" alt="" onmouseover="this.src='../images/but4_hover.gif.png';" onmouseout="this.src='../images/but4.gif.png'" width="108" height="30" /></a></li>
- </ul>
- </div>
- <div id="phpcontent"><br><br>
- <div id="bestellungmenu">
- <?php
- $pizzaa="";
- $pastaa="";
- $spezialitätena="";
- $getränkea="";
- $insalatea="";
- $desserta="";
- if(isset($_GET['anzeige'])){
- if($_GET['anzeige'] =="pizza"){$pizzaa="_active";}
- if($_GET['anzeige'] =="pasta"){$pastaa="_active";}
- if($_GET['anzeige'] =="spezialitäten"){$spezialitätena="_active";}
- if($_GET['anzeige'] =="getränke"){$getränkea="_active";}
- if($_GET['anzeige'] =="insalate"){$insalatea="_active";}
- if($_GET['anzeige'] =="dessert"){$desserta="_active";}
- }else{
- $pizzaa="_active";
- }
- ?>
- <ul>
- <li><a href="?anzeige=pizza" ><img src="../images/butpizza<?php echo $pizzaa;?>.png" alt="" onmouseover="this.src='../images/butpizza_hover.png';" onmouseout="this.src='../images/butpizza<?php echo $pizzaa;?>.png'" width="109" height="30" /></a></li>
- </ul>
- <ul>
- <li><a href="?anzeige=pasta" ><img src="../images/butpasta<?php echo $pastaa;?>.png" alt="" onmouseover="this.src='../images/butpasta_hover.png';" onmouseout="this.src='../images/butpasta<?php echo $pastaa;?>.png'" width="109" height="30" /></a></li>
- </ul>
- <ul>
- <li><a href="?anzeige=spezialitäten" ><img src="../images/butspezialitäten<?php echo $spezialitätena;?>.png" alt="" onmouseover="this.src='../images/butspezialitäten_hover.png';" onmouseout="this.src='../images/butspezialitäten<?php echo $spezialitätena;?>.png'" width="109" height="30" /></a></li>
- </ul>
- <ul>
- <li><a href="?anzeige=getränke" ><img src="../images/butgetränke<?php echo $getränkea;?>.png" alt="" onmouseover="this.src='../images/butgetränke_hover.png';" onmouseout="this.src='../images/butgetränke<?php echo $getränkea;?>.png'" width="109" height="30" /></a></li>
- </ul>
- <ul>
- <li><a href="?anzeige=insalate" ><img src="../images/butinsalate<?php echo $insalatea;?>.png" alt="" onmouseover="this.src='../images/butinsalate_hover.png';" onmouseout="this.src='../images/butinsalate<?php echo $insalatea;?>.png'" width="109" height="30" /></a></li>
- </ul>
- <ul>
- <li><a href="?anzeige=dessert" ><img src="../images/butdessert<?php echo $desserta;?>.png" alt="" onmouseover="this.src='../images/butdessert_hover.png';" onmouseout="this.src='../images/butdessert<?php echo $desserta;?>.png'" width="109" height="30" /></a></li>
- </ul>
- </div>
- <div id="notizen">
- <?
- /*
- karte.txt
- 1;Pizza Margherita;pizza;13.00,25.00;(normal),(gross)
- 2;Pizza Marinara;pizza;16.00,27.00;(normal),(gross)
- 3;Pizza Funghi;pizza;16.00,27.00;(normal),(gross)
- 4;Pizza Prosciutto;pizza;18.00,29.00;(normal),(gross)
- 5;Pizza Prosciutto e funghi;pizza;19.00,30.00;(normal),(gross)
- 6;Pizza Quattro stagioni;pizza;19.00,30.00;(normal),(gross)
- 7;Pizza Tonno;pizza;19.00,30.00;(normal),(gross)
- 8;Pizza Diavola;pizza;19.00,30.00;(normal),(gross)
- 9;Pizza Capricciosa;pizza;19.00,30.00;(normal),(gross)
- 10;Pizza Exotica;pizza;19.00,30.00;(normal),(gross)
- 11;Pizza Carbonara;pizza;19.00,30.00;(normal),(gross)
- 12;Pizza Sfiziosa;pizza;19.00,30.00;(normal),(gross)
- 13;Pizza Parmigiana;pizza;19.00,30.00;(normal),(gross)
- 14;Pizza Quattro formaggi;pizza;19.00,30.00;(normal),(gross)
- 15;Pizza Contandina;pizza;20.00,32.00;(normal),(gross)
- 16;Pizza Deliziosa;pizza;20.00,32.00;(normal),(gross)
- 17;Pizza Europizza;pizza;20.00,32.00;(normal),(gross)
- 18;Pizza Delfino;pizza;21.00,36.00;(normal),(gross)
- 19;Pizza Mare e Monti;pizza;21.00,35.00;(normal),(gross)
- 20;Pizza Carettiera;pizza;21.00,35.00;(normal),(gross)
- 21;Pizza Dinamite;pizza;21.00,35.00;(normal),(gross)
- 22;Pizza Profumo di Bosco;pizza;22.00,35.00;(normal),(gross)
- 23;Pizza Calzone;pizza;19.00;(normal)
- 24;Pizza Calzone farcito;pizza;22.00;(normal)
- 25;Pizza Bella Capri speziale;pizza;35.00;(normal)
- 26;Scaloppine al limone;spezialitäten;30.00;(gross)
- 27;Frittura mista di pesce;spezialitäten;30.00;(gross)
- 28;Verde;insalate;7.00;(normal)
- 29;Mista;insalate;8.00;(normal)
- 30;Songino;insalate;10.00;(normal)
- 31;Rucola;insalate;13.00;(normal)
- 32;Caprese;insalate;11.00;(normal)
- 33;Griechischer Salat (min 300gr);insalate;14.00;(normal)
- 34;Spaghetti alla Mafiosa;pasta;17.00;(normal)
- 35;Spaghetti Carbonara;pasta;18.00;(normal)
- 36;Penne all'arrabiata;pasta;17.00;(normal)
- 37;Penne Wodka;pasta;18.00;(normal)
- 38;Penne Marc e Campagna;pasta;21.00;(normal)
- 39;Canneloni;pasta;18.00;(normal)
- 40;Lasagne;pasta;18.00;(normal)
- 41;Tirami'su;dessert;8.00;(normal)
- 42;Mousse au chocolat;dessert;7.00;(normal)
- 43;Tagesdessert (auf Anfrage);dessert;15.00;(normal)
- 44;Glace-Kugel;dessert;3.00;(normal)
- 45;Schlagrahm;dessert;1.00;(normal)
- 46;Nature;getränke;4.00;(50cl)
- 47;Tafelgetränke;getränke;4.00;(50cl)
- 48;Eistee;getränke;4.00;(50cl)
- 49;Hürlimann Bier;getränke;3.50;(33cl)
- 50;Tuborg Bier;getränke;4.00;(33cl)
- 51;Carlsberg Bier;getränke;4.00;(33cl)
- 52;Clausthaler Bier;getränke;3.50;(33cl)
- 53;Weisswein;getränke;13.00;(50cl)
- 54;Rosewein;getränke;13.00;(50cl)
- 55;Rotwein;getränke;13.00;(50cl)
- etc. */
- $ii="";
- $karte_array = array();
- $zeilen = file ("karte.txt");
- foreach ($zeilen as $zeile) {
- list($id,$name,$gruppe,$preis,$einheit) = explode(";", $zeile);
- $preis_array=explode(",", $preis);
- $preisanzahl=count($preis_array);
- $einheit_array=explode(",", $einheit);
- $karte_array[$id]=$name;
- if((isset($_GET['anzeige']) && $gruppe == $_GET['anzeige']) || (!isset($_GET['anzeige']) && $gruppe == "pizza")){ #if($gruppe==$gruppe){ wenn alle gruppen angezeigt werden sollen
- # in SESSION speichern nach Senden
- if(isset($_POST[$id."_notizen"]) && $_POST[$id."_notizen"]!=""){
- $_SESSION["KORB"][$id."_".time()] = $_POST[$id."_notizen"];
- $_SESSION["KORB_preis"][$id."_".time()] = $_POST[$id."_preis"];
- }
- $outputradio="";
- if($preisanzahl == "1"){
- $outputradio="<input type='radio' name='".$id."_preis' value='".$preis."|".$einheit."'>".$preis." ".$einheit."<br>";
- }else{
- for($i=0; $i < count($preis_array);$i++){
- $outputradio.="<input type='radio' name='".$id."_preis' value='".$preis_array[$i]."|".$einheit_array[$i]."'>".$preis_array[$i]." ".$einheit_array[$i]."<br>";
- }
- }
- $ii++;
- $bgcolor= ($ii % 2 === 0) ? '#ccc':'#ddd';
- echo '<form style="background-color:'.$bgcolor.'" action="#" method="post" name="form">';
- echo "".$id.". ".$name." <br>";
- echo '<input type="text" style="border:1px solid black; width:20px" maxlength="2" name="'.$id.'_notizen" value=""><br>';
- echo $outputradio;
- echo ' <input type="submit" class="formbutton" style="width:180px" value="Anzahl speichern"></form>';
- }
- }
- ?>
- </div>
- <div id="notizen_anzeigen">
- <center><b>DEIN WARENKORB</b><br /></center><br>
- <?php
- # unset($_SESSION["KORB"]); unset($_SESSION["KORB_preis"]);
- $_SESSION["BESTELLUNG"]="";
- if(isset($_SESSION["KORB"])){
- #############################
- # Warenkorb +/-/x verarbeitung
- if(isset($_GET["key"]) && isset($_GET["plus"])){
- $_SESSION["KORB"][$_GET["key"]]=($_SESSION["KORB"][$_GET["key"]]+1);
- }elseif(isset($_GET["key"]) && isset($_GET["minus"])){
- $_SESSION["KORB"][$_GET["key"]]=((float)$_SESSION["KORB"][$_GET["key"]]-1);
- if($_SESSION["KORB"][$_GET["key"]]<"1"){
- unset($_SESSION["KORB"][$_GET["key"]]);
- }
- }elseif(isset($_GET["key"]) && isset($_GET["raus"])){
- unset($_SESSION["KORB"][$_GET["key"]]);
- }
- # Warenkorb +/-/x verarbeitung
- #############################
- echo "<small>";
- # alle Daten aus SESSION Anzeigen
- ksort ($_SESSION["KORB"]);
- ksort ($_SESSION["KORB_preis"]);
- $preisges="";
- foreach($_SESSION["KORB"] as $key => $value){
- list($PREIS,$EINHEIT) = explode("|", $_SESSION['KORB_preis'][$key]);
- $preis =($value*$PREIS);
- echo $karte_array[trim(preg_replace('/_[\d]*$/', ' ', $key))]." ".$EINHEIT.": ".$value." x ".$PREIS." = ".number_format($preis, 2, '.', '');
- $_SESSION["BESTELLUNG"] .= $karte_array[trim(preg_replace('/_[\d]*$/', ' ', $key))]." ".$EINHEIT.": ".$value." x ".$PREIS." = ".number_format($preis, 2, '.', '')."<br>";
- echo "
- <a style='text-decoration:none' href='?key=".$key."&minus'>[-]</a>
- <a style='text-decoration:none' href='?key=".$key."&plus'>[+]</a>
- <a style='text-decoration:none' href='?key=".$key."&raus'>[x]</a>
- <br>";
- $preisges+=$preis;
- }
- echo "<br>";
- echo "<hr />";
- echo "Total: ".number_format($preisges, 2, '.', '')." CHF</small>";
- $_SESSION["BESTELLUNG"] .= "Total: ".number_format($preisges, 2, '.', '')." CHF</small>";
- ####################################################################
- if(isset($_POST['bestellungsenden'])){
- $Name = $_POST['Name'];
- $Vorname = $_POST['Vorname'];
- $Strasse = $_POST['Strasse'];
- $PLZ = $_POST['PLZ'];
- $Ort = $_POST['Ort'];
- $emailkunde=$_POST['emailkunde'];
- $Mail_To = "pizzadamamma.kontakt@bluewin.ch, $emailkunde";
- $Mail_To = "andreazza@gmx.de";
- $Mail_From="From: \"PIZZA LADEN\"<pizzadamamma.kontakt@bluewin.ch>\n";
- $message = "
- <font color='#333333' face='Verdana, Bookman Old Style' size='2'>
- <br><br>Lieber Kunde, die folgende Bestellung haben sie so eben getätigt:<br>
- <br>
- $_SESSION[BESTELLUNG]
- <br><br>
- Kundendaten:<br>
- $Name<br>
- $Vorname<br>
- $Strasse<br>
- $PLZ<br>
- $Ort<br>
- <br><br>
- Vielen Dank für Ihre Bestellung und einen guten Appetit.<br>
- Ihr Pizza da Mamma Team<br>
- </font>
- ";
- $Subject="=?iso-8859-1?Q?".imap_8bit(trim("$betreff"))."?=";
- $email_body="$message";
- $header = "$Mail_From";
- $header .= "Content-Type: text/html; charset=iso-8859-1";
- if(mail($Mail_To,$Subject,$email_body,$header)){
- echo "<br>Ihre Bestellung wurde verschickt.<br>";
- }else{
- echo "<br>Fehler beim Senden.<br>";
- }
- # SESSION löschen Warenkorb
- unset($_SESSION["KORB"]); unset($_SESSION["KORB_preis"]);
- }else{
- echo '<form action="#" method="post" name="bestellungform"><br>';
- echo 'Name:<br><input type="text" style="border:1px solid black; width:160px" name="Name" value=""><br><br>';
- echo 'Vorname:<br><input type="text" style="border:1px solid black; width:160px" name="Vorname" value=""><br><br>';
- echo 'Strasse:<br><input type="text" style="border:1px solid black; width:160px" name="Strasse" value=""><br><br>';
- echo 'PLZ:<br><input type="text" style="border:1px solid black; width:160px" name="PLZ" value=""><br><br>';
- echo 'Ort:<br><input type="text" style="border:1px solid black; width:160px" name="Ort" value=""><br><br>';
- echo 'E-Mail:<br><input type="text" style="border:1px solid black; width:160px" name="emailkunde" value=""><br><br>';
- echo 'Sonstiges:<br><textarea style="border:1px solid black; width:160px; height:100px" name="Sonstiges"></textarea><br><br>';
- echo ' <input type="submit" name="bestellungsenden" class="formbutton" style="width:180px" value="Bestellung Senden"></form>';
- }
- #####################################################################
- }else{
- echo "Dein Warenkorb ist leer<br>";
- }
- ?>
- <br><br><center>
- </div>
- <div id="footer">
- © 2010 Pizza da Mamma. All rights reserved
- </div>
- <map name="Map" id="Map">
- <area shape="rect" coords="110,2,128,63" href="#" />
- </map>
- <map name="Map2" id="Map2">
- <area shape="rect" coords="109,1,126,65" href="#" />
- </map>
- <map name="Map3" id="Map3">
- <area shape="rect" coords="111,2,127,67" href="#" />
- </map>
- <map name="Map4" id="Map4">
- <area shape="rect" coords="112,0,128,64" href="#" />
- </map>
- <pre>
- <?php
- #rint_r($_GET);
- #print_r($_SESSION);
- ?>
- </pre>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement