|
ENDHTML
$links3=<<"ENDHTML";
|
ENDHTML
$links2=" | ";
#$loginfeld="";
@kartentypen = ("visa","mastercard","amex","diners");
$name{'visa'} = "Visa";
$name{'mastercard'} = "Euro/Mastercard";
$name{'amex'} = "American Express";
$name{'diners'} = "Diners Club";
@zahlungsweise = ("Vorkasse","Bankeinzug","Kreditkarte","Nachname","auf Rechnung");
$errormainsign="<<<";
&getfarbchema;
&getschriftchema;
&getblockchema;
&getzahlungsdata;
&getfirmendata;
&getdesigndetails;
#$imagealign = "center"; # Ausrichtung der Vorschaubilder
#$imagetopalign = "left"; # Ausrichtung der Vorschaubilder für Topprodukte
#$imagedetailalign = "right"; # Ausrichtung der Detailbilder
if ($in{'action'} eq "login") { require "$pfad/libs/login.pl"; }
if ($in{'action'} eq "delcookie") { &del_cookie; $output="Cookie gelöscht!";}
$ip = $ENV{'REMOTE_ADDR'}; ### IP des Besuchers ermitteln
if ($in{'basket'}) { $ip=$in{'basket'}; }
&check_cookie;
####### Daten registrierter User laden
#if (-e "userdata/$ip\.pl") { &getuserdata; }
print "content-type: text/html\n\n";
### Produktdaten laden
open(FILE,"$adminpfad/data/ordner.dat") or die("Konnte Datei nicht öffnen: data/ordner.dat.\n");
@folders = ;close(FILE);
open(FILE,"$adminpfad/data/artikel.dat") or die("Konnte Datei nicht öffnen: data/artikel.dat.\n");
@links = ;close(FILE);
open(FILE,"$adminpfad/data/versand.dat") or die("Konnte Datei nicht öffnen: data/versand.dat.\n");
@versand = ;close(FILE);
## Logs lesen
$ip =~ s/\./_/ig;
if (-e "$pfad/logs/$ip\.pl") {
open(FILE,"$pfad/logs/$ip\.pl") or die("Konnte Datei nicht öffnen: logs/$ip\.pl.\n");
@logs = ;close(FILE);
}
###############################
##################################################
$start=$in{'start'};
if (!$start) { $start=1;}
$showme=$anzahl;
if (!$showme) { $showme=10;}
$von=int($start);
$bis=int($von+$showme-1);
##################################################
if ($in{'action'} eq "header") { $mode = "javaheader"; &footer; exit; }
if ($in{'action'} eq "footer") { $mode = "javafooter"; &footer; exit; }
&header;
if ($in{'action'} ne "bezahlen" && $url eq $sslurl) {
$output = "ACHTUNG: Sie befinden sich noch im SSL-Modus. Bitte klicken Sie HIER, um diesen zu verlassen...\n";
}
if ($in{'action'} eq "details") { require "$pfad/libs/details.pl"; $content=$output; }
elsif ($in{'action'} eq "order") { require "$pfad/libs/order.pl"; require "$pfad/libs/basket.pl"; $content=$output; &footer; exit;}
elsif ($in{'action'} eq "agb") { require "$pfad/libs/agb.pl"; $content=$output; &footer; exit;}
elsif ($in{'action'} eq "basket") { require "$pfad/libs/basket.pl"; $content=$output; &footer; exit;}
elsif ($in{'action'} eq "reloadbasket") { require "$pfad/libs/reloadbasket.pl"; require "$pfad/libs/basket.pl"; $content=$output; &footer; exit;}
elsif ($in{'action'} eq "bezahlen") { require "$pfad/libspay/order.pl"; $content=$output; &footer; exit;}
elsif ($in{'action'} eq "login") { require "$pfad/libs/login.pl"; $content=$output; }
#elsif ($in{'action'} eq "search") { &produkte; $content=$output; &footer; exit; }
else { require "$pfad/libs/cat.pl"; $content=$output; }
&produkte;
$content .= "$produkte";
&footer;
exit;
###############################
### Produktdaten auslesen
###############################
sub produkte {
opendir (DIR,"$produktbilder"); @dir1 = readdir(DIR); closedir (DIR);
foreach $line1 (@dir1) {
($bild, $typ) = split(/\./, $line1);
$grafik{$bild} = $line1;
}
foreach $line2(@links) {
chomp $line2;
($folder,$position,$artbezeichnung,$artbeschreibung,$artgebinde,$artnr,$arteuro,$artcent,$artmwst,$istop,$isnew,$artstatus,$artopt1,$artopt2,$artopt3) = split(/&&/, $line2);
if ($isnew) {
@zufallsprodukt = (@zufallsprodukt, $artnr);
$newcounter++;
}
## Hier kommen die Bedingungen hin:
if ($folder eq $in{'go'} || $in{'action'} eq "search" && $line2 =~ m/$in{'search'}/) {
$anzahl++;
$pgno++;
$xvon=$von-1;
$xbis=$bis+1;
if ($pgno < $xbis && $pgno > $xvon) {######
$auswahl="";
#######
($opt1,$val1)=split(/\|\|/,$artopt1); $val1 =~ s/\~\~/\n/ig;
($opt2,$val2)=split(/\|\|/,$artopt2); $val2 =~ s/\~\~/\n/ig;
($opt3,$val3)=split(/\|\|/,$artopt3); $val3 =~ s/\~\~/\n/ig;
if ($opt1) {
$auswahl.= "$opt1:
";
}
if ($opt2) {
$auswahl.= "$opt2:
";
}
if ($opt3) {
$auswahl.= "$opt3:
";
}
if ($grafik{$artnr}) {
$mygrafik = $grafik{$artnr};
&grafikformat;
}
else { $image=""; }
$order=<<"ENDHTML";
ENDHTML
$details="$url/index.pl?secure=$in{'secure'}&action=details&artnr=$artnr&cat=$folder";
open(FILE,"$pfad/templates/produkt.pl") or die("Konnte Datei nicht öffnen: templates/produkt.pl.\n");
@template = ;close(FILE);
$template = "@template";
$artpreis="$arteuro\.$artcent EURO";
$template =~ s/%titel%/$artbezeichnung/ig;
$template =~ s/%beschreibung%/$artbeschreibung/ig;
$template =~ s/%image%/$image/ig;
$template =~ s/%preis%/$artpreis/ig;
$template =~ s/%artnr%/$artnr/ig;
$template =~ s/%order%/$order/ig;
$template =~ s/%details%/$details/ig;
$produkte .="$template";
####### Hier enden die Bedingungen
}
}
}
##################################
if ($anzahl) {
$backvon=$von-$showme;
$vorvon=$von+$showme;
if ($bis > $anzahl) { $bis = $anzahl; }
if ($in{'action'} eq "search") { $anzeigetitel = "Suchergebnissen"; } else { $anzeigetitel="Artikeln"; }
$uebersicht .= "$von bis $bis von insgesamt $anzahl $anzeigetitel \n";
if ($xvon>1){
$uebersicht.= "zurück";
}
if ($bis<$anzahl){
$uebersicht.= " - vorwärts";
}
$produkte = "$uebersicht $produkte
$uebersicht ";
}
}
###############################
### Grafik formatieren
####################
sub thumbformat {
$image= $mygrafik;
$maximal = $topartikelbreite; #$imagebreite;
@attr = attr_imgsize("$produktbilder/$mygrafik");
if(!$attr[1]) { $attr[1]=1; }
if(!$attr[3]) { $attr[3]=1; }
if ($attr[1] > $attr[3]) { #### Wenn breiter als hoch
$prozent = $maximal * 100 / $attr[1];
$showbreite = $maximal;
$showhoehe = $attr[3] * $prozent / 100 ;
}
else #### Wenn hoeher als breit
{ $prozent = $maximal * 100 / $attr[3];
$showhoehe = $maximal;
$showbreite = $attr[1] * $prozent / 100 ;
}
if ($prozent < 100) { $imagekonfig = " width=\"$showbreite\" height=\"$showhoehe\""; }
else { $imagekonfig = " width=\"$attr[1]\" hight=\"$attr[3]\""; }
$image = "\n";
}
sub grafikformat {
$image= $mygrafik;
$maximal = $imagebreite; #$imagebreite;
@attr = attr_imgsize("$produktbilder/$mygrafik");
if ($attr[1] > $attr[3]) { #### Wenn breiter als hoch
$prozent = $maximal * 100 / $attr[1];
$showbreite = $maximal;
$showhoehe = $attr[3] * $prozent / 100 ;
}
else #### Wenn hoeher als breit
{ $prozent = $maximal * 100 / $attr[3];
$showhoehe = $maximal;
$showbreite = $attr[1] * $prozent / 100 ;
}
if ($prozent < 100) { $imagekonfig = " width=\"$showbreite\" height=\"$showhoehe\""; }
else { $imagekonfig = " width=\"$attr[1]\" hight=\"$attr[3]\""; }
$image = "\n";
}
sub grafikgrossformat {
$image= $mygrafik;
@attr = attr_imgsize("$produktbilder/$mygrafik");
$imagekonfig = " width=\"$attr[1]\" hight=\"$attr[3]\"";
$image = "\n";
}
##################
sub euroformat {
($summe, $nachkomme) = split(/\./,$summe);
$summe = reverse($summe);
$summe =~ s/(\d\d\d)(?=\d)(?!\d*\,)/$1./g;
$summe = reverse($summe);
if (!$nachkomme){ $nachkomme="00";}
if (length($nachkomme) == 1) { $nachkomme .="0"; }
$summe="$summe\,$nachkomme";
}
###############################
### Design
sub header {
}
sub footer {
####### Artikelhistorie auslesen
@logs = reverse(@logs);
foreach $line(@logs) {
chomp $line;
($lognr, $logtitel, $loggo, $logbeschreibung, $logeuro, $logcent) = split(/&&/,$line);
$historycounter++;
if ($historycounter <= $anzahllinkhistory) {
if ($uselogimage eq "1" && $grafik{$lognr}) {
$tab=$tab1;
$tab =~ s/%size%/$maximal/ig;
$mygrafik = $grafik{$lognr}; &thumbformat; $align=$left;
}
else { $image=""; $align=$left;
$tab=$tab1;
$tab =~ s/%size%/0\%/ig;
}
if ($preview) {
$loglink .= "$preview";
$loglink =~ s/\$link/$url\/index\.pl\?secure\=$in{'secure'}\&action\=details\&artnr\=$lognr\&cat\=$loggo/ig;
$loglink =~ s/\$image/$image/ig;
$loglink =~ s/\$artnr/$lognr/ig;
$loglink =~ s/\$artbezeichnung/$logtitel/ig;
$loglink =~ s/\$artbeschreibung/$logbeschreibung/ig;
$loglink =~ s/\$arteuro/$logeuro/ig;
$loglink =~ s/\$artcent/$logcent/ig;
$loglink =~ s/\$url/$url/ig;
}
else
{
$loglink.=<<"ENDHTML";
ENDHTML
}
$tab=$tab1;
}
}
####### Warenkorb laden
$ip =~ s/\./_/ig;
## tophtml laden
if (-e "$pfad/templates/tophtml.pl") {
open(TOPHTML,"$pfad/templates/tophtml.pl") or die("Konnte Datei nicht öffnen: templates/top.pl.\n");
@tophtml = ;
$tophtml = "@tophtml";
close(TOPHTML);
}
## Warenkorb laden
if (-e "$pfad/baskets/$ip\.pl") {
open(BASKET,"$pfad/baskets/$ip\.pl") or die("Konnte Datei nicht öffnen: baskets/$ip\.pl.\n");
@basket = ;
close(BASKET);
$anzahl="";$summeeuro="";$summecent="";
foreach $artikel(@basket) {
($bmenge,$bartnr,$bartbezeichnung,$barteuro,$bartcent,$bartmwst) = split(/&&/, $artikel);
$anzahl= $anzahl + $bmenge;
$bartcent = $bartcent * $bmenge;
$barteuro = $barteuro * $bmenge;
$summeeuro= $summeeuro + $barteuro;
$summecent= $summecent + $bartcent;
}
$basketsumme = $summeeuro * 100;
$basketsumme = $basketsumme + $summecent;
$basketsumme = $basketsumme / 100;
$summe = $basketsumme; &euroformat; $basketsumme=$summe;
opendir (DIR,"$produktbilder"); @dir1 = readdir(DIR); closedir (DIR);
foreach $line1 (@dir1) {
($bild, $typ) = split(/\./, $line1);
$grafik{$bild} = $line1;
}
if ($grafik{$bartnr}) {
$mygrafik = $grafik{$bartnr};
&thumbformat;
}
else { $image=""; }
if ($summecent) {
if ($boxtemplate) { $basket=$boxtemplate;
$basketcontent="$image Zuletzt in den Warenkorb gelegt: $bmenge x $bartbezeichnungIhr Warenkorb enthält $anzahl Artikel im Gesamtwert von $basketsumme EURO zum Warenkorb / zur Kasse ";
$basket=~ s/%titel%/$warenkorbtitel/ig;
$basket=~ s/%inhalt%/$basketcontent/ig;
}
else
{
$basket=<<"ENDHTML";
ENDHTML
}
}
}
##### Ende Warenkorb laden
##### freie Blöcke laden
open(BOXES,"$pfad/boxes/box.dat") or die("Konnte Datei nicht öffnen: boxes/box.dat.\n");
@boxes = ;
close(BOXES);
$counter ="";
foreach $line(@boxes) {
$counter++;
chomp $line;
($boxtitel, $boxcontent, $blockaktiv, $boxtyp, $boxnossl) = split(/&&/,$line);
if ($boxnossl eq "checked" && $url =~ m/https:\/\//) { $blockaktiv="checked"; }
if(!$blockaktiv) {
if (!$boxtyp) {
if ($boxtemplate) { $box{$counter}=$boxtemplate;
$box{$counter}=~ s/%titel%/$boxtitel/ig;
$box{$counter}=~ s/%inhalt%/$boxcontent/ig;
}
else
{
$box{$counter}=<<"ENDHTML";
ENDHTML
}
}
else {
$box{$counter}=$boxcontent;}
}
}
### ENDE FREIE BLÖCKE
##### Hauptmenü Warengruppen
foreach $line (@folders) {
chomp($line);
($cat_num, $cat_bezeichnung, $cat_beschreibung, $cat_mutter) = split(/&&/,$line);
if (!$cat_mutter) {
$hauptlink.= "$links3$cat_bezeichnung$links2\n";
foreach $line2 (@folders) {
chomp($line2);
($xcat_num, $xcat_bezeichnung, $xcat_beschreibung2, $xcat_mutter) = split(/&&/,$line2);
if ($xcat_mutter eq "$cat_num") {
if ($found ne "ja") { $hauptlink .= "$links1"; }
$hauptlink.= "[$xcat_bezeichnung] \n";
$found="ja";
}
}
if ($found eq "ja") { $hauptlink.="$links2"; $found=""; } else { $found = ""; }
}
}
if ($boxtemplate) { $hauptmenue="$boxtemplate";
$hauptmenue=~ s/%titel%/$warengruppentitel/ig;
$hauptmenue=~ s/%inhalt%/$hauptlink/ig;
}
else
{
$hauptmenue=<<"ENDHTML";
$warengruppentitel |
$hauptlink |
ENDHTML
}
##### Neu im Sortiment und Zufallsprodukt
$zeiger = rand(@zufallsprodukt);
$zeiger = int($zeiger);
while ($xx < $anzahl_zufall) {
$zeiger++;
$xzufallsprodukt = $zufallsprodukt[$zeiger];
@zufallsarray = (@zufallsarray, $xzufallsprodukt);
$xx++;
}
open(MAINDATA,"$adminpfad/data/artikelnummer.dat") or die("Konnte Datei nicht öffnen: data/artikelnummer.dat.\n");
$artikelnummer = ;
close(MAINDATA);
if ($anzahl_neu > 0) {
$counter="";
while ($counter < $anzahl_neu || $shown < $anzahl_neu) {
$neuprodukt = $artikelnummer - $counter;
$counter++;
foreach $line(@links) {
($folder,$position,$artbezeichnung,$artbeschreibung,$artgebinde,$artnr,$arteuro,$artcent,$artmwst,$istop,$isnew,$artstatus,$artopt1,$artopt2,$artopt3) = split(/&&/, $line);
if ($neuprodukt eq $artnr) {
$shown++;
if ($image_neu && $grafik{$artnr}) {
$tab=$tab1;
$tab =~ s/%size%/$maximal/ig;
$mygrafik = $grafik{$artnr}; &thumbformat; $align=$right;
}
else { $image=""; $align=$left;}
$anzeige="$tab$image$tab2 $align$artbezeichnung\n";
if ($neu_beschreibung) { $anzeige.=" $artbeschreibung"; }
if ($neu_preis) { $anzeige.=" $arteuro\.$artcent EURO"; }
$anzeige.="$tab3";
if ($preview) {
$neuimsortiment .= "$preview";
$neuimsortiment =~ s/\$link/$url\/index\.pl\?secure\=$in{'secure'}\&action\=details\&artnr\=$artnr\&cat\=$folder/ig;
$neuimsortiment =~ s/\$image/$image/ig;
$neuimsortiment =~ s/\$artnr/$artnr/ig;
$neuimsortiment =~ s/\$artbezeichnung/$artbezeichnung/ig;
$neuimsortiment =~ s/\$artbeschreibung/$artbeschreibung/ig;
$neuimsortiment =~ s/\$arteuro/$arteuro/ig;
$neuimsortiment =~ s/\$artcent/$artcent/ig;
$neuimsortiment =~ s/\$url/$url/ig;
}
else
{
$neuimsortiment.=<<"ENDHTML";
ENDHTML
$anzeige="";
}
}
foreach $zufall(@zufallsarray) {
if ($zufall eq $artnr) {
if ($shown{$zufall} eq "") {
$shown{$zufall}="hipps";
if ($image_zufall eq "1" && $grafik{$artnr}) {
$mygrafik = $grafik{$artnr}; &thumbformat; $align=$left;
$tab=$tab1;
$tab =~ s/\%size\%/$maximal/ig;
}
else { $image=""; $align=$left;}
$anzeige="$tab$image $tab2 $align $artbezeichnung \n";
if ($zufall_beschreibung) { $anzeige.="$artbeschreibung"; }
if ($zufall_preis) { $anzeige.=" $arteuro\.$artcent EURO"; }
$anzeige.="$tab3";
if ($preview) {
$zufallsprodukt .= "$preview";
$zufallsprodukt =~ s/\$link/$url\/index\.pl\?secure\=$in{'secure'}\&action\=details\&artnr\=$artnr\&cat\=$folder/ig;
$zufallsprodukt =~ s/\$image/$image/ig;
$zufallsprodukt =~ s/\$artnr/$artnr/ig;
$zufallsprodukt =~ s/\$artbezeichnung/$artbezeichnung/ig;
$zufallsprodukt =~ s/\$artbeschreibung/$artbeschreibung/ig;
$zufallsprodukt =~ s/\$arteuro/$arteuro/ig;
$zufallsprodukt =~ s/\$artcent/$artcent/ig;
$zufallsprodukt =~ s/\$url/$url/ig;
}
else
{
$zufallsprodukt.=<<"ENDHTML";
ENDHTML
}
}
}
}
}
}
}
if ($neuimsortiment) {
$neuimsortiment=<<"ENDHTML";
$titel_neu |
$neuimsortiment |
ENDHTML
}
if ($zufallsprodukt) {
$zufallsprodukt=<<"ENDHTML";
$titel_zufall |
$zufallsprodukt |
ENDHTML
}
##### Zuletzt besuchte Artikel
if ($loglink) {
$lastview=<<"ENDHTML";
ENDHTML
}
###############
### Blocke einsetzen:
open(BOXES,"$pfad/boxes/links.box") or die("Konnte Datei nicht öffnen: boxes/links.box.\n");
@boxes = ;
close(BOXES);
foreach $line(@boxes) {
chomp $line;
if ($line eq "warenkorb") { $linksbox .= "$basket "; }
elsif ($line eq "neu") { $linksbox .= "$neuimsortiment "; }
elsif ($line eq "zufall") { $linksbox .= "$zufallsprodukt "; }
elsif ($line eq "warengruppen") { $linksbox .= "$hauptmenue "; }
elsif ($line eq "history") { $linksbox .= "$lastview "; }
else { $linksbox .= "$box{$line} "; }
}
open(BOXES,"$pfad/boxes/rechts.box") or die("Konnte Datei nicht öffnen: boxes/rechts.box.\n");
@boxes = ;
close(BOXES);
foreach $line(@boxes) {
chomp $line;
if ($line eq "warenkorb") { $rechtsbox .= "$basket "; }
elsif ($line eq "neu") { $rechtsbox .= "$neuimsortiment "; }
elsif ($line eq "zufall") { $rechtsbox .= "$zufallsprodukt "; }
elsif ($line eq "warengruppen") { $rechtsbox .= "$hauptmenue "; }
elsif ($line eq "history") { $rechtsbox .= "$lastview "; }
else { $rechtsbox .= "$box{$line} "; }
}
$suchfeld=<<"ENDHTML";
ENDHTML
open(TEMPLATE,"$pfad/templates/index.pl") or die("Konnte Datei nicht öffnen: templates/index.pl.\n");
@template = ;
close(TEMPLATE);
$template = "@template";
$blocksl = "$hauptmenue";
$blocksr = "$lastview";
$template =~ s/\%basket\%/$basket/ig;
$template =~ s/\%url\%/$url/ig;
if (!$mode) { $template =~ s/\%content\%/$content $header3/ig; }
$template =~ s/\%blocksl\%/$linksbox/ig;
$template =~ s/\%blocksr\%/$rechtsbox/ig;
$template =~ s/\%shoptitel\%/$shopname/ig;
$template =~ s/\%toptablewidth\%/$toptablewidth/ig;
$template =~ s/\%tophtml\%/$tophtml/ig;
$template =~ s/\%bestellbutton\%/$bestellbutton/ig;
$template =~ s/\%menueh\%/$menueh/ig;
$template =~ s/\%menuev\%/$menuev/ig;
$template =~ s/\%copyright\%/$firma_copyright/ig;
$template =~ s/%navileiste%/$navileiste/ig;
$template =~ s/%login%/$loginfeld/ig;
$template =~ s/%suchfeld%/$suchfeld/ig;
$template =~ s/\$color10/$color10/ig;
$template =~ s/\$color11/$color11/ig;
$template =~ s/\$color12/$color12/ig;
$template =~ s/\$color13/$color13/ig;
$template =~ s/\$color14/$color14/ig;
$template =~ s/\$color15/$color15/ig;
$template =~ s/\$color16/$color16/ig;
$template =~ s/\$color17/$color17/ig;
$template =~ s/\$color18/$color18/ig;
$template =~ s/\$color19/$color19/ig;
$template =~ s/\$color20/$color20/ig;
$template =~ s/\$color1/$color1/ig;
$template =~ s/\$color2/$color2/ig;
$template =~ s/\$color3/$color3/ig;
$template =~ s/\$color4/$color4/ig;
$template =~ s/\$color5/$color5/ig;
$template =~ s/\$color6/$color6/ig;
$template =~ s/\$color7/$color7/ig;
$template =~ s/\$color8/$color8/ig;
$template =~ s/\$color9/$color9/ig;
$template =~ s/\$textstandart1/$textstandart1/ig;
$template =~ s/\$textstandart2/$textstandart2/ig;
$template =~ s/\$textstandart3/$textstandart3/ig;
$template =~ s/\$textstandart4/$textstandart4/ig;
$template =~ s/\$textstandart5/$textstandart5/ig;
$template =~ s/\$textstandart6/$textstandart6/ig;
$template =~ s/\$textstandart7/$textstandart7/ig;
if ($mode) {
($javaheader, $javafooter) = split (/\%content\%/, $template);
if ($mode eq "javaheader") {
$javaheader =~ s/'//ig;
$javaheader =~ s/\n//ig;
$javaheader =~ s/\r//ig;
# $javaheader =~ s/img src=\"/img src=\"$url\//ig;
$javaheader =~ s/background=\"/background=\"$url\//ig;
# $javaheader =~ s/index.pl/$url\/index.pl/ig;
#$javaheader =~ s/<\/script>/'\+'<\/scr'\+'ipt>'\+'/ig;
print "document.write('$javaheader');";
exit;
}
if ($mode eq "javafooter") {
$javafooter =~ s/'//ig;
$javafooter =~ s/\n//ig;
$javafooter =~ s/\r//ig;
# $javafooter =~ s/index.pl/$url\/index.pl/ig;
#$javafooter =~ s/<\/script>/'\+'<\/scr'\+'ipt>'\+'/ig;
print "document.write('$javafooter');";
exit;
}
}
print "$template"; exit;
}
###############################
### Cookieverwaltung
sub check_cookie {
foreach (split(/; /,$ENV{'HTTP_COOKIE'})) {
($cookie,$value) = split(/=/);
if ($cookie eq "shopip" && $value > 1) { $ip = $value; $setcookie="no"; }
if ($cookie eq "Kundennummer" && $value > 1) { $ip = $value;
}
if ($setcookie ne "no") { &set_cookie; }
}
sub del_cookie {
print "Set-Cookie: domain=$url,$sslurl;shopip=;expires=Mon, 01-Jan-2000 00:00:00 GMT;\n";
}
sub set_cookie {
print "Set-Cookie: domain=$url,$sslurl;shopip=$ip;expires=Mon, 01-Jan-2030 00:00:00 GMT;\n";
}
###########################################################
sub getdesigndetails {
open(COLOR,"$pfad/templates/einstellungen_designdetails.pl") or die("Konnte Datei nicht öffnen: $einstellungen_designdetails.\n");
@farben = ;
close(COLOR);
foreach $farbe(@farben) {
chomp $farbe;
($imagealign,$imagetopalign,$imagedetailalign,$imagebreite,$topartikelbreite,$anzahllinkhistory,$uselogimage,$anzartneben,$showdesc,$topinkat,$topinkatfarbe,$topinkatmargin,$katanzartneben,$katmargin,$historytitel,$warenkorbtitel,$warengruppentitel,$toptablewidth,$topinart,$anzahl_neu,$titel_neu,$image_neu,$size_neu,$anzahl_zufall,$titel_zufall,$image_zufall,$size_zufall,$top_preis,$top_beschreibung,$zufall_preis,$zufall_beschreibung,$neu_preis,$neu_beschreibung,$lastview_preis,$lastview_beschreibung,$topback,$katspacing) = split(/&&/, $farbe);
}
}
sub getfirmendata {
open(COLOR,"$pfad/templates/einstellungen_firma.pl") or die("Konnte Datei nicht öffnen: $einstellungen_firma.\n");
@farben = ;
close(COLOR);
foreach $farbe(@farben) {
chomp $farbe;
($shopname,$firma_name,$firma_zusatz,$firma_strasse,$firma_plz,$firma_ort,$firma_land,$firma_telefon,$firma_telefax,$firma_email_webmaster,$firma_email_kontakt,$firma_email_bestellung,$firma_copyright) = split(/&&/, $farbe);
}
}
sub getzahlungsdata {
open(FILE,"$pfad/templates/einstellungen_zahlungsverkehr.pl") or die("Konnte Datei nicht öffnen: $einstellungen_zahlungsverkehrfile.\n");
@zahlungsverkehr = ;
close(FILE);
foreach $farbe(@zahlungsverkehr) {
chomp $farbe;
($xkontoinhaber,$xbankleitzahl,$xbank,$xkontonummer,$nachnahme,$zahlungsarten,$acards,$mindestbestellwert,$meldung,$bestellbutton,$paymenturl,$paymentid) = split(/&&/, $farbe);
($meuro,$mcent)=split(/\./,$mindestbestellwert);
($neuro,$ncent)=split(/\./,$nachnahme);
}
}
sub getblockchema {
open(COLOR,"$pfad/templates/einstellungen_bloecke.pl") or die("Konnte Datei nicht öffnen: templates/einstellungen_bloecke.pl.\n");
@farben = ;
close(COLOR);
foreach $farbe(@farben) {
chomp $farbe;
($blockcolor1,$blockcolor2,$blockcolor3,$blockcolor4,$blockline,$blockbreite,$blockalign) = split(/&&/, $farbe);
}
}
sub getfarbchema {
open(COLOR,"$pfad/templates/farbchema.pl") or die("Konnte Datei nicht öffnen: templates/farbchema.pl.\n");
@farben = ;
close(COLOR);
foreach $farbe(@farben) {
chomp $farbe;
($color1,$color2,$color3,$color4,$color5,$color6,$color7,$color8,$color9,$color10,$color11,$color12,$color13,$color14,$color15,$color16,$color17,$color18,$color19,$color20) = split(/&&/, $farbe);
}
}
sub getschriftchema {
open(COLOR,"$pfad/templates/einstellungen_schriften.pl") or die("Konnte Datei nicht öffnen: templates/einstellungen_schriften.pl.\n");
@farben = ;
close(COLOR);
foreach $farbe(@farben) {
chomp $farbe;
($textstandart1,$textstandart2,$textstandart3,$textstandart4,$textstandart5,$textstandart6,$textstandart7) = split(/&&/, $farbe);
}
}
sub ReadParse {
local (*in) = @_ if @_;
local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" )
{
$in = $ENV{'QUERY_STRING'};
}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
# split the input
@pairs = split(/&/, $input);
# split the name/value pairs
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
#$value =~ s/<([^>]|\n)*>//g;
$in{$name} = $value;
}
}
else
{
# Added for command line debugging
# Supply name/value form data as a command line argument
# Format: name1=value1\&name2=value2\&...
# (need to escape & for shell)
# Find the first argument that's not a switch (-)
$in = ( grep( !/^-/, @ARGV )) [0];
$in =~ s/\\&/&/g; } @in = split(/&/,$in);
foreach $i (0 .. $#in) {
# Convert plus's to spaces
$in[$i] =~ s/\+/ /g;
# Split into key and value.
($key, $val) = split(/=/,$in[$i],2);
# splits on the first =.
# Convert %XX from hex numbers to alphanumeric
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
# Associate key and value. \0 is the multiple separator
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return length($in);
}
}
|