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    Lars Tiefland <tiefland@weban.de>
6
     * @copyright 2010 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    Lars Tiefland <tiefland@weban.de>
17
     * @copyright 2010 Webagentur Niewerth
18
     */
19
 
20
    // SVN: $Id: logbuch.php 3931 2011-09-16 08:17:57Z tiefland $
21
 
22
    define( "Range", 100 );
23
 
24
    require_once "common.php";
25
    require_once "smarty/libs/SmartyPaginate.class.php";
26
    require_once "includes/pagination.php";
27
 
28
    $daten = array();
29
 
30
    $filter = array( "mode" => array( "filter" => FILTER_CALLBACK, "options" =>
31
        "check_mode" ), "id" => FILTER_SANITIZE_NUMBER_INT, );
32
    $out = filter_input_array( INPUT_GET, $filter );
33
 
34
    $mode = $out["mode"];
35
    $id = $out["id"];
36
 
37
    $rufname = $mode;
38
 
39
    $sql = "SELECT SQL_CALC_FOUND_ROWS
40
            lb.*,
41
            lba.name AS art,
42
            a.user
43
        FROM
44
            logbuch lb
45
        JOIN
46
            logbuch_arten lba
47
        ON
48
            lba.ID=lb.art
49
        JOIN
50
            content_management.Access AS a
51
        ON
52
            a.ID=lb.user
53
        WHERE
54
            rufname='$rufname'
55
        AND
56
            lb.vorgang=$id
57
        ORDER BY
58
            datum DESC
59
        LIMIT
60
        " . SmartyPaginate::getcurrentIndex() . ", " . Range . "
61
    ";
62
    switch ( $mode )
63
    {
64
        case "bestellung":
65
            $skript = "/Warenwirtschaft/bestellungen.php";
66
            $param = "Bestellung";
67
            break;
68
        case "artikel":
69
            $skript = "/Online-Shop/artikel.php";
70
            $param = "action=edit&ID";
71
            break;
72
        case "directory":
73
            $skript = "/Online-Shop/directory.php";
74
            $param = "action=edit&ID";
75
            break;
76
        default:
77
            $sql = "SELECT SQL_CALC_FOUND_ROWS
78
                    lb.*,
79
                    lba.name AS art,
80
                    lba.rufname,
81
                    a.user
82
                FROM
83
                    logbuch lb
84
                JOIN
85
                    logbuch_arten lba
86
                ON
87
                    lba.ID=lb.art
88
                JOIN
89
                    content_management.Access AS a
90
                ON
91
                    a.ID=lb.user
92
                ORDER BY
93
                    datum DESC
94
                LIMIT
95
                " . SmartyPaginate::getcurrentIndex() . ", " . Range . "
96
            ";
97
            break;
98
    }
99
    $res = mysql_query( $sql );
100
    $sql_2 = "SELECT
101
            FOUND_ROWS() AS total
102
    ";
103
    $res_2 = mysql_query( $sql_2 );
104
    $row_2 = mysql_fetch_assoc( $res_2 );
105
    $total = $row_2["total"];
106
    pagination( $total );
107
    while ( $row = mysql_fetch_assoc( $res ) )
108
    {
109
        if ( isset( $row["rufname"] ) )
110
        {
111
            switch ( $row["rufname"] )
112
            {
113
                case "bestellung":
114
                    $row["skript"] = "/Warenwirtschaft/bestellungen.php";
115
                    $row["param"] = "Bestellung";
116
                    break;
117
                case "artikel":
118
                    $row["skript"] = "/Online-Shop/artikel.php";
119
                    $row["param"] = "action=edit&ID";
120
                    break;
121
                case "directory":
122
                    $row["skript"] = "/Online-Shop/directory.php";
123
                    $row["param"] = "action=edit&ID";
124
                    break;
125
            }
126
        }
127
        else
128
        {
129
            $row["skript"] = $script;
130
            $row["param"] = $param;
131
        }
132
        $daten[] = $row;
133
    }
134
    $GLOBALS["ui"]->assign( "daten", $daten );
135
    if ( $mode )
136
    {
137
        $GLOBALS["ui"]->display( "common/logbuch.tpl" );
138
    }
139
    else
140
    {
141
        $GLOBALS["ui"]->assign( "file", "common/logbuch.tpl" );
142
        $GLOBALS["ui"]->display( "common/page.tpl" );
143
    }
144
    function check_mode()
145
    {
146
        $modes = array( "bestellung", "directory", "artikel", "" );
147
        if ( in_array( $_GET["mode"], $modes ) )
148
        {
149
            return $_GET["mode"];
150
        }
151
        else
152
        {
153
            return null;
154
        }
155
    } ?>