Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?php

    /**
     * @package   Content-management
     * @author    Webagentur Niewerth <tiefland@weban.de>
     * @copyright 2011 Webagentur Niewerth
     * @license   propietary http://www.weban.de
     * @version   $Rev: 768 $
     * @filesource
     * 
     */

    /**
     * 
     * @package   Content-management
     * @author    Webagentur Niewerth <tiefland@weban.de>
     * @copyright 2011 Webagentur Niewerth
     */

    // SVN: $Id: suche_artikel.php 768 2011-10-28 06:34:37Z tiefland $

    require_once "../toolbox/common.php";

    //var_dump($_POST);
    $suche = Weban_Utils::clean_global_input( "suche" );
    $shop_id = Weban_Utils::clean_global_input( "shop_id", "post", "int" );
    if ( $suche && $shop_id )
    {
        $sql = "SELECT
                `database`
            FROM
                shops
            WHERE
                id=$shop_id
        ";
        $res = mysql_query( $sql );
        $row = mysql_fetch_assoc( $res );
        $table = $row["database"] . "." . "artikel";
        $sql = "SELECT
                id,
                kurzbezeichnung,
                preis1
            FROM
                $table
            WHERE
                id LIKE '%$suche%'
            OR
                kurzbezeichnung LIKE '%$suche%'
        ";
        $res = mysql_query( $sql );
        while ( $row = mysql_fetch_assoc( $res ) )
        {
            $artikel[] = $row;
        }
        $GLOBALS["ui"]->assign( "artikel", $artikel );
        $GLOBALS["ui"]->display( "suche_artikel.tpl" );
    }
?>