Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
    /**
4
     * @package   Content-management
5
     * @author    Webagentur Niewerth <tiefland@weban.de>
6
     * @copyright 2011 Webagentur Niewerth
7
     * @license   propietary http://www.weban.de
8
     * @version   $Rev: 3931 $
9
     * @filesource
10
     *
11
     */
12
 
13
    /**
14
     *
15
     * @package   Content-management
16
     * @author    Webagentur Niewerth <tiefland@weban.de>
17
     * @copyright 2011 Webagentur Niewerth
18
     */
19
 
20
    // SVN: $Id: preisstaffel.php 3931 2011-09-16 08:17:57Z tiefland $
21
 
22
    require_once "connect2.php";
23
    require_once "Weban_Smarty.class.php";
24
 
25
    $GLOBALS["ui"] = new Weban_Smarty();
26
    $preise = explode( ";", $web_rechte["online_shop"]["artikel"]["preise"] );
27
    $preis_anz = count( $preise );
28
    for ( $i = 1; $i <= $preis_anz; $i++ )
29
    {
30
        $sql = "SELECT
31
                staffel
32
            FROM
33
                preise
34
            WHERE
35
                artikel_id=" . $zeile["ID"] . "
36
            AND
37
                language='" . $zeile["Language"] . "'
38
            AND
39
                preis_index=$i
40
        ";
41
        $res = mysql_query( $sql );
42
        if ( mysql_numrows( $res ) )
43
        {
44
            $row = mysql_fetch_assoc( $res );
45
            $wert = unserialize( $row["staffel"] );
46
            foreach ( $wert["preis"] as $id => $preis_x )
47
            {
48
                if ( $preis_x < 0 )
49
                {
50
                    $wert["preis"][$id] = sprintf( "%.02f%%", $preis_x * -1 );
51
                }
52
            }
53
            $staffel_anzahl = count( $wert["menge"] );
54
            $wert["anzahl"] = $staffel_anzahl;
55
            $preis[$i] = $wert;
56
        }
57
    }
58
    $GLOBALS["ui"]->assign( "preis", $preis );
59
    $GLOBALS["ui"]->assign( "user_rechte", $user_rechte );
60
    $GLOBALS["ui"]->assign( "web_rechte", $web_rechte );
61
    $GLOBALS["ui"]->assign( "preise", $preise );
62
    $GLOBALS["ui"]->assign( "preis_anz", $preis_anz );
63
    $GLOBALS["ui"]->assign( "site", $site );
64
    $GLOBALS["ui"]->display( "preisstaffel/page.tpl" );
65
?>