Subversion-Projekte lars-tiefland.content-management

Revision

Revision 1 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1 Revision 2
Zeile 3... Zeile 3...
3
    /**
3
    /**
4
     * @package   Content-management
4
     * @package   Content-management
5
     * @author    Webagentur Niewerth <tiefland@weban.de>
5
     * @author    Webagentur Niewerth <tiefland@weban.de>
6
     * @copyright 2011 Webagentur Niewerth
6
     * @copyright 2011 Webagentur Niewerth
7
     * @license   propietary http://www.weban.de
7
     * @license   propietary http://www.weban.de
8
     * @version   $Rev: 3931 $
8
     * @version   $Rev: 4249 $
9
     * @filesource
9
     * @filesource
10
     * 
10
     * 
11
     */
11
     */
Zeile 12... Zeile 12...
12
 
12
 
Zeile 15... Zeile 15...
15
     * @package   Content-management
15
     * @package   Content-management
16
     * @author    Webagentur Niewerth <tiefland@weban.de>
16
     * @author    Webagentur Niewerth <tiefland@weban.de>
17
     * @copyright 2011 Webagentur Niewerth
17
     * @copyright 2011 Webagentur Niewerth
18
     */
18
     */
Zeile 19... Zeile 19...
19
 
19
 
20
    // SVN: $Id: lagerbestand.php 3931 2011-09-16 08:17:57Z tiefland $
20
    // SVN: $Id: lagerbestand.php 4249 2012-03-23 15:42:14Z tiefland $
21
    require_once "../toolbox/common.php";
21
    require_once "../toolbox/common.php";
22
    require_once "includes/bestellungen/system/artikelDatabase.php";
22
    require_once "includes/bestellungen/system/artikelDatabase.php";
23
    require_once "module/weban/weban_utils.class.php";
23
    require_once "module/weban/weban_utils.class.php";
24
    $item = Weban_Utils::clean_global_input( "item", "post", "int" );
24
    $item = Weban_Utils::clean_global_input( "item", "post", "int" );
25
    $order_id = Weban_Utils::clean_global_input( "order_id", "post", "int" );
25
    $order_id = Weban_Utils::clean_global_input( "order_id", "post", "int" );
26
    $shop_id = Weban_Utils::clean_global_input( "shop_id", "post", "int" );
26
    $shop_id = Weban_Utils::clean_global_input( "shop_id", "post", "int" );
-
 
27
    $GLOBALS["db_name"] = shopDatabase( $shop_id );
27
    $GLOBALS["db_name"] = shopDatabase( $shop_id );
28
    $artikel = getArtikel( $item );
28
    $lieferanten = getArtikelLieferanten( $item );
29
    $lieferanten = getArtikelLieferanten( $item );
29
    foreach ( $lieferanten as $id => $lieferant )
30
    foreach ( $lieferanten as $id => $lieferant )
30
    {
31
    {
31
        $sql_l = "SELECT
32
        $sql_l = "SELECT
Zeile 34... Zeile 35...
34
                bestellbar,
35
                bestellbar,
35
                bestand,
36
                bestand,
36
                status,
37
                status,
37
                verf_codes,
38
                verf_codes,
38
                ek_preis,
39
                ek_preis,
39
                vk_preis
40
                vk_preis,
-
 
41
                import_date
40
            FROM
42
            FROM
41
                " . $GLOBALS["db_name"] . "lieferanten_lager ll
43
                " . $GLOBALS["db_name"] . "lieferanten_lager ll
42
            JOIN
44
            JOIN
43
                " . $GLOBALS["db_name"] . "artikel_lagerbestand al
45
                " . $GLOBALS["db_name"] . "artikel_lagerbestand al
44
            ON
46
            ON
Zeile 63... Zeile 65...
63
            }
65
            }
64
            $lieferanten[$id]["lager"][] = $row_l;
66
            $lieferanten[$id]["lager"][] = $row_l;
65
        }
67
        }
66
        $id++;
68
        $id++;
67
    }
69
    }
-
 
70
    $GLOBALS["ui"]->assign( "artikel", $artikel );
68
    $GLOBALS["ui"]->assign( "item_id", $item );
71
    $GLOBALS["ui"]->assign( "item_id", $item );
69
    $GLOBALS["ui"]->assign( "order_id", $order_id );
72
    $GLOBALS["ui"]->assign( "order_id", $order_id );
70
    $GLOBALS["ui"]->assign( "shop_id", $shop_id );
73
    $GLOBALS["ui"]->assign( "shop_id", $shop_id );
71
    $GLOBALS["ui"]->assign( "lieferanten", $lieferanten );
74
    $GLOBALS["ui"]->assign( "lieferanten", $lieferanten );
72
    $GLOBALS["ui"]->display( "lagerbestand.tpl" );
75
    $GLOBALS["ui"]->display( "lagerbestand.tpl" );
Zeile 96... Zeile 99...
96
        {
99
        {
97
            $ret[$id++] = $row;
100
            $ret[$id++] = $row;
98
        }
101
        }
99
        return $ret;
102
        return $ret;
100
    }
103
    }
-
 
104
 
-
 
105
    function getArtikel( $item )
-
 
106
    {
-
 
107
        $sql = "SELECT
-
 
108
                a.kurzbezeichnung,
-
 
109
                al.lieferanten_artnr
-
 
110
            FROM
-
 
111
                " . $GLOBALS["db_name"] . "artikel a
-
 
112
            JOIN
-
 
113
                " . $GLOBALS["db_name"] . "artikel_to_lieferanten al
-
 
114
            ON
-
 
115
                al.artikel_id=a.id
-
 
116
            AND
-
 
117
                a.id=$item
-
 
118
        ";
-
 
119
        $res = mysql_query( $sql );
-
 
120
        $row = mysql_fetch_assoc( $res );
-
 
121
        //var_dump($row);
-
 
122
        return $row;
-
 
123
    }
101
?>
124
?>
102
125