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: 768 $
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: suche_artikel.php 768 2011-10-28 06:34:37Z tiefland $
21
 
22
    require_once "../toolbox/common.php";
23
 
24
    //var_dump($_POST);
25
    $suche = Weban_Utils::clean_global_input( "suche" );
26
    $shop_id = Weban_Utils::clean_global_input( "shop_id", "post", "int" );
27
    if ( $suche && $shop_id )
28
    {
29
        $sql = "SELECT
30
                `database`
31
            FROM
32
                shops
33
            WHERE
34
                id=$shop_id
35
        ";
36
        $res = mysql_query( $sql );
37
        $row = mysql_fetch_assoc( $res );
38
        $table = $row["database"] . "." . "artikel";
39
        $sql = "SELECT
40
                id,
41
                kurzbezeichnung,
42
                preis1
43
            FROM
44
                $table
45
            WHERE
46
                id LIKE '%$suche%'
47
            OR
48
                kurzbezeichnung LIKE '%$suche%'
49
        ";
50
        $res = mysql_query( $sql );
51
        while ( $row = mysql_fetch_assoc( $res ) )
52
        {
53
            $artikel[] = $row;
54
        }
55
        $GLOBALS["ui"]->assign( "artikel", $artikel );
56
        $GLOBALS["ui"]->display( "suche_artikel.tpl" );
57
    }
58
?>