Ankündigung

Einklappen
Keine Ankündigung bisher.

smartbroker.php - Bitte um Unterstützung

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • smartbroker.php - Bitte um Unterstützung

    Hallo,

    für meinen englischen Shop (SmartStore.biz 3.5) möchte ich die Reihenfolge der Adressdaten anpassen:

    Anrede Vorname Nachname
    Adresszeile 1 (Adresszeile 2)
    Postleitzahl Ort
    Land Bundesland

    sollte gemäß den anglo-amerikanischen Gepflogenheiten so aussehen:

    Anrede Vorname Nachname
    Adresszeile 1 (Adresszeile 2)
    Ort
    Bundesland Postleitzahl
    Land

    Der Code für die erste (anzupassende) Variante sieht so aus:

    $r .= $html? "<tr><td style=\"$fstyle\" colspan=\"2\">" : "n";
    if($cust) $r .= get_value($vals,"MailHeaderCustomer","",$html,2);
    else $r .= get_value($vals,"MailHeaderProvider","",$html,2);
    $r .= get_value($vals,"Ecom_BillTo_Postal_Company","",$h tml,2);
    if(get_value($vals,"BillToDepartment","",$html,0,0 ,0)){
    $r .= get_value($vals,"BillToDepartment","caption",$html ,2)
    . get_value($vals,"BillToDepartment","",$html,2);
    };
    $r .= get_value($vals,"Ecom_BillTo_Postal_Name_Prefix"," value",$html,1,1,1)
    . get_value($vals,"BillToTitle","",$html,1);
    $r .= get_value($vals,"Ecom_BillTo_Postal_Name_First","" ,$html,1)
    . get_value($vals,"Ecom_BillTo_Postal_Name_Middle"," ",$html,1)
    . get_value($vals,"Ecom_BillTo_Postal_Name_Last","", $html,1)
    . get_value($vals,"Ecom_BillTo_Postal_Name_Suffix"," value",$html,0,1,1);
    $r .= $html? "
    " : "\n";
    $r .= get_value($vals,"Ecom_BillTo_Postal_Street_Line1", "",$html,1)
    . get_value($vals,"Ecom_BillTo_Postal_Street_Line2", "",$html,4);
    $r .= $html? "
    " : "\n";
    $r .= get_value($vals,"Ecom_BillTo_Postal_PostalCode","" ,$html,1)
    . get_value($vals,"Ecom_BillTo_Postal_City","",$html ,2)
    . get_value($vals,"Ecom_BillTo_Postal_CountryCode"," caption",$html,1,1,1)
    . get_value($vals,"Ecom_BillTo_Postal_StateProv","", $html,0);
    $r .= $html? "


    </td></tr><tr><td style=\"$fstyle\">" : "\n\n\n";
    $r .= get_value($vals,"MailOrderID","",$html,1)
    . get_value($vals,"OrderID","",$html,1);
    $r .= $html? "</td><td style=\"$fstyle\" align=\"right\">" : "\n";
    $r .= get_value($vals,"MailOrderDate","",$html,1);
    $r .= $html? "</td></tr></table>" : "\n\n";
    $r .= $hrline;

    Wer kann mir dabei helfen?

    Viele Grüße - Michael

    http://www.watchband.biz

  • #2
    Irre ich? Smartstore ist doch reines JS-HTML, was da per Software erstellt wird?

    Wende dich doch am besten an deinen zuständigen Smartstore-Berater. Die sind wirklich freundlich!

    Das ist besser als manuell im Code zu wühlen, der beim nächsten Mal wieder überschrieben wird...
    Aufstrebend, kompetent und [b]werbefrei[/b].
    :arrow: [b][url=http://www.developers-guide.net]www.developers-guide.net[/url][/b]

    Kommentar


    • #3
      Hallo supertramp,

      die 'smartbroker.php', welche obenstehenden Code beinhaltet, wird vom Programm nicht überschrieben. Leider ist sie aber auch nicht editierbar. Eine Supportanfrage wurde natürlich schon gesendet.

      Gruß - Michael

      Kommentar


      • #4
        okay, was hat denn die Supportanfrage ergeben?

        Ich wundere mich darüber, dass Smartstore inzwischen PHP nutzt... Die werben doch damit, dass es auf jedem webspace (da JS) funktioniert..

        Oder irre ich?
        Aufstrebend, kompetent und [b]werbefrei[/b].
        :arrow: [b][url=http://www.developers-guide.net]www.developers-guide.net[/url][/b]

        Kommentar


        • #5
          Bisher nichts SmartStore.biz ist eine recht preisgünstige Software, daher hält man sich bei individuellen Anpassungen etwas zurück.

          Für den Versand der E-Mails (Kontakte, Bestellungen, Newsletter) bietet SmartStore.biz 2 Lösungen:

          1. Die Verwendung des E-Mail-Dienstes der SmartStore AG. Mit Basis-Funktionalität - für diejenigen, deren Web-Server Lösung 2 nicht unterstützt.

          2. Die Einsatz eines eigenen E-Mail-Dienstes. Mit Newsletter-Statistiken und teilweise editierbaren Vorlagen. Hier kommt der smartbroker.php alias smartbroker.asp zum tragen, und es werden entsprechende Anforderungen an den Web-Server gestellt.

          Für die Zukunft - hat man mir am Telefon verraten - ist sogar ein hauseigene Sprache geplant. Genaues weiß ich aber nicht.

          Lange Rede, kurzer Sinn: hilfst Du mir auf die Sprünge?.

          Kommentar


          • #6
            um ehrlich zu sein, ich steige durch den Code nicht durch. Das sind doch nur Variablenzuweisungen...

            da passiert doch nichts wirkliches, oder?
            Aufstrebend, kompetent und [b]werbefrei[/b].
            :arrow: [b][url=http://www.developers-guide.net]www.developers-guide.net[/url][/b]

            Kommentar


            • #7
              Ich wollte das Forum nicht vollspammen, aber bitte:

              <?php
              # ------------------------------------------------------------
              # SmartBroker PHP
              # ------------------------------------------------------------
              # Version: 1.0
              # Date created: 08.10.2003
              # Last modified: 14.06.2004
              # ------------------------------------------------------------
              # (c) 2003-2004 SmartStore AG
              # ------------------------------------------------------------
              # rl

              // parse xml into a structured array
              function parse_xml($str){
              $xmlstr = "<?xml version=\"1.0\"?>" . $str;
              $parser = @xml_parser_create();
              @xml_parser_set_option($parser,XML_OPTION_SKIP_WHI TE,1);
              @xml_parser_set_option($parser,XML_OPTION_CASE_FOL DING,0);
              @xml_parse_into_struct($parser,$xmlstr,$vals);
              @xml_parser_free($parser);
              return $vals;
              }; //end function

              // decrypt ucs
              function decrypt_ucs($num, $r=""){
              $num = hexdec($num[0]);
              if($num<12 $r = chr($num);
              elseif($num<1024) $r = chr(($num>>6)+192)
              . chr(($num&63)+12;
              elseif($num<3276 $r= chr(($num>>12)+224)
              . chr((($num>>6)&63)+12.chr(($num&63)+12;
              elseif($num<2097152) $r = chr(($num>>1+240)
              . chr((($num>>12)&63)+12.chr((($num>>6)&63)+12
              . chr(($num&63)+12;
              return $r;
              }; //end function

              // decrypt text/data string
              function decrypt_text($str){
              $str = str_replace("_", "%", $str);
              $str = str_replace("%X0", "*", $str);
              $str = str_replace("%X1", "+", $str);
              $str = str_replace("%X2", "-", $str);
              $str = str_replace("%X3", ".", $str);
              $str = str_replace("%X4", "/", $str);
              $str = str_replace("%X5", "_", $str);
              $str = str_replace("%X6", "@", $str);
              $str = str_replace("%u20AC", "", $str);
              if(defined("Charset") and Charset == "UTF-8"){
              $str = preg_replace_callback("/%u0([[:alnum:]]{3})/","decrypt_ucs",$str);
              $str = preg_replace_callback("/%([[:alnum:]]{2})/","decrypt_ucs",$str);
              };
              $str = stripslashes($str);
              $str = rawurldecode($str);
              return trim($str);
              }; //end function

              // encrypt text/data string
              function encrypt_text($s, $c=""){
              $k = "leonardo";
              $r=split(" ",microtime());$r=$r[0];$j=strlen($k)<15?strlen($k)*$r:15*$r;for($i=0;$i< strlen(
              $s);$i++){$p=ord(substr($k,($i+$j)%strlen($k),1)); $t=ord(substr($s,$i,1));$m=$p>=$t?5:0;$f=
              dechex(max($p,$t)-min($p,$t));$e=$m+(strlen($f)-1);$c.=$e.$f;};return strtoupper(dechex($j)
              .$c);
              }; //end function

              // get digital signature
              function get_signature($v, $k, $r=""){
              $a=split(";",$k);$d=(get_value($v,"LanguageFKID")! ="de")?3:4;for($i=0;$i<2;$i++){if(
              get_value($v,base64_decode($a[$i]),"current",0,0)){array_splice($a,$d,1);for($j=2;$ j
              <sizeof($a);$j++){$r.=base64_decode($a[$j]);};break;};};return $r;
              }; //end function

              // format string
              function format_string($str, $html, $i){
              $formatstr = Array();
              $formatstr[0] = trim($str);
              $formatstr[1] = $html? $str . "" : $str . " ";
              $formatstr[2] = $html? nl2br($str) . "
              " : $str . "\n";
              $formatstr[3] = $html? "" . $str . "
              " : $str . "\n";
              $formatstr[4] = $html? "(" . $str . ")" : "(" . $str . ")";
              $formatstr[5] = $html? $str . ":" : $str . ": ";
              $formatstr[6] = $i==6? number_format(doubleval($str)*PriFactor, CurrencyPriNumDec, CurrencyPriStrDec, CurrencyPriStrGroup):"";
              $formatstr[7] = $i==7? number_format(doubleval($str)*SecFactor, CurrencySecNumDec, CurrencySecStrDec, CurrencySecStrGroup):"";
              $formatstr[8] = $html? ($str? "X
              ":"--
              ")$str? "X\n":"--\n");
              $formatstr[9] = stristr($str,":")? $str . " " : $str . ": ";
              $formatstr[10] = $html? "
              " . $formatstr[9] : "\n" . $formatstr[9];
              return $formatstr[$i];
              }; //end function

              // get values
              function get_value($arr, $kid, $key="", $html=0, $fmt=0, $dct=1, $x=0, $s=0, $e=0, $r=""){
              if(!$e) $e = sizeof($arr);
              for($i=$s;$i<$e;$i++){
              if(isset($arr[$i]["attributes"])){
              for($j=0;$j<sizeof($arr[$i]["attributes"]);$j++){
              if(key($arr[$i]["attributes"]) == $kid){
              $r = current($arr[$i]["attributes"]);
              break;
              }
              elseif(current($arr[$i]["attributes"]) == $kid){
              if($key == "") $r = @$arr[$i+$x]["value"];
              elseif($key == "current") $r = current($arr[$i]["attributes"]);
              else $r= @$arr[$i+$x]["attributes"][$key];
              break;
              }
              else next($arr[$i]["attributes"]);
              };
              };
              if($r) break;
              };
              $r = $dct? decrypt_text($r) : $r;
              $r = $r!=""? format_string($r,$html,$fmt) : "";
              return $r;
              }; //end function

              // get variants and attributes
              function get_options($arr, $i, $html, $cap, $val, $r=""){
              for($j=$i+1;$j<sizeof($arr);$j++){
              if($arr[$j]["tag"] == "OrderBody") break;
              else{
              if(get_value($arr,$cap,"",$html,0,0,0,$j,$j+1)){
              $r .= get_value($arr,$cap,"",$html,9,1,0,$j,$j+1);
              $r .= get_value($arr,$val,"",$html,0,1,0,$j,$j+1);
              $r .= $html? "
              " : "\n";
              };
              };
              };
              return $r;
              }; //end function

              // format totals string
              function format_totals($arr, $html, $obody, $sum, $sym, $net, $tax, $gros, $showtaxdetails, $showtax, $r=""){
              $cspan = ($showtaxdetails or $showtax)? "4" : "5";
              if(!$showtaxdetails and $showtax) $cspan = "6";
              $r .= $html? "<tr align=\"right\"><td style=\"$obody\" colspan=\"$cspan\">" : "\n";
              $r .= get_value($arr,$sum,"",$html,1) . $sym;
              $r .= $html? "</td>" : "";
              if($showtaxdetails){
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($arr,"MailLblNetSum","",0,9);
              $r .= get_value($arr,$net,"",$html,6);
              $r .= $html? "</td><td style=\"$obody\">" : " | " . get_value($arr,"MailLblVATSum","",0,9);
              $r .= $tax;
              $r .= $html? "</td>" : "";
              };
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($arr,"MailLblGrossSum","",0,9);
              $r .= get_value($arr,$gros,"",$html,6);
              $r .= $html? "</td></tr>" : "";
              return $r;
              }; //end function

              // get user defined form controls
              function get_userdef($arr, $html, $scope="BillTo", $r=""){
              for($i=1;$i<sizeof($arr);$i++){
              if($arr[$i]["tag"]=="UserDefCtrls" and ($arr[$i]["type"]=="complete" or $arr[$i]["type"]=="close")) break;
              else{
              if(@$arr[$i]["attributes"]["scope"] == $scope){
              $r .= @format_string(decrypt_text($arr[$i]["attributes"]["caption"]),$html,9);
              if(@$arr[$i]["tag"] == "CHKControl"){
              $r .= @format_string($arr[$i]["attributes"]["checked"],$html,;
              }
              elseif(@$arr[$i]["tag"] == "SELControl"){
              for($j=$i+1;$j<sizeof($arr);$j++){
              if($arr[$j]["tag"] != "option") break;
              else{
              $r .= $j!=$i+1? ($html? ",":", "):"";
              $r .= @decrypt_text($arr[$j]["attributes"]["value"]);
              };
              };
              $r .= $html? "
              " : "\n";
              }
              elseif(@$arr[$i]["tag"] == "RADControl"){
              $r .= @format_string(decrypt_text($arr[$i]["attributes"]["selValue"]),$html,2);
              }
              else $r .= @format_string(decrypt_text($arr[$i]["value"]),$html,2);
              };
              };
              continue;
              };
              if($r) $r = $html? "

              ".$r : "\n\n".$r;
              return $r;
              }; //end function

              // get product count
              function get_prdcount($arr){
              $result = "";
              for($i=0;$i<sizeof($arr);$i++){
              if(isset($arr[$i]["attributes"]["LinePos"])){
              $result .= $i . ";";
              continue;
              };
              };
              return $result;
              }; //end function

              // shortening string
              function str_short($str,$length){
              $result = substr_replace($str, "X",$length);
              for($i=$length+1;$i<strlen($str);$i++){
              $result .= "X";
              };
              return $result;
              }; //end function

              // leading zero for one-digit num
              function zerofill($num){
              $num = strval($num);
              $result = strlen($num)<2? "0".$num : $num;
              return $result;
              }; //end function

              // fill orderdate with missing zeros
              function datefill($datestr){
              $datearr = split(" ", $datestr[2]);
              $datepart = split("\.", $datearr[0]);
              $timepart = split("\:", $datearr[1]);
              $result = zerofill($datepart[0]) . "."
              . zerofill($datepart[1]) . "."
              . $datepart[2] . " "
              . zerofill($timepart[0]) . ":"
              . zerofill($timepart[1]) . ":"
              . zerofill($timepart[2]);
              return "MailOrderDate=\"" . $result . "\"";
              }; //end function

              // get and format ordermail contents
              function get_mailbody($vals, $html=0, $cust=0, $save=0, $r=""){
              $CurrPriSym = get_value($vals,"CurrencyPriSymbol");
              $CurrSecSym = get_value($vals,"CurrencySecSymbol");
              $DisplayGross = get_value($vals,"PriceDisplayGross");
              $PrdSinglePrice = $DisplayGross?"PriceGrossSingleUnitLC":"PriceNetSi ngleUnitLC";
              $PrdTotalPrice = $DisplayGross?"PriceGrossLineTotalLC":"PriceNetLin eTotalLC";
              $TotalNetLC = get_value($vals,"ShippingNetLC")+get_value($vals," PaymentNetLC")+get_value($vals,"TotalPriceNetLC");
              $TotalGrossLC = get_value($vals,"ShippingGrossLC")+get_value($vals ,"PaymentGrossLC")+get_value($vals,"TotalPriceGros sLC");
              $LinesPreDiscountSumTax = format_string(get_value($vals,"LinesTotalGrossLC")-get_value($vals,"LinesTotalNetLC"),0,6);
              $GlobalDiscountTax = format_string(get_value($vals,"GlobalDiscountAmoun tGross")-get_value($vals,"GlobalDiscountAmountNet"),0,6);
              $LinesSumTax = format_string(get_value($vals,"TotalPriceGrossLC")-get_value($vals,"TotalPriceNetLC"),0,6);
              $FreightChargeTax = format_string(get_value($vals,"ShippingGrossLC")-get_value($vals,"ShippingNetLC"),0,6);
              $PaymentChargeTax = format_string(get_value($vals,"PaymentGrossLC")-get_value($vals,"PaymentNetLC"),0,6);
              $LinesTotalTax = $TotalGrossLC-$TotalNetLC;
              $prindex = split(";",get_prdcount($vals));
              $showtaxdetails = 0;
              $showtax = 1;
              $mcspan = ($showtaxdetails or $showtax)? "4" : "5";
              if(!$showtaxdetails and $showtax) $mcspan = "6";
              $paytype = get_value($vals,"PaymentMethodType");
              if($save) $r .= "<?php require(\"login.php\"); ?>\n";
              if($html){
              $fstyle = "font-family:verdana;font-size:12px;";
              $oheader = $fstyle . "font-weight:bold;";
              $key = "M1FfM0RfM0Q=;a25WTFBqaThINGNpRUhPbE1oaXpqZXRwdV9Y NGMweUVFZERnY2xuU3EydWNkX1g0ZURJXzNE;PGJyPjxicj48Y nI+PGRpdiBhbGlnbj0iY2"
              . "VudGVyIiBzdHlsZT0iZm9udC1mYW1pbHk6dmVyZGFuYTtmb25 0LXNpemU6N3B0O2xpbmUtaGVpZ2h0OjEwcHg7Ij48aHIgd2lkd Gg9IjIwMCIgc2l6ZT0iMSIgY"
              . "29sb3I9IiMzMzY2OTkiIG5vc2hhZGUvPjxhIHN0eWxlPSJ0ZX h0LWRlY29yYXRpb246bm9uZTtjb2xvcjojMzM2Njk5OyIgaHJl Zj0iaHR0cDovL3d3dy5zbWFy"
              . "dHN0b3Jl;LmRlIj48c3Ryb25nIHN0eWxlPSJmb250LXNpemU6 OHB0O2xldHRlci1zcGFjaW5nOjE7Ij5Qb3dlcmVkIGJ5IFNtYX J0U3RvcmU8L3N0cm9uZz48Yn"
              . "I+RGVyIHNjaG5lbGxlIHVuZCBlaW5mYWNoZSBXZWc8YnIvPnp 1bSBlcmZvbGdyZWljaGVuIFdlYlN0b3JlIQ==;LmNvbSI+PHN0 cm9uZyBzdHlsZT0iZm9udC1z"
              . "aXplOjhwdDtsZXR0ZXItc3BhY2luZzoxOyI+UG93ZXJlZCBie SBTbWFydFN0b3JlPC9zdHJvbmc+PGJyLz5UaGUgcXVpY2sgYW5 kIGVhc3kgd2F5IHRvIGJ1aWx"
              . "kPGJyLz5hIHN1Y2Nlc3NmdWwgV2ViU3RvcmUh;PC9hPjwvZGl 2Pg==";
              $sig = get_signature($vals,$key);
              $obody = $fstyle ."background:#FFFFFF;";
              $hrline = "<hr size=\"1\" noshade style=\"color:#5E716B\">";
              $r .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>" . get_value($vals,"MailOrderID","",0,1)
              . get_value($vals,"OrderID") . "</title><meta http-equiv=\"content-type\" content=\"text/html;charset=" . Charset . "\"></head>"
              . "<body><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" "
              . "width=\"640\"><tr valign=\"top\"><td><table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"640\">";
              }
              else{
              $hrline = "-------------------------------------------------------------------------------------------------------------------\n";
              $obody = "";
              };
              $r .= $html? "<tr><td style=\"$fstyle\" colspan=\"2\">" : "n";
              if($cust) $r .= get_value($vals,"MailHeaderCustomer","",$html,2);
              else $r .= get_value($vals,"MailHeaderProvider","",$html,2);
              $r .= get_value($vals,"Ecom_BillTo_Postal_Company","",$h tml,2);
              if(get_value($vals,"BillToDepartment","",$html,0,0 ,0)){
              $r .= get_value($vals,"BillToDepartment","caption",$html ,2)
              . get_value($vals,"BillToDepartment","",$html,2);
              };
              $r .= get_value($vals,"Ecom_BillTo_Postal_Name_Prefix"," value",$html,1,1,1)
              . get_value($vals,"BillToTitle","",$html,1);
              $r .= get_value($vals,"Ecom_BillTo_Postal_Name_First","" ,$html,1)
              . get_value($vals,"Ecom_BillTo_Postal_Name_Middle"," ",$html,1)
              . get_value($vals,"Ecom_BillTo_Postal_Name_Last","", $html,1)
              . get_value($vals,"Ecom_BillTo_Postal_Name_Suffix"," value",$html,0,1,1);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Ecom_BillTo_Postal_Street_Line1", "",$html,1)
              . get_value($vals,"Ecom_BillTo_Postal_Street_Line2", "",$html,4);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Ecom_BillTo_Postal_PostalCode","" ,$html,1)
              . get_value($vals,"Ecom_BillTo_Postal_City","",$html ,2)
              . get_value($vals,"Ecom_BillTo_Postal_CountryCode"," caption",$html,1,1,1)
              . get_value($vals,"Ecom_BillTo_Postal_StateProv","", $html,0);
              $r .= $html? "


              </td></tr><tr><td style=\"$fstyle\">" : "\n\n\n";
              $r .= get_value($vals,"MailOrderID","",$html,1)
              . get_value($vals,"OrderID","",$html,1);
              $r .= $html? "</td><td style=\"$fstyle\" align=\"right\">" : "\n";
              $r .= get_value($vals,"MailOrderDate","",$html,1);
              $r .= $html? "</td></tr></table>" : "\n\n";
              $r .= $hrline;
              if($html){
              $r .= "<table align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">"
              . "<tr align=\"center\">"
              . "<td style=\"$oheader\" width=\"15%\" nowrap>";
              };
              $mw = $showtaxdetails or $showtax? "36" : "46";
              $r .= get_value($vals,"MailItemID","",$html,0);
              $r .= $html? "</td><td style=\"$oheader\" width=\"$mw%\" nowrap>" : "";
              $r .= $html? get_value($vals,"MailItemDesc","",$html,0) : "";
              $r .= $html? "</td><td style=\"$oheader\" nowrap colspan=\"2\">" : " | ";
              $r .= get_value($vals,"MailItemAmount","",$html,0);
              $r .= $html? "</td>" : "";
              if($showtaxdetails or $showtax){
              $r .= $html? "<td style=\"$oheader\" width=\"11%\">" : " | ";
              $r .= get_value($vals,"MailItemVAT","",$html,0);
              $r .= $html? "</td>" : "";
              };
              $r .= $html? "<td style=\"$oheader\" width=\"11%\">" : " | ";
              $r .= get_value($vals,"MailItemSinglePrice","",$html,0);
              $r .= $html? "</td><td style=\"$oheader\" width=\"11%\">" : " | ";
              $r .= get_value($vals,"MailItemTotalPrice","",$html,0);
              $r .= $html? "</td></tr>" : "\n" . $hrline;
              for($i=0;$i<sizeof($prindex)-1;$i++){
              $r .= $html? "<tr valign=\"top\"><td style=\"$obody\" nowrap>" : "";
              $r .= get_value($vals,"ProductNo","",$html,0,0,0,$prinde x[$i],$prindex[$i]+1);
              $r .= $html? "</td><td style=\"$obody\">" : "\n";
              $r .= get_value($vals,"Name","",$html,2,0,0,$prindex[$i],$prindex[$i]+1)
              . get_value($vals,"Description","",$html,2,0,0,$prin dex[$i],$prindex[$i]+1)
              . get_options($vals,$prindex[$i],$html,"VariantName","VariantValue")
              . get_options($vals,$prindex[$i],$html,"caption","value");
              $r .= $html? "</td><td style=\"$obody\" width=\"5%\" nowrap align=\"right\">" : " | ";
              $r .= get_value($vals,"QuantityAmount","",$html,0,0,0,$p rindex[$i],$prindex[$i]+1);
              $r .= $html? "</td><td style=\"$obody\" width=\"5%\" nowrap>" : " ";
              $r .= get_value($vals,"QuantityUnit","",$html,1,1,0,$pri ndex[$i],$prindex[$i]+1);
              $r .= $html? "</td>" : "";
              if($showtaxdetails or $showtax){
              $r .= $html? "<td style=\"$obody\" align=\"center\">" : " | ";
              $r .= get_value($vals,"TaxRate","",$html,1,0,0,$prindex[$i],$prindex[$i]+1);
              $r .= $html? "</td>" : "";
              }
              $r .= $html? "<td style=\"$obody\" align=\"right\">" : " | ";
              $r .= get_value($vals,$PrdSinglePrice,"",$html,6,0,0,$pr index[$i],$prindex[$i]+1);
              $r .= $html? "</td><td style=\"$obody\" align=\"right\">" : " | ";
              $r .= get_value($vals,$PrdTotalPrice,"",$html,6,0,0,$pri ndex[$i],$prindex[$i]+1);
              $r .= $html? "</td></tr>" : "\n" . $hrline;
              };
              if($html){
              if($showtaxdetails){
              $r .= "<tr align=\"center\"><td style=\"$oheader\" colspan=\"" . $mcspan . "\"></td><td style=\"$oheader\">";
              $r .= get_value($vals,"MailLblNetSum","",$html,0). "</td><td style=\"$oheader\">"
              . get_value($vals,"MailLblVATSum","",$html,0) ."</td><td style=\"$oheader\">"
              .get_value($vals,"MailLblGrossSum","",$html,0);
              $r .= "</td></tr>";
              }
              };
              if(get_value($vals,"GlobalDiscountRate")>-1){
              $r .= format_totals($vals,$html,$obody,"MailLinesSum",$C urrPriSym,"LinesTotalNetLC",
              $LinesPreDiscountSumTax,"LinesTotalGrossLC", $showtaxdetails, $showtax);
              $r .= format_totals($vals,$html,$obody,"MailGlobalDiscou nt",$CurrPriSym,"GlobalDiscountAmountNet",
              $GlobalDiscountTax,"GlobalDiscountAmountGross", $showtaxdetails, $showtax);
              };
              $r .= format_totals($vals,$html,$obody,"MailLinesSum",$C urrPriSym,"TotalPriceNetLC",
              $LinesSumTax,"TotalPriceGrossLC", $showtaxdetails, $showtax);
              if(get_value($vals,"ShippingNetLC")>0) $r .= format_totals($vals,$html,$obody,"MailFreightCharg e",$CurrPriSym,"ShippingNetLC",
              $FreightChargeTax,"ShippingGrossLC", $showtaxdetails, $showtax);
              if(get_value($vals,"PaymentNetLC")<0 or get_value($vals,"PaymentNetLC")>0)$r .= format_totals($vals,$html,$obody,"MailPaymentCharg e",$CurrPriSym,"PaymentNetLC",
              $PaymentChargeTax,"PaymentGrossLC", $showtaxdetails, $showtax);
              if(!$showtaxdetails and $showtax){
              $r .= $html? "<tr align=\"right\"><td style=\"$obody\" colspan=\"" . $mcspan . "\">" : "\n";
              $r .= get_value($vals,"MailLblVATSum","",$html,1) . $CurrPriSym;
              $r .= $html? "</td>" : "";
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($vals,"MailLblGrossSum","",0,9);
              //if(get_value($vals,"PriceDisplayGross")=="0") $r .= "+ ";
              $r .= format_string($LinesTotalTax,0,6);
              $r .= $html? "</td></tr>" : "";
              };
              $r .= $html? "<tr align=\"right\"><td style=\"$obody\" colspan=\"" . $mcspan . "\">" : "\n";
              $r .= get_value($vals,"MailLinesTotal","",$html,1) . $CurrPriSym;
              $r .= $html? "
              </td>" : "";
              if($showtaxdetails){
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($vals,"MailLblNetSum","",0,9);
              $r .= format_string($TotalNetLC,0,6);
              $r .= $html? "
              </td><td style=\"$obody\">" : " | " . get_value($vals,"MailLblVATSum","",0,9);
              $r .= format_string($LinesTotalTax,0,6);
              $r .= $html? "
              </td>" : "";
              };
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($vals,"MailLblGrossSum","",0,9);
              $r .= format_string($TotalGrossLC,0,6);
              $r .= $html? "
              </td></tr>" : "";
              if(get_value($vals,"IsSCAvailable")){
              $r .= $html? "<tr align=\"right\"><td style=\"$obody\" colspan=\"" . $mcspan . "\">" : "\n";
              $r .= get_value($vals,"MailSECLinesTotal","",$html,1) . $CurrSecSym;
              $r .= $html? "</td>" : "";
              if($showtaxdetails){
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($vals,"MailLblNetSum","",0,9);
              $r .= format_string($TotalNetLC,0,7);
              $r .= $html? "</td><td style=\"$obody\">" : " | " . get_value($vals,"MailLblVATSum","",0,9);
              $r .= format_string($LinesTotalTax,0,7);
              $r .= $html? "</td>" : "";
              };
              $r .= $html? "<td style=\"$obody\">" : " | " . get_value($vals,"MailLblGrossSum","",0,9);
              $r .= format_string($TotalGrossLC,0,7);
              $r .= $html? "</td></tr>" : "";
              };
              $r .= $html? "</table>" : "\n";
              $r .= $html? "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" "
              . "width=\"100%\"><tr><td style=\"$fstyle\">" : $hrline;
              if($showtaxdetails or $showtax){
              $r .= get_value($vals,"BillToTaxRegion","caption",$html, 1)
              . get_value($vals,"BillToTaxRegion","caption",$html, 2,1,1);
              $r .= $hrline;
              };
              $r .= get_value($vals,"MailLblPaymentMethod","",$html,1)
              . get_value($vals,"PaymentMethodName","",$html,3);
              if($paytype == "creditcard"){
              $r .= get_value($vals,"MailLblCCType","",$html,5)
              . get_value($vals,"PaymentCCType","",$html,2)
              . get_value($vals,"MailLblCCName","",$html,5)
              . get_value($vals,"PaymentCCNameOnCard","",$html,2)
              . get_value($vals,"MailLblCCNumber","",$html,5);
              if($cust) $r.= format_string(str_short(get_value($vals,"PaymentCC Number","",$html,0),4),$html,2);
              else $r .= get_value($vals,"PaymentCCNumber","",$html,2);
              $r .= get_value($vals,"MailLblCCDueTo","",$html,5)
              . get_value($vals,"PaymentCCValidUntilMonth","",$htm l,0) . "/"
              . get_value($vals,"PaymentCCValidUntilYear","",$html ,2)
              . get_value($vals,"MailLblCCChecksum","",$html,5)
              . get_value($vals,"PaymentCCChecksum","",$html,2);
              }
              elseif($paytype == "phone"){
              $r .= get_value($vals,"Ecom_BillTo_Telecom_Phone_Number" ,"caption",$html,5)
              . get_value($vals,"PaymentMethodComment","",$html,2) ;
              }
              elseif($paytype == "debit"){
              $r .= get_value($vals,"MailLblDebitBankName","",$html,5)
              . get_value($vals,"PaymentBankName","",$html,2)
              . get_value($vals,"MailLblDebitBankCode","",$html,5)
              . get_value($vals,"PaymentBankCode","",$html,2)
              . get_value($vals,"MailLblDebitAccountCode","",$html ,5);
              if($cust) $r.= format_string(str_short(get_value($vals,"PaymentAc countNumber","",$html,0),4),$html,2);
              else $r .= get_value($vals,"PaymentAccountNumber","",$html,2) ;
              $r .= get_value($vals,"MailLblDebitAccountOwner","",$htm l,5)
              . get_value($vals,"PaymentAccountName","",$html,2);
              }
              elseif($paytype == "saferpay"){
              $r .= get_value($vals,"MailLblPaymentInfo","",$html,5)
              . get_value($vals,"PaymentMethodTransID","",$html,2) ;
              }
              else $r .= get_value($vals,"PaymentMethodDesc","",$html,2);
              $r .= $hrline;
              $r .= get_value($vals,"SendEmailConfirmation","caption", $html,9)
              . get_value($vals,"SendEmailConfirmation","checked", $html,;
              if($html){
              $r .= "<a href=\""
              . get_value($vals,"siteDirectory",0,0,0) . "discl."
              . get_value($vals,"fileExtension",0,0,0) . "\">";
              };
              $r .= get_value($vals,"AgreedToTerms","caption",$html,0) ;
              $r .= $html? "</a>:" : ": ";
              $r .= get_value($vals,"AgreedToTerms","checked",$html, . $hrline;
              if(get_value($vals,"Subscribe2Newsletter","caption ",0)){
              $r .= get_value($vals,"Subscribe2Newsletter","caption",$ html,9)
              . get_value($vals,"Subscribe2Newsletter","checked",$ html,
              . $hrline;
              };
              $r .= get_value($vals,"Ecom_BillTo_Online_Email","captio n",$html,9)
              . get_value($vals,"Ecom_BillTo_Online_Email","",$htm l,0)
              . get_value($vals,"Ecom_BillTo_Telecom_Phone_Number" ,"caption",$html,10)
              . get_value($vals,"Ecom_BillTo_Telecom_Phone_Number" ,"",$html,0);
              if(get_value($vals,"BillToFaxLocal","",$html,0)){
              $r .= get_value($vals,"BillToFaxLocal","caption",$html,1 0)
              . get_value($vals,"BillToFaxLocal","",$html,0);
              };
              if(get_value($vals,"BillToMobileLocal","",$html,0) ){
              $r .= get_value($vals,"BillToMobileLocal","caption",$htm l,10)
              . get_value($vals,"BillToMobileLocal","",$html,0);
              };
              if(get_value($vals,"VATRegistrationNumber","",$htm l,0)){
              $r .= get_value($vals,"VATRegistrationNumber","caption", $html,10)
              . get_value($vals,"VATRegistrationNumber","",$html,0 );
              };
              $r .= get_userdef($vals,$html);
              if(get_value($vals,"Message","",0,0,0)){
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Message","caption",$html,9);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Message","",$html,2,1);
              };
              $r .= $hrline;
              if(get_value($vals,"ShipToDiffers","checked")){
              $r .= get_value($vals,"MailLblShipTo","",$html,3)
              . get_value($vals,"Ecom_ShipTo_Postal_Company","",$h tml,2)
              . get_value($vals,"ShipToDepartment","caption",$html ,2)
              . get_value($vals,"ShipToDepartment","",$html,2)
              . get_value($vals,"Ecom_ShipTo_Postal_Name_Prefix"," value",$html,1,1,1)
              . get_value($vals,"ShipToTitle","",$html,1);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Ecom_ShipTo_Postal_Name_First","" ,$html,1)
              . get_value($vals,"Ecom_ShipTo_Postal_Name_Middle"," ",$html,1)
              . get_value($vals,"Ecom_ShipTo_Postal_Name_Last","", $html,1)
              . get_value($vals,"Ecom_ShipTo_Postal_Name_Suffix"," value",$html,0,1,1);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Ecom_ShipTo_Postal_Street_Line1", "",$html,1)
              . get_value($vals,"Ecom_ShipTo_Postal_Street_Line2", "",$html,4);
              $r .= $html? "
              " : "\n";
              $r .= get_value($vals,"Ecom_ShipTo_Postal_PostalCode","" ,$html,1)
              . get_value($vals,"Ecom_ShipTo_Postal_City","",$html ,2)
              . get_value($vals,"Ecom_ShipTo_Postal_CountryCode"," caption",$html,1,1,1)
              . get_value($vals,"Ecom_ShipTo_Postal_StateProv","", $html,0);
              $r .= $html? "

              " : "\n\n";
              $r .= get_value($vals,"Ecom_ShipTo_Online_Email","captio n",$html,9)
              . get_value($vals,"Ecom_ShipTo_Online_Email","",$htm l,2)
              . get_value($vals,"Ecom_ShipTo_Telecom_Phone_Number" ,"caption",$html,9)
              . get_value($vals,"Ecom_ShipTo_Telecom_Phone_Number" ,"",$html,2)
              . get_userdef($vals,$html,"ShipTo");
              $r .= $html? $hrline : "\n" . $hrline;
              };
              if($cust) $r .= get_value($vals,"MailFooterCustomer","",$html,2);
              else $r .= get_value($vals,"MailFooterProvider","",$html,2);
              if($html) $r .= "</td></tr></table></tr></table>$sig
              "
              . "</body></html>";
              return $r;
              }; //end function get_mailbody

              // separate html and encrypted recipients
              function separate_mailaddresses($str,$html=0){
              $result = "";
              $addarray = split(";",$str);
              for($i=0;$i<sizeof($addarray);$i++){
              $tmparr = split(":",$addarray[$i]);
              if($html){
              if($tmparr[0] == "html"){
              $result .= trim($tmparr[1]) . ";";
              };
              }
              else{
              if($tmparr[0] != "html"){
              $result .= trim($tmparr[0]) . ";";
              };
              };
              };
              return $result;
              }; //end function

              // split email address
              function split_mailaddress($str,$all=0,$r=""){
              $arr = split(";",$str);
              if($all){
              for($i=1;$i<sizeof($arr);$i++){
              if(trim($arr[$i]) != ""){
              $r .= trim($arr[$i]);
              if($i<(sizeof($arr)-1) and $arr[$i+1] != "") $r .= ",";
              };
              };
              }
              else{
              $r = $arr[0];
              };
              return $r;
              }; //end function

              // save order
              function save_order($mfile, $fdat){
              $mdir = "orderbackup";
              if(!is_dir($mdir)){
              @mkdir($mdir, 0755);
              };
              $fopn = @fopen($mdir."/".$mfile.".php","a");
              @fwrite($fopn, $fdat);
              @fclose($fopn);
              }; //end function

              // create an unique identifier
              function get_uniqid(){
              $result = md5(uniqid(rand()));
              $result = "{".strtoupper($result)."}";
              return $result;
              }; //end function

              // get useragent
              function get_useragent(){
              global $HTTP_USER_AGENT;
              $result = "";
              if(isset($HTTP_USER_AGENT)){
              $result = @str_replace(" ", "+", $HTTP_USER_AGENT);
              $result = @str_replace(";", "{SC}", $result);
              };
              return $result;
              }; //end function

              // save stats
              function save_stats($logstr){
              $logdir = "smologs";
              $tmpnam = "smo-templog.txt";
              $maxsize = 512000; // 500KB
              if(!is_dir($logdir)) @mkdir($logdir, 0700);

              $diropn = opendir($logdir);
              while($logfile = readdir($diropn)){
              if(($logfile != "." and $logfile != "..") and strrchr($logfile, ".") == ".log"){
              if(filesize($logdir."/".$logfile) < $maxsize){
              $mfile = $logfile;
              break;
              };
              };
              };
              closedir($diropn);

              if(!isset($mfile)){
              $mfile = "smo-" . date("YmdHis") . ".log";
              $logstr = "PKID;DateTime;ActionID;ActionParam;TargetURL;Emai l;"
              . "NewsletterID;ProcessID;UserAgent\n" . $logstr;
              };
              if(is_dir($logdir)){
              $fopn = @fopen($logdir."/".$mfile,"a");
              if($fopn){
              if(file_exists($logdir."/".$tmpnam)){
              $topn = @fopen($logdir."/".$tmpnam,"r");
              $tval = @fread($topn, filesize($logdir."/".$tmpnam));
              @fclose($topn);
              $logstr = $logstr . $tval;
              @unlink($logdir."/".$tmpnam);
              };
              }
              else{
              $fopn = @fopen($logdir."/".$tmpnam,"a");
              };
              @fputs($fopn, $logstr);
              @fclose($fopn);
              };
              }; //end function

              // send email
              function send_mail($MailSubject, $FromMail, $FromName, $ToMail, $text, $html="",
              $xnprty="3", $xmprty="Normal", $attstr=""){
              $boundary = md5(time());
              $userip = @getenv("REMOTE_ADDR");
              $mailbcc = split_mailaddress($ToMail,1);
              $fstbound = "----001_" . $boundary . "_fst";
              $secbound = "----002_" . $boundary . "_sec";
              $Head = "From: " . $FromName . "<" . split_mailaddress($FromMail) . ">\n"
              . "Reply-To: <" . split_mailaddress($FromMail) . ">\n";
              if($mailbcc!="") $Head .= "Bcc: " . $mailbcc . "\n";
              $Head .= "X-Mail-Script: smartbroker.php 1.0 by SmartStore\n"
              . "X-User-IP: " . ($userip?$userip:"no value") . "\n"
              . "X-Priority: " . $xnprty . "\n"
              . "MIME-Version: 1.0\n"
              . "Content-Type: multipart/mixed;\n\tboundary=\"$fstbound\"";
              $Body = "\n\n--$fstbound\n"
              . "Content-Type: multipart/alternative;\n\tboundary=\"$secbound\"\n"
              . "\n--$secbound\n"
              . "Content-Type: text/plain;\n\tcharset=\"" . Charset . "\"\n"
              . "Content-Transfer-Encoding: base64\n\n"
              . @chunk_split(base64_encode(wordwrap($text)))
              . "\n--$secbound\n"
              . "Content-Type: text/html;\n\tcharset=\"" . Charset . "\"\n"
              . "Content-Transfer-Encoding: base64\n\n"
              . @chunk_split(base64_encode($html))
              . "\n--$secbound--\n";
              if(strlen(trim($attstr)) > 0){
              if(stristr($attstr, "<")){
              $attstr = "<?xml version=\"1.0\" encoding=\"" . Charset . "\"?>" . stripslashes($attstr);
              $nam = oid.".xml";
              $ctp = "text/xml";
              }
              else{
              $nam = oid.".txt";
              $ctp = "text/plain";
              };
              $Body .= "\n--$fstbound\n"
              . "Content-Type: " . $ctp . ";\n\t"
              . "name=\"$nam\"\n"
              . "Content-Transfer-Encoding: base64\n"
              . "Content-Description: $nam\n"
              . "Content-Disposition: attachment;\n\t"
              . "filename=\"$nam\"\n\n"
              . @chunk_split(base64_encode($attstr))
              . "\n";
              };
              $Body .= "--$fstbound--\n";
              $ToMail = split_mailaddress($ToMail);
              return mail($ToMail,$MailSubject,$Body,$Head);
              }; //end function

              // Response when order has been sent from a local mashine
              function get_localmsg($lang,$refr,$fext,$oid,$err){
              $result = "";
              if(strtolower($lang) == "de"){
              $headingsuccess = "Vielen Dank für Ihre Bestellung";
              $infosuccess = "Wir bedanken uns für Ihr Vertrauen und werden Ihre Bestellung unverzüglich bearbeiten. Besuchen Sie uns doch bald wieder!\n";
              $headingerror = "Fehler beim Verarbeiten der Bestellung!";
              $infoerror = "Verzeihung! Ein interner Fehler ist aufgetreten. Bitte versuchen Sie es später erneut oder nehmen Sie direkt Kontakt mit uns auf!\n";
              $captionorderid = "Ihre Auftragsnummer lautet:";
              $captionback = "Zurück";
              }
              else{
              $headingsuccess = "Thank you very much for your order";
              $infosuccess = "We will process your order without delay. Thank you for your trust in us. Please visit us again!";
              $headingerror = "Error while processing your order!";
              $infoerror = "Sorry! An internal error occurred. Please try again later or contact us directly.";
              $captionorderid = "Your Order Number: ";
              $captionback = "Back";
              };
              if($err) $lnkredir = "javascript:history.back()";
              else $lnkredir = "javascript:history.go(-4)";
              $result .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>";
              if($err) $result .= $headingerror;
              else $result .= $headingsuccess;
              $result .= "</title><style type=\"text/css\">body {margin:5px;} td {font-family:verdana;font-size:0.8em;}</style>"
              . "<script src=\"" . $refr . "assets/scripts/global.js\" language=\"javascript\" type=\"text/javascript\"></script>"
              . "</head><body><table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"640\"><tr><td></td>"
              . "</tr><tr><td style=\"font-weight:bold;\">";
              if($err) $result .= $headingerror;
              else $result .= $headingsuccess;
              $result .= "</td></tr><tr><td>";
              if($err) $result .= $infoerror;
              else $result .= $infosuccess;
              $result .= "

              </td></tr><tr><td>";
              if(!$err) $result .= $captionorderid . $oid;
              $result .= "

              <hr width=\"100%\" noshade><a href=\"" . $lnkredir ."\">"
              . "

              Kommentar

              Lädt...
              X