Subversion-Projekte lars-tiefland.php_share

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        include("/web/apache/mediaran.de/preisagent/transfer/connect.php"); 
        include("/web/apache/mediaran.de/preisagent/transfer/avt-24/core_data.php");
        
        function get_clear_path($heritage)
        {
                array_shift($heritage);
                return $heritage;
        }

        function ausgabe($subdir,$heritage)
        {
                global $output;
                
                $artikel=array_pop($subdir);
                $subdirs=array_pop($subdir);

                $heritage[]=$subdir[Name];
                
                foreach($artikel as $current_row)
                {
                        $current_row[category]=implode("|",get_clear_path($heritage));
                        $output[]=$current_row;
                }
                
                foreach($subdirs as $current_subdir)
                {
                        ausgabe($current_subdir,$heritage);
                }
        }

        $output=array();
        ausgabe(core_data(),array());
        // $output ist jetzt gefüllt

        $felder=array
        (
                "Bestellnummer",
                "Produktbezeichnung",
                "Produktbeschreibung",
                "Preis",
                "Lieferstatus"
        );
        echo implode("\t",$felder)."\n";

        foreach ($output as $artikel)
        {
                echo 
                        $artikel[ID]."\t".
                        preg_replace("/[\r\n]/", "", $artikel[bezeichnung])."\t".
                        preg_replace("/[\r\n]/", "", $artikel[beschreibung])."\t".
                        $artikel[preis1]."\t".
                        $artikel[preis4]."\t".                          
                        $artikel[preis]."\t".
                        "lieferbar\n";
        }
?>