~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to frontends/php/report4.php

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2007-07-02 09:06:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070702090651-8l6fl3fjw9rh6l2u
Tags: 1:1.4.1-2
Add patch from SVN in order to fix Incorrect processing of character '%'
in user parameters and remote commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
**/
20
20
?>
21
21
<?php
22
 
        include "include/config.inc.php";
 
22
        require_once "include/config.inc.php";
 
23
 
23
24
        $page["title"] = "S_IT_NOTIFICATIONS";
24
25
        $page["file"] = "report4.php";
25
 
        show_header($page["title"],0,0);
26
 
?>
27
 
 
28
 
<?php
29
 
        if(!check_right("User","R",0))
30
 
        {
31
 
              show_table_header("<font color=\"AA0000\">No permissions !</font>");
32
 
              show_page_footer();
33
 
              exit;
34
 
        }
35
 
?>
36
 
 
37
 
<?php
38
 
        if(!isset($_REQUEST["year"]))
39
 
        {
40
 
                  $_REQUEST["year"]=2006;
41
 
 //               show_table_header("<font color=\"AA0000\">Undefined serviceid !</font>");
42
 
 //               show_page_footer();
43
 
 //               exit;
44
 
        }
45
 
?>
46
 
 
47
 
<?php
48
 
        if(!isset($_REQUEST["period"]))
49
 
        {
50
 
                $_REQUEST["period"]="weekly";
51
 
        }
52
 
 
53
 
        if(!isset($_REQUEST["media_type"]))
54
 
        {
55
 
                $_REQUEST["media_type"]="0";
56
 
        }
57
 
 
58
 
        $h1=S_NOTIFICATIONS_BIG;
59
 
 
60
 
#       $h2=S_GROUP.SPACE;
61
 
        $h2=S_YEAR.SPACE;
62
 
        $h2=$h2."<select class=\"biginput\" name=\"year\" onChange=\"submit()\">";
63
 
        $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
64
 
 
65
 
        $year=date("Y");
66
 
        for($year=date("Y")-2;$year<=date("Y");$year++)
67
 
        {
68
 
                $h2=$h2.form_select("year",$year,$year);
69
 
        }
70
 
        $h2=$h2."</select>";
71
 
 
72
 
        $h2=$h2.SPACE.S_PERIOD.SPACE;
73
 
        $h2=$h2."<select class=\"biginput\" name=\"period\" onChange=\"submit()\">";
74
 
        $h2=$h2.form_select("period","daily",S_DAILY);
75
 
        $h2=$h2.form_select("period","weekly",S_WEEKLY);
76
 
        $h2=$h2.form_select("period","monthly",S_MONTHLY);
77
 
        $h2=$h2.form_select("period","yearly",S_YEARLY);
78
 
        $h2=$h2."</select>";
79
 
        $h2=$h2.SPACE.S_MEDIA_TYPE.SPACE;
80
 
        $h2=$h2."<select class=\"biginput\" name=\"media_type\" onChange=\"submit()\">";
81
 
 //     $h2=$h2.form_select("media_type","0",S_ALL_SMALL);
82
 
        $result=DBselect("select * from media_type order by description");
83
 
        $type_count=0;
84
 
        while($row=DBfetch($result))
85
 
             {
86
 
               $type_count++;
87
 
               $descarray[$type_count]=$row["description"];
88
 
               $id=$row["mediatypeid"];
89
 
               $idarray[$type_count]=$id;
90
 
             }
91
 
        $descarray[0]="all";
92
 
        $i=-1;
93
 
        while($i<$type_count)
94
 
             {
95
 
               $i++;
96
 
               global $_REQUEST;
97
 
               $selected = "";
98
 
               if(!is_null("media_type"))
99
 
               {
100
 
                   if(isset($_REQUEST["media_type"])&&$_REQUEST["media_type"]==$i)
101
 
                            $selected = "selected";
102
 
               }
103
 
               $form_select1="<option value=$i $selected>$descarray[$i]";
104
 
               $h2=$h2.$form_select1;
105
 
//             $h2=$h2.form_select("media_type","$descarray[$i]",S_EMAIL);
106
 
            }
107
 
        $h2=$h2."</select>";
108
 
 
109
 
 
110
 
        show_header2($h1,$h2,"<form name=\"selection\" method=\"get\" action=\"report4.php\">", "</form>");
111
 
?>
112
 
 
113
 
<?php
114
 
        $year=date("Y");
 
26
 
 
27
include_once "include/page_header.php";
 
28
 
 
29
?>
 
30
<?php
 
31
//              VAR                     TYPE    OPTIONAL FLAGS  VALIDATION      EXCEPTION
 
32
        $fields=array(
 
33
                "year"=>                array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO,  NULL,           NULL),
 
34
                "period"=>              array(T_ZBX_STR, O_OPT, P_SYS|P_NZERO,  IN('"dayly","weekly","monthly","yearly"'),              NULL),
 
35
                "media_type"=>          array(T_ZBX_INT, O_OPT, P_SYS,  DB_ID,          NULL)
 
36
        );
 
37
 
 
38
        check_fields($fields);
 
39
?>
 
40
<?php
 
41
        $year           = get_request("year",           intval(date("Y")));
 
42
        $period         = get_request("period",         "weekly");
 
43
        $media_type     = get_request("media_type",     0);
 
44
?>
 
45
<?php
 
46
        if( ($min_time = DBfetch(DBselect('select min(clock) as clock from alerts'))) && $min_time['clock'])
 
47
        {
 
48
                $MIN_YEAR = intval(date("Y", $min_time['clock']));
 
49
        }
 
50
 
 
51
        if( !isset($MIN_YEAR) )
 
52
        {
 
53
                $MIN_YEAR = intval(date("Y"));
 
54
        }
 
55
                
 
56
        $form = new CForm();
 
57
 
 
58
        $form->AddItem(SPACE.S_MEDIA_TYPE.SPACE);
 
59
        $cmbMedia = new CComboBox("media_type", $media_type, "submit();");
 
60
        $cmbMedia->AddItem(0,S_ALL_SMALL);
 
61
        $db_medias = DBselect("select * from media_type where ".DBid2nodeid("mediatypeid")."=".$ZBX_CURNODEID." order by description");
 
62
        while($media_data = DBfetch($db_medias))
 
63
        {
 
64
                $cmbMedia->AddItem($media_data["mediatypeid"], $media_data["description"]);
 
65
        }
 
66
        $form->AddItem($cmbMedia);
 
67
 
 
68
        $form->AddItem(SPACE.S_PERIOD.SPACE);
 
69
        $cmbPeriod = new CComboBox("period", $period, "submit();");
 
70
        $cmbPeriod->AddItem("dayly",    S_DAILY);
 
71
        $cmbPeriod->AddItem("weekly",   S_WEEKLY);
 
72
        $cmbPeriod->AddItem("monthly",  S_MONTHLY);
 
73
        $cmbPeriod->AddItem("yearly",   S_YEARLY);
 
74
        $form->AddItem($cmbPeriod);
 
75
        
 
76
        if($period != "yearly")
 
77
        {
 
78
                $form->AddItem(SPACE.S_YEAR.SPACE);
 
79
                $cmbYear = new CComboBox("year", $year, "submit();");
 
80
                for($y = $MIN_YEAR; $y <= date("Y"); $y++)
 
81
                        $cmbYear->AddItem($y, $y);
 
82
                $form->AddItem($cmbYear);
 
83
        }
 
84
        
 
85
        show_table_header(S_NOTIFICATIONS_BIG, $form);
 
86
?>
 
87
<?php
 
88
        $_REQUEST["year"]       = $year;
 
89
        $_REQUEST["period"]     = $period;
 
90
        $_REQUEST["media_type"] = $media_type;
 
91
 
 
92
        
115
93
        $table = new CTableInfo();
116
 
        if($_REQUEST["period"]=="yearly")
117
 
        {
118
 
                $header=array(new CCol(S_YEAR,"center"));
119
 
                $uindex=1;
120
 
                $result=DBselect("select * from users".
121
 
                        " order by alias");
122
 
                while($row=DBfetch($result))
123
 
                {
124
 
                        $header=array_merge($header,array(new CImg("vtext.php?text=".$row["alias"])));
125
 
                        $userarray[$uindex]=$row["userid"];
126
 
                        $uindex++;
127
 
                }
128
 
                $table->setHeader($header,"vertical_header");
129
 
 
130
 
 
131
 
 
132
 
                for($year=date("Y")-5;$year<=date("Y");$year++)
133
 
                {       
134
 
                        $start=mktime(0,0,0,1,1,$year);
135
 
                        $end=mktime(0,0,0,1,1,$year+1);
136
 
                        $table_row = array(nbsp($year));
137
 
                        $style = NULL;
138
 
                        $counter=1;
139
 
                        while ($counter<$uindex) 
140
 
                              {
141
 
                               $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end");
142
 
                               while($row=DBfetch($result))
143
 
                                    {
144
 
                                    $count_all=$row[0];
145
 
                                    }
146
 
                               $i=0;
147
 
                               while ($i<$type_count)
148
 
                                    {
149
 
                                       $i++;  
150
 
                                       $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end and mediatypeid=$idarray[$i]");
151
 
                                       while($row=DBfetch($result))
152
 
                                            {
153
 
                                               $count_by_type[$i]=$row[0];
154
 
                                            }
155
 
                                    }
156
 
                               if ($_REQUEST["media_type"]==0)
157
 
                                    {
158
 
                                      $total_count=$count_all;
159
 
                                      $total_count.=" (";
160
 
                                      $i=0;
161
 
                                      while ($i<$type_count)
162
 
                                            {
163
 
                                               $i++;
164
 
                                               if($i>1) { $total_count.="/"; }
165
 
                                               $total_count.=$count_by_type[$i];
166
 
                                            }
167
 
                                      $total_count.=")";
168
 
                                    }
169
 
                               $i=0;
170
 
                               while($i<=$type_count)
171
 
                                    {
172
 
                                       $i++;
173
 
                                       if ($_REQUEST["media_type"]==$i)
174
 
                                          $total_count=$count_by_type[$i];
175
 
                                    }
176
 
                               array_push($table_row,new CCol($total_count,$style));
177
 
                               $counter++;
178
 
                              }
179
 
                        $table->AddRow($table_row);
180
 
                }
181
 
 
182
 
        }
183
 
        else if($_REQUEST["period"]=="monthly")
184
 
                {
185
 
                $header=array(new CCol(SPACE.S_MONTH,"center"));
186
 
                $uindex=1;
187
 
                $result=DBselect("select * from users order by alias");
188
 
                while($row=DBfetch($result))
189
 
                {
190
 
                        $header=array_merge($header,array(new CImg("vtext.php?text=".$row["alias"])));
191
 
                        $userarray[$uindex]=$row["userid"];
192
 
                        $uindex++;
193
 
                }
194
 
                $table->setHeader($header,"vertical_header");
195
 
 
196
 
                for($month=1;$month<=12;$month++)
197
 
                {
198
 
                        $start=mktime(0,0,0,$month,1,$_REQUEST["year"]);
199
 
                        $end=mktime(0,0,0,$month+1,1,$_REQUEST["year"]);
200
 
                        if($start>time()) break;
201
 
                        $table_row = array(nbsp(date("M Y",$start)));
202
 
                        $style = NULL;
203
 
                        $counter=1;
204
 
                        while ($counter<$uindex)
205
 
                              {
206
 
                               $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end");
207
 
                               while($row=DBfetch($result))
208
 
                                    {
209
 
                                    $count_all=$row[0];
210
 
                                    }
211
 
                               $i=0;
212
 
                               while ($i<$type_count)
213
 
                                    {
214
 
                                       $i++;
215
 
                                       $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end and mediatypeid=$idarray[$i]");
216
 
                                       while($row=DBfetch($result))
217
 
                                            {
218
 
                                               $count_by_type[$i]=$row[0];
219
 
                                            }
220
 
                                    }
221
 
                               if ($_REQUEST["media_type"]==0)
222
 
                                    {
223
 
                                      $total_count=$count_all;
224
 
                                      $total_count.=" (";
225
 
                                      $i=0;
226
 
                                      while ($i<$type_count)
227
 
                                            {
228
 
                                               $i++;
229
 
                                               if($i>1) { $total_count.="/"; }
230
 
                                               $total_count.=$count_by_type[$i];
231
 
                                            }
232
 
                                      $total_count.=")";
233
 
                                    }
234
 
                               $i=0;
235
 
                               while($i<=$type_count)
236
 
                                    {
237
 
                                       $i++;
238
 
                                       if ($_REQUEST["media_type"]==$i)
239
 
                                          $total_count=$count_by_type[$i];
240
 
                                    }
241
 
                               array_push($table_row,new CCol($total_count,$style));
242
 
                               $counter++;
243
 
                              }
244
 
 
245
 
                        $table->AddRow($table_row);
246
 
                }
247
 
        }
248
 
        else if($_REQUEST["period"]=="daily")
249
 
        {
250
 
                $header=array(new CCol(SPACE.S_DAY,"center"));
251
 
                $uindex=1;
252
 
                $result=DBselect("select * from users order by alias");
253
 
                while($row=DBfetch($result))
254
 
                {
255
 
                        $header=array_merge($header,array(new CImg("vtext.php?text=".$row["alias"])));
256
 
                        $userarray[$uindex]=$row["userid"];
257
 
                        $uindex++;
258
 
                }
259
 
                $table->setHeader($header,"vertical_header");
260
 
 
261
 
                $s=mktime(0,0,0,1,1,$_REQUEST["year"]);
262
 
                $e=mktime(0,0,0,1,1,$_REQUEST["year"]+1);
263
 
                for($day=$s;$day<$e;$day+=24*3600)
264
 
                {
265
 
                        $start=$day;
266
 
                        $end=$day+24*3600;
267
 
 
268
 
                        if($start>time())       break;
269
 
                
270
 
                        $table_row = array(nbsp(date("d M Y",$start)));
271
 
                        $style = NULL;
272
 
                        $counter=1;
273
 
                        while ($counter<$uindex)
274
 
                              {
275
 
                               $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end");
276
 
                               while($row=DBfetch($result))
277
 
                                    {
278
 
                                    $count_all=$row[0];
279
 
                                    }
280
 
                               $i=0;
281
 
                               while ($i<$type_count)
282
 
                                    {
283
 
                                       $i++;
284
 
                                       $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$start and clock<$end and mediatypeid=$idarray[$i]");
285
 
                                       while($row=DBfetch($result))
286
 
                                            {
287
 
                                               $count_by_type[$i]=$row[0];
288
 
                                            }
289
 
                                    }
290
 
                               if ($_REQUEST["media_type"]==0)
291
 
                                    {
292
 
                                      $total_count=$count_all;
293
 
                                      $total_count.=" (";
294
 
                                      $i=0;
295
 
                                      while ($i<$type_count)
296
 
                                            {
297
 
                                               $i++;
298
 
                                               if($i>1) { $total_count.="/"; }
299
 
                                               $total_count.=$count_by_type[$i];
300
 
                                            }
301
 
                                      $total_count.=")";
302
 
                                    }
303
 
                               $i=0;
304
 
                               while($i<=$type_count)
305
 
                                    {
306
 
                                       $i++;
307
 
                                       if ($_REQUEST["media_type"]==$i)
308
 
                                          $total_count=$count_by_type[$i];
309
 
                                    }
310
 
                               array_push($table_row,new CCol($total_count,$style));
311
 
                               $counter++;
312
 
                              }
313
 
 
314
 
 
315
 
                        $table->AddRow($table_row);
316
 
                }               
317
 
        }
318
 
        else
319
 
        {
320
 
        //-------Weekly-------------
321
 
                $year=date("Y");
322
 
                $header=array(new CCol(SPACE.S_FROM,"center"),new CCol(SPACE.S_TILL,"center"));
323
 
                $uindex=1;
324
 
                $result=DBselect("select * from users order by alias");
325
 
                while($row=DBfetch($result))
326
 
                {
327
 
                        $header=array_merge($header,array(new CImg("vtext.php?text=".$row["alias"])));
328
 
                        $userarray[$uindex]=$row["userid"];
329
 
                        $uindex++;
330
 
                }
331
 
                $table->setHeader($header,"vertical_header");
332
 
                for($year=date("Y")-2;$year<=date("Y");$year++)
333
 
        {
334
 
                if( isset($_REQUEST["year"]) && ($_REQUEST["year"] != $year) )
335
 
                {
336
 
                        continue;
337
 
                }
338
 
                $start=mktime(0,0,0,1,1,$year);
339
 
 
340
 
                $wday=date("w",$start);
341
 
                if($wday==0) $wday=7;
342
 
                $start=$start-($wday-1)*24*3600;
343
 
                $i=0;
344
 
                for($i=0;$i<53;$i++)
345
 
                {
346
 
                        $period_start=$start+7*24*3600*$i;
347
 
                        $period_end=$start+7*24*3600*($i+1);
348
 
                        if($period_start>time())
349
 
                        {
350
 
                                break;
351
 
                        } 
352
 
                        $from=date(S_DATE_FORMAT_YMD,$period_start);
353
 
                        $till=date(S_DATE_FORMAT_YMD,$period_end);
354
 
                        $table_row = array($from,$till);
355
 
                        $style = NULL;
356
 
                        $counter=1;
357
 
                        while ($counter<$uindex)
358
 
                              {
359
 
                               $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$period_start and clock<$period_end");
360
 
                               while($row=DBfetch($result))
361
 
                                    {
362
 
                                    $count_all=$row[0];
363
 
                                    }
364
 
                               $k=0;
365
 
                               while ($k<$type_count)
366
 
                                    {
367
 
                                       $k++;
368
 
                                       $result=DBselect("select count(*) from alerts where userid='$userarray[$counter]' and clock>$period_start and clock<$period_end and mediatypeid=$idarray[$k]");
369
 
                                       while($row=DBfetch($result))
370
 
                                            {
371
 
                                               $count_by_type[$k]=$row[0];
372
 
                                            }
373
 
                                    }
374
 
                               if ($_REQUEST["media_type"]==0)
375
 
                                    {
376
 
                                      $total_count=$count_all;
377
 
                                      $total_count.=" (";
378
 
                                      $l=0;
379
 
                                      while ($l<$type_count)
380
 
                                            {
381
 
                                               $l++;
382
 
                                               if($l>1) { $total_count.="/"; }
383
 
                                               $total_count.=$count_by_type[$l];
384
 
                                            }
385
 
                                      $total_count.=")";
386
 
                                    }
387
 
                               $m=0;
388
 
                               while($m<=$type_count)
389
 
                                    {
390
 
                                       $m++;
391
 
                                       if ($_REQUEST["media_type"]==$m)
392
 
                                          $total_count=$count_by_type[$m];
393
 
                                    }
394
 
                               array_push($table_row,new CCol($total_count,$style));
395
 
 
396
 
                              $counter++;
397
 
                              }
398
 
 
399
 
                        $table->AddRow($table_row);
400
 
                 } }
401
 
        //--------Weekly-------------
402
 
        }
403
 
        $table->show();
404
 
        if ($_REQUEST["media_type"]=="0")
405
 
           {
406
 
             $style = "off";
407
 
             $table = new CTableInfo();
408
 
             $types="all (";
409
 
             $i=0;
410
 
             while($i<$type_count)
411
 
                  {
412
 
                     $i++;
413
 
                     if($i>1) {$types.="/";}
414
 
                     $types.=$descarray[$i];
415
 
                  }
416
 
             $types.=")";
417
 
             $table->AddRow(new CSpan(SPACE.SPACE.SPACE.SPACE.SPACE.SPACE.$types,$style));
418
 
             $table->Show();
419
 
           }
420
 
        show_page_footer();
421
 
?>
422
 
 
 
94
 
 
95
        $header = array();
 
96
        $db_users = DBselect("select * from users where ".DBid2nodeid("userid")."=".$ZBX_CURNODEID." order by alias,userid");
 
97
        while($user_data = DBfetch($db_users))
 
98
        {
 
99
                array_push($header, new CImg("vtext.php?text=".$user_data["alias"]));
 
100
                $users[$user_data['userid']] = $user_data['alias'];
 
101
        }
 
102
 
 
103
        $media_types = array();
 
104
 
 
105
        $db_media_types = DBselect("select * from media_type where ".DBid2nodeid("mediatypeid")."=".$ZBX_CURNODEID.
 
106
                ($media_type > 0 ? " and mediatypeid=".$media_type : "" ).
 
107
                " order by description,mediatypeid");
 
108
        while($media_type_data = DBfetch($db_media_types))
 
109
        {
 
110
                $media_types[$media_type_data['mediatypeid']] = $media_type_data['description'];
 
111
        }
 
112
        
 
113
        switch($period)
 
114
        {
 
115
                case "yearly":
 
116
                        $from   = $MIN_YEAR;
 
117
                        $to     = date("Y");
 
118
                        array_unshift($header, new CCol(S_YEAR,"center"));
 
119
                        function get_time($y)   {       return mktime(0,0,0,1,1,$y);            }
 
120
                        function format_time($t){       return date("Y", $t);                   }
 
121
                        function format_time2($t){      return null; };
 
122
                        break;
 
123
                case "monthly":
 
124
                        $from   = 1;
 
125
                        $to     = 12;
 
126
                        array_unshift($header, new CCol(S_MONTH,"center"));
 
127
                        function get_time($m)   {       global $year;   return mktime(0,0,0,$m,1,$year);        }
 
128
                        function format_time($t){       return date("M Y",$t);                  }
 
129
                        function format_time2($t){      return null; };
 
130
                        break;
 
131
                case "dayly":
 
132
                        $from   = 1;
 
133
                        $to     = 365;
 
134
                        array_unshift($header, new CCol(S_DAY,"center"));
 
135
                        function get_time($d)   {       global $year;   return mktime(0,0,0,1,$d,$year);        }
 
136
                        function format_time($t){       return date("d M Y",$t);                }
 
137
                        function format_time2($t){      return null; };
 
138
                        break;
 
139
                case "weekly":
 
140
                default:
 
141
                        $from   = 0;
 
142
                        $to     = 52;
 
143
                        array_unshift($header,new CCol(S_FROM,"center"),new CCol(S_TILL,"center"));
 
144
                        function get_time($w)   {
 
145
                                global $year;   
 
146
 
 
147
                                $time   = mktime(0,0,0,1, 1, $year);
 
148
                                $wd     = date("w", $time);
 
149
                                $wd     = $wd == 0 ? 6 : $wd - 1;
 
150
 
 
151
                                return ($time + ($w*7 - $wd)*24*3600);
 
152
                        }
 
153
                        function format_time($t){       return date("d M Y H:i",$t);    }
 
154
                        function format_time2($t){      return format_time($t); };
 
155
                        break;
 
156
 
 
157
        }
 
158
 
 
159
        $table->SetHeader($header,"vertical_header");
 
160
 
 
161
        for($t = $from; $t <= $to; $t++)
 
162
        {       
 
163
                if(($start = get_time($t)) > time())
 
164
                        break;
 
165
                
 
166
                if(($end = get_time($t+1)) > time())
 
167
                        $end = time();
 
168
 
 
169
                $table_row = array(format_time($start),format_time2($end));
 
170
                foreach($users as $userid => $alias)
 
171
                {
 
172
                        $all = 0;
 
173
                        $cnt_by_type = array();
 
174
                        foreach($media_types as $mediatypeid => $description)
 
175
                        {
 
176
                                $cnt_data = DBfetch(DBselect("select count(*) as cnt from alerts a ".
 
177
                                        " where a.userid=".$userid." and a.mediatypeid=".$mediatypeid.
 
178
                                        " and clock>$start and clock<$end "));
 
179
                                if(!$cnt_data)  $cnt_data = 0;
 
180
                                else            $cnt_data = $cnt_data['cnt'];
 
181
                                array_push($cnt_by_type, $cnt_data);
 
182
                                $all += $cnt_data;
 
183
                        }
 
184
                        array_push($table_row,array($all, ($media_type == 0 ? SPACE."(".implode('/',$cnt_by_type).")" : "" )));
 
185
                }
 
186
                $table->AddRow($table_row);
 
187
        }
 
188
        $table->show();
 
189
        
 
190
        if($media_type == 0)
 
191
        {
 
192
                $table = new CTableInfo();
 
193
                $table->AddRow(new CSpan(SPACE.SPACE.SPACE.SPACE.SPACE.SPACE."all".SPACE."(".implode('/', $media_types).")","off"));
 
194
                $table->Show();
 
195
        }
 
196
?>
 
197
<?php
 
198
 
 
199
include_once "include/page_footer.php";
 
200
 
 
201
?>