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   Kein Projekt geladen
5
     * @author    Webagentur Niewerth <tiefland@weban.de>
6
     * @copyright 2012 Webagentur Niewerth
7
     * @license   propietary http://www.weban.de
8
     * @version   $Rev: 956 $
9
     * @filesource
10
     *
11
     */
12
 
13
    /**
14
     *
15
     * @package   Kein Projekt geladen
16
     * @author    Webagentur Niewerth <tiefland@weban.de>
17
     * @copyright 2012 Webagentur Niewerth
18
     */
19
 
20
    // SVN: $Id: getBestellungen.php 956 2012-02-23 08:20:36Z tiefland $
21
 
22
    // deutsche Umgebung
23
    setlocale( LC_ALL, "de_DE" );
24
    // Connect-Datei einbinden
25
    define( "modul_name", "Warenwirtschaft" );
26
    define( "tool_name", "bestellung" );
27
    require_once "../Online-Shop/connect2.php";
28
    $GLOBALS["web_rechte"] = $web_rechte;
29
 
30
    $Bestellungen = getBestellungen( $_SESSION["best_manu.php"]['kunden_id'] );
31
    require_once "Weban_Smarty.class.php";
32
 
33
    $GLOBALS["ui"] = new Weban_Smarty();
34
    $GLOBALS["ui"]->assign( "site", $site );
35
    $GLOBALS["ui"]->compile_dir = $_SERVER["DOCUMENT_ROOT"] . "/templates_c";
36
    $GLOBALS["ui"]->compile_id = "Warenwirtschaft|best_manu";
37
    $GLOBALS["ui"]->use_sub_dirs = true;
38
    $GLOBALS["ui"]->compile_check = true;
39
    $GLOBALS["ui"]->assign( "bestellungen", $Bestellungen );
40
 
41
    $GLOBALS["ui"]->display("best_manu_bestellungen.tpl");
42
    function getBestellungen( $login_id )
43
    {
44
        $table = "Bestellung b";
45
        $p_table = "bestellung_paketnummern";
46
        $sql = "SELECT
47
                b.ID,
48
        ";
49
        if ( isset( $GLOBALS["web_rechte"]["Warenwirtschaft"]["bezahlstatus"]["bezahlstatus"] ) )
50
        {
51
            $sql .= "
52
                    b.bezahlt,
53
                ";
54
        }
55
        if ( isset( $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["waehrung"] ) )
56
        {
57
            $sql .= "
58
                    c.locale,
59
                ";
60
        }
61
        $sql .= "
62
                b.shops_ID,
63
                b.erstellt_am,
64
                b.gesamtsumme_buffer
65
            FROM
66
        ";
67
        if ( isset( $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["waehrung"] ) )
68
        {
69
            $sql .= "
70
                    currencies c,
71
                ";
72
        }
73
        $sql .= "
74
                $table
75
            WHERE
76
                login=" . $login_id . "
77
        ";
78
        if ( isset( $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["waehrung"] ) )
79
        {
80
            $sql .= "
81
                    AND
82
                        c.id=b.currency
83
                ";
84
        }
85
        $sql .= "
86
            ORDER BY
87
                erstellt_am DESC
88
        ";
89
        $res = mysql_query( $sql );
90
        if ( $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["tracking"] )
91
        {
92
            list( $beschreibung, $link ) = explode( ";", $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["tracking"] );
93
        }
94
        while ( $row = mysql_fetch_assoc( $res ) )
95
        {
96
            $sql_p = "SELECT
97
                    *
98
                FROM
99
                    $p_table
100
                WHERE
101
                    Bestellung=" . $row["ID"] . "
102
            ";
103
 
104
            $res_p = mysql_query( $sql_p );
105
            while ( $row_p = mysql_fetch_assoc( $res_p ) )
106
            {
107
                $row["tracking"][] = $link . $row_p["paketnummer"];
108
                $row["versanddatum"][] = $row_p["datum"];
109
            }
110
            $rows[] = $row;
111
        }
112
        return $rows;
113
    }
114
?>