Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
3
    /**
4
     * @package   Content-management
5
     * @author    Webagentur Niewerth <tiefland@weban.de>
6
     * @copyright 2012 Webagentur Niewerth
7
     * @license   propietary http://www.weban.de
8
     * @version   $Rev: 957 $
9
     * @filesource
10
     *
11
     */
12
 
13
    /**
14
     *
15
     * @package   Content-management
16
     * @author    Webagentur Niewerth <tiefland@weban.de>
17
     * @copyright 2012 Webagentur Niewerth
18
     */
19
 
20
    // SVN: $Id: getIceCatInfo.php 957 2012-02-23 08:22:43Z tiefland $
21
 
22
    require_once "../toolbox/common.php";
23
    $GLOBALS["ui"]->compile_id = "Online-Shop_artikel";
24
    require_once "Config.php";
25
    $roh = getIceCatInfo( $_GET["EAN"] );
26
    $cfg = new Config();
27
    $cfg = $cfg->parseConfig( $roh, "XML", array( "isFile" => false ) );
28
    $erg = $cfg->toArray();
29
    $xml = $erg["root"]["ICECAT-interface"]["Product"];
30
    if ( is_array( $xml["ProductDescription"] ) )
31
    {
32
        $beschreibung = $xml["ProductDescription"]["@"]["LongDesc"];
33
        $beschreibung = str_replace( '\n', "<br>", $beschreibung );
34
    }
35
    foreach ( $xml["CategoryFeatureGroup"] as $group )
36
    {
37
        $groups[$group["@"]["ID"]]["name"] = $group["FeatureGroup"]["Name"]["@"]["Value"];
38
    }
39
    foreach ( $xml["ProductFeature"] as $e_id => $eigenschaft )
40
    {
41
        $groups[$eigenschaft["@"]["CategoryFeatureGroup_ID"]]["sub"][$eigenschaft["Feature"]["Name"]["@"]["Value"]] =
42
            $eigenschaft["@"]["Presentation_Value"];
43
    }
44
    $GLOBALS["ui"]->assign( "roh_xml", htmlentities($roh) );
45
    $GLOBALS["ui"]->assign( "groups", $groups );
46
    $GLOBALS["ui"]->assign( "xml", $xml );
47
    $GLOBALS["ui"]->assign( "beschreibung", $beschreibung );
48
    $GLOBALS["ui"]->display( "getIceCatInfo.tpl" );
49
 
50
    function getIceCatInfo( $ean )
51
    {
52
        $web_settings = getWebSettings( array( 10001, 10002 ) );
53
        $url = "http://" . urlencode( $web_settings[10001] ) . ":" . urlencode( $web_settings[10002] ) .
54
            "@data.icecat.biz/xml_s3/xml_server3.cgi?ean_upc=$ean;lang=DE;output=productxml";
55
        $ret = file_get_contents( $url );
56
        return $ret;
57
    }
58
?>