Location: PHPKode > projects > QuickTicket > quickticket/qti_stats_gt.php
<?php

// QuickTicket 2.3 build:20091102

include('qti_stats_inc.php');

// DISPLAY title & option

echo '<table class="hidden" cellspacing="0">';
echo '<tr class="hidden" style="vertical-align:middle;">';
echo '<td><h2>',$y-1,' - ',$y,($s>=0 ? ' ('.$oVIP->sections[$s].')' : ''),(empty($tag) ? '' : ', '.$L['With_tag'].' '.str_replace(';',' '.$L['or'].' ',$tag)),'</h2></td>',N;
if ( $oVIP->output=='screen' ) echo '<td class="small" style="text-align:right">',implode(' &middot; ',$arrMenuTime),'</td>';
echo '</tr></table>
';

// -----
// DISPLAY VALUES
// -----

// -----
foreach($arrYears as $y) {
// -----

// Display table header

echo '<table class="data_t" cellspacing="0">
<tr class="data_t">
<td class="th_o" style="width:85px">',$y,'</td>
<td class="th_o" style="width:14px">&nbsp;</td>
';
switch($ch['time'])
{
case 'q': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">Q',$i,'</td>'; } break;
case 'm': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">',$L['dateMM'][$i],'</td>'; } break;
case 'd': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">',str_replace(' ','<br/>',QTdatestr(DateAdd($strTendaysago,$i,'day'),'d M','')),'</td>'; } break;
}
echo '<td class="th_o" style="text-align:center;"><b>',($ch['time']=='d' ? '10 '.strtolower($L['Days']) : $L['Year']),'</b></td>
</tr>';

// DISPLAY TOPICS [value]

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Topics'],'</td>',N;
echo '<td class="th_o"><div style="margin:0 auto;background-color:'.($y==$intCurrentYear ? '#000066' : '#00AFFF').';width:8px;height:10px">&nbsp;</div></td>',N;
for ($intBt=1;$intBt<=$intMaxBt;$intBt++) 
{
  echo '<td class="td_o" style="text-align:center;">',(isset($arrT[$y][$intBt]) ? $arrT[$y][$intBt] : '&middot;'),'</td>',N;
}
echo '<td class="td_o" style="text-align:center;padding:5px;"><b>',$arrTs[$y],'</b></td></tr>',N;

// DISPLAY MESSAGES [value]

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Replys'],'</td>',N;
echo '<td class="th_o"><div style="margin:0 auto;background-color:'.($y==$intCurrentYear ? '#990099' : '#F1B8FF').';width:8px;height:10px">&nbsp;</div></td>',N;
for ($intBt=1;$intBt<=$intMaxBt;$intBt++) 
{
  echo '<td class="td_o" style="text-align:center;">',(isset($arrM[$y][$intBt]) ? $arrM[$y][$intBt] : '&middot;'),'</td>',N;
}
echo '<td class="td_o" style="text-align:center;padding:5px;"><b>',$arrMs[$y],'</b></td></tr>',N;

// DISPLAY USERS [value]

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Users'],'*</td>',N;
echo '<td class="th_o"><div style="margin:0 auto;background-color:'.($y==$intCurrentYear ? '#009999' : '#00E7B7').';width:8px;height:10px">&nbsp;</div></td>',N;
for ($intBt=1;$intBt<=$intMaxBt;$intBt++) 
{
  echo '<td class="td_o" style="text-align:center;">',(isset($arrU[$y][$intBt]) ? $arrU[$y][$intBt] : '&middot;'),'</td>',N;
}
echo '<td class="td_o" style="text-align:center;padding:5px;"><b>',$arrUs[$y],'</b></td></tr>',N;
echo '</table>
';

// -----
}
// -----

// -----
// DISPLAY TRENDS [value|percent]
// -----

// Table header

if ( $oVIP->output=='screen' ) echo '<p class="small" style="text-align:right">',implode(' &middot; ',$arrMenuTrend),'</p>';

echo '<table class="data_t" cellspacing="0">
<tr class="data_t">
<td class="th_o" style="width:85px">',$L['Trends'],'</td>
<td class="th_o" style="width:14px">&nbsp;</td>
';
switch($ch['time'])
{
case 'q': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">Q',$i,'</td>'; } break;
case 'm': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">',$L['dateMM'][$i],'</td>'; } break;
case 'd': for ($i=1;$i<=$intMaxBt;$i++) { echo '<td class="th_o" style="text-align:center;">',str_replace(' ','<br/>',QTdatestr(DateAdd($strTendaysago,$i,'day'),'d M','')),'</td>'; } break;
}
echo '<td class="th_o" style="text-align:center;"><b>',($ch['time']=='d' ? '10 '.strtolower($L['Days']) : $L['Year']),'</b></td>
</tr>';

// Topics trends

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Topics'],'</td>',N;
echo '<td class="th_o">&nbsp;</td>',N;

for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
{
  $str = '0';
  $i = QTtrend((isset($arrT[$y][$intBt]) ? $arrT[$y][$intBt] : 0),(isset($arrT[$y-1][$intBt]) ? $arrT[$y-1][$intBt] : 0),$ch['trend']=='p');
  if ( isset($i) )
  {
    if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
    if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  }
  else
  {
    $str = '&middot;';
  }
  echo '<td class="td_o" style="text-align:center;">',$str,'</td>',N;  
}

$str = '0';
$i = QTtrend($arrTs[$y],$arrTs[$y-1],$ch['trend']=='p');
if ( isset($i) )
{
  if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
}
else
{
  $str = '&middot;';
}
echo '<td class="td_o" style="text-align:center;"><b>',$str,'</b></td></tr>',N;

// Replies trends

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Replys'],'</td>',N;
echo '<td class="th_o">&nbsp;</td>',N;

for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
{
  $str = '0';
  $i = QTtrend((isset($arrM[$y][$intBt]) ? $arrM[$y][$intBt] : 0),(isset($arrM[$y-1][$intBt]) ? $arrM[$y-1][$intBt] : 0),$ch['trend']=='p');
  if ( isset($i) )
  {
    if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
    if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  }
  else
  {
    $str = '&middot;';
  }
  echo '<td class="td_o" style="text-align:center;">',$str,'</td>',N;  
}

$str = '0';
$i = QTtrend($arrMs[$y],$arrMs[$y-1],$ch['trend']=='p');
if ( isset($i) )
{
  if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
}
else
{
  $str = '&middot;';
}
echo '<td class="td_o" style="text-align:center;"><b>',$str,'</b></td></tr>',N;

// Users trends

echo '<tr class="data_o">',N;
echo '<td class="th_o">',$L['Users'],'*</td>',N;
echo '<td class="th_o">&nbsp;</td>',N;

for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
{
  $str = '0';
  $i = QTtrend((isset($arrU[$y][$intBt]) ? $arrU[$y][$intBt] : 0),(isset($arrU[$y-1][$intBt]) ? $arrU[$y-1][$intBt] : 0),$ch['trend']=='p');
  if ( isset($i) )
  {
    if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
    if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  }
  else
  {
    $str = '&middot;';
  }
  echo '<td class="td_o" style="text-align:center;">',$str,'</td>',N;  
}

$str = '0';
$i = QTtrend($arrUs[$y],$arrUs[$y-1],$ch['trend']=='p');
if ( isset($i) )
{
  if ( $i>0 ) $str = '<span style="color:red">'.'+'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
  if ( $i<0 ) $str = '<span style="color:green">'.$i.($ch['trend']=='p' ? '%' : '').'</span>';
}
else
{
  $str = '&middot;';
}
echo '<td class="td_o" style="text-align:center;"><b>',$str,'</b></td></tr>',N;

echo '</table>
';

echo '<p>*  <span class="small">',$L['Distinct_users'],'</span></p>
';

// After values display change the null values to zero to be able to make charts

foreach($arrYears as $y)
{
$arrT[$y] = QTarrayzero($arrT[$y]);
$arrM[$y] = QTarrayzero($arrM[$y]);
$arrU[$y] = QTarrayzero($arrU[$y]);
}

// -----
// GRAPH
// -----

if ( file_exists('pChart/pChart.class') && file_exists('pChart/pData.class') && file_exists('pChart/pCache.class') && !isset($_GET['oldgraph']) )
{
  // abscise Label
  $arrA = array();
  switch($ch['time'])
  {
  case 'q': for ($i=1;$i<=$intMaxBt;$i++) { $arrA[$i]='Q'.$i; } break;
  case 'm': for ($i=1;$i<=$intMaxBt;$i++) { $arrA[$i]=$L['dateMM'][$i]; } break;
  case 'd': for ($i=1;$i<=$intMaxBt;$i++) { $arrA[$i]=substr(DateAdd($strTendaysago,$i,'day'),-2,2); } break;
  }

  // Standard inclusions and prepare CACHE
  include('pChart/pData.class');
  include('pChart/pChart.class');
  include('pChart/pCache.class');
  $Cache = new pCache('pChart/Cache/');

  // Check cache
  $intHandle = opendir('pChart/Cache');
  $i = 0;
  while ( false!==($strFile = readdir($intHandle)) ) $i++;
  closedir($intHandle);
  // clear cache if to much files
  if ( $i>60 || isset($_GET['clearcache']) ) $Cache->ClearCache();
  
  // -------
  // Graph 1  [value]
  // -------

  // Dataset definition
  $strName = $tt.'1'.$y.implode('',$ch);
  $DataSet = new pData;
  $DataSet->AddPoint($arrT[$y-1],'Serie1');
  $DataSet->AddPoint($arrT[$y],'Serie2');
  $DataSet->AddPoint($arrA,'Serie3');
  $DataSet->AddSerie('Serie1');
  $DataSet->AddSerie('Serie2');
  $DataSet->SetSerieName($y-1,'Serie1');
  $DataSet->SetSerieName($y,'Serie2');
  $DataSet->SetAbsciseLabelSerie('Serie3');
  $intTopY = QTroof( array(max($arrT[$y-1]),max($arrT[$y])) );

  if ( !$Cache->IsInCache($strName,$DataSet->GetData()) )
  {    
    // Initialise the graph 
    $oChart = new pChart(600,230);
    $oChart->setColorPalette(0,0,175,255); //color color1b
    $oChart->setColorPalette(1,0,0,102); //color 1
    $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',8);
    $oChart->setGraphArea(40,35,560,195);
    $oChart->setFixedScale(0,$intTopY);
    $oChart->drawFilledRoundedRectangle(7,7,593,223,5,240,240,240);
    $oChart->drawGraphArea(255,255,255,TRUE);
    $oChart->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,125,125,125,TRUE,0,0,TRUE);
    $oChart->drawGrid(4,TRUE,230,230,230,50);

    // Draw the line/bar graph
    if ( strtolower($ch['type'])=='l' )
    {
    $oChart->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),40,TRUE);
    $oChart->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
    }
    else
    {
    $oChart->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE);
    }

    // label with the trend
    if ( $ch['type']=='B' || $ch['type']=='L' )
    {
      $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',7);
      for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
      {
      $i = QTtrend((isset($arrT[$y][$intBt]) ? $arrT[$y][$intBt] : 0),(isset($arrT[$y-1][$intBt]) ? $arrT[$y-1][$intBt] : 0),$ch['trend']=='p');
      if ( $i>0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],'+'.$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      if ( $i<0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      }
    }
    
    // Finish the graph
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",10);
    $oChart->drawTitle(40,25,$L['Topics_per_'.$ch['time']].($ch['value']=='p' ? ' (%)' : ''),50,50,50,560);
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",9);
    $oChart->drawLegend(520,18,$DataSet->GetDataDescription(),255,255,255);
    $Cache->WriteToCache($strName,$DataSet->GetData(),$oChart);
    $oChart->Render('pChart/tmp/'.$strName.'.png');
  }
  
  // -------
  // Graph 2
  // -------

  // Dataset definition
  $strName = $tt.'2'.$y.implode('',$ch);
  $DataSet = new pData;
  $DataSet->AddPoint($arrM[$y-1],'Serie1');
  $DataSet->AddPoint($arrM[$y],'Serie2');
  $DataSet->AddPoint($arrA,'Serie3');
  $DataSet->AddSerie('Serie1');
  $DataSet->AddSerie('Serie2');
  $DataSet->SetSerieName($y-1,'Serie1');
  $DataSet->SetSerieName($y,'Serie2');
  $DataSet->SetAbsciseLabelSerie('Serie3');
  $intTopY = QTroof( array(max($arrM[$y-1]),max($arrM[$y])) );
  
  if ( !$Cache->IsInCache($strName,$DataSet->GetData()) )
  {    
    // Initialise the graph 
    $oChart = new pChart(640,230);
    $oChart->setColorPalette(0,241,184,255); //color 2b
    $oChart->setColorPalette(1,153,0,153); //color 2
    $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',8);
    $oChart->setGraphArea(40,35,560,195);
    $oChart->setFixedScale(0,$intTopY);
    $oChart->drawFilledRoundedRectangle(7,7,593,223,5,240,240,240);
    $oChart->drawGraphArea(255,255,255,TRUE);
    $oChart->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,125,125,125,TRUE,0,0,TRUE);
    $oChart->drawGrid(4,TRUE,230,230,230,50);

    // Draw the line/bar graph
    if ( strtolower($ch['type'])=='l' )
    {
    $oChart->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),40,TRUE);
    $oChart->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
    }
    else
    {
    $oChart->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE);
    }

    // label with the trend
    if ( $ch['type']=='B' || $ch['type']=='L' )
    {
      $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',7);
      for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
      {
      $i = QTtrend((isset($arrM[$y][$intBt]) ? $arrM[$y][$intBt] : null),(isset($arrM[$y-1][$intBt]) ? $arrM[$y-1][$intBt] : 0),$ch['trend']=='p');
      if ( $i>0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],'+'.$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      if ( $i<0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      }
    }    
    // Finish the graph
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",10);
    $oChart->drawTitle(40,25,$L['Replies_per_'.$ch['time']].($ch['value']=='p' ? ' (%)' : ''),50,50,50,560);
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",9);
    $oChart->drawLegend(520,18,$DataSet->GetDataDescription(),255,255,255);
    $Cache->WriteToCache($strName,$DataSet->GetData(),$oChart);
    $oChart->Render('pChart/tmp/'.$strName.'.png');
  }
  
  // -------
  // Graph 3
  // -------

  // Dataset definition
  $strName = $tt.'3'.$y.implode('',$ch);
  $DataSet = new pData;
  $DataSet->AddPoint($arrU[$y-1],'Serie1');
  $DataSet->AddPoint($arrU[$y],'Serie2');
  $DataSet->AddPoint($arrA,'Serie3');
  $DataSet->AddSerie('Serie1');
  $DataSet->AddSerie('Serie2');
  $DataSet->SetSerieName($y-1,'Serie1');
  $DataSet->SetSerieName($y,'Serie2');
  $DataSet->SetAbsciseLabelSerie('Serie3');
  $intTopY = QTroof( array(max($arrU[$y-1]),max($arrU[$y])) );

  if ( !$Cache->IsInCache($strName,$DataSet->GetData()) )
  {    
    // Initialise the graph 
    $oChart = new pChart(640,230);
    $oChart->setColorPalette(0,0,231,183); //color 3b
    $oChart->setColorPalette(1,0,153,153); //color 3
    $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',8);
    $oChart->setGraphArea(40,35,560,195);
    $oChart->setFixedScale(0,$intTopY);
    $oChart->drawFilledRoundedRectangle(7,7,593,223,5,240,240,240);
    $oChart->drawGraphArea(255,255,255,TRUE);
    $oChart->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,125,125,125,TRUE,0,0,TRUE);
    $oChart->drawGrid(4,TRUE,230,230,230,50);

    // Draw the line/bar graph
    if ( strtolower($ch['type'])=='l' )
    {
    $oChart->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),40,TRUE);
    $oChart->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
    }
    else
    {
    $oChart->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE);
    }

    // label with the trend
    if ( $ch['type']=='B' || $ch['type']=='L' )
    {
      $oChart->setFontProperties('pChart/Fonts/tahoma.ttf',7);
      for ($intBt=1;$intBt<=$intMaxBt;$intBt++)
      {
      $i = QTtrend((isset($arrU[$y][$intBt]) ? $arrU[$y][$intBt] : null),(isset($arrU[$y-1][$intBt]) ? $arrU[$y-1][$intBt] : 0),$ch['trend']=='p');
      if ( $i>0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],'+'.$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      if ( $i<0 ) $oChart->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),'Serie2',$arrA[$intBt],$i.($ch['trend']=='p' ? '%' : ''),220,220,220);
      }
    }
    
    // Finish the graph
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",10);
    $oChart->drawTitle(40,25,$L['Users_per_'.$ch['time']].($ch['value']=='p' ? ' (%)' : ''),50,50,50,560);
    $oChart->setFontProperties("pChart/Fonts/tahoma.ttf",9);
    $oChart->drawLegend(520,18,$DataSet->GetDataDescription(),255,255,255);
    $Cache->WriteToCache($strName,$DataSet->GetData(),$oChart);
    $oChart->Render('pChart/tmp/'.$strName.'.png');
  }
  
  // -------
  // DISPLAY
  // -------

  echo '<div style="margin:0 auto; width:600px">',N;
  if ( $oVIP->output=='screen' ) echo '<p class="small" style="text-align:right">',implode(' &middot; ',$arrMenuType),'</p>';
  echo '<img src="pChart/tmp/'.$tt.'1'.$y.implode('',$ch).'.png"/><br/>';
  echo '<img src="pChart/tmp/'.$tt.'2'.$y.implode('',$ch).'.png"/><br/>';
  echo '<img src="pChart/tmp/'.$tt.'3'.$y.implode('',$ch).'.png"/><br/>';
  echo '</div>',N;

}
elseif ( file_exists('bin/qt_lib_graph.php') && file_exists($_SESSION[QT]['skin_dir'].'/qti_main2.css') )
{

  if ( $oVIP->output=='screen' ) echo '<p class="small" style="text-align:right">',implode(' &middot; ',$arrMenuValue),'</p>';

  // TOPIC first serie
  
  $intTopY = QTroof( array(max($arrT[$y-1]),max($arrT[$y])) );
  
  echo '<table class="data_t" cellspacing="0">',N;
  echo '<tr class="data_t">',N;
  echo '<td class="td_o" style="width:355px">',N;
  
  if ( $ch['value']=='p' ) 
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrT[$y-1])),350,100,$intTopY,2,'P',$L['Topics_per_'.$ch['time']].' (%)'.' '.($y-1));
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,$arrT[$y-1]),320,100,$intTopY,2,true,$L['Topics_per_'.$ch['time']].' '.($y-1));
  }

  echo '</td>',N;  
  echo '<td class="td_o">&nbsp;</td>',N;
  echo '<td class="td_o" style="width:355px">',N;

  // TOPIC second serie

  if ( $ch['value']=='p' ) 
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrT[$y])),350,100,$intTopY,2,'P',$L['Topics_per_'.$ch['time']].' (%)'.' '.$y);
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,$arrT[$y]),320,100,$intTopY,2,true,$L['Topics_per_'.$ch['time']].' '.$y);
  }

  echo '</td>',N;
  echo '</tr>',N;

  // MESSAGE first serie
  
  $intTopY = QTroof( array(max($arrM[$y-1]),max($arrM[$y])) );
  
  echo '<tr class="data_o">',N;
  echo '<td class="td_o" style="width:355px">',N;
  
  if ( $ch['value']=='p' ) 
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrM[$y-1])),350,100,$intTopY,2,'P',$L['Replies_per_'.$ch['time']].' (%)'.' '.($y-1),'','2');
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,$arrM[$y-1]),320,100,$intTopY,2,true,$L['Replies_per_'.$ch['time']].' '.($y-1),'','2');
  }

  echo '</td>',N;  
  echo '<td class="td_o">&nbsp;</td>',N;
  echo '<td class="td_o" style="width:355px">',N;

  // MESSAGE second serie

  if ( $ch['value']=='p' ) 
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrM[$y])),350,100,$intTopY,2,'P',$L['Replies_per_'.$ch['time']].' (%)'.' '.$y,'','2');
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,$arrM[$y]),320,100,$intTopY,2,true,$L['Replies_per_'.$ch['time']].' '.$y,'','2');
  }

  echo '</td>',N;
  echo '</tr>',N;

  // USER first serie
  
  $intTopY = QTroof( array(max($arrU[$y-1]),max($arrU[$y])) );
  
  echo '<tr class="data_o">',N;
  echo '<td class="td_o" style="width:355px">',N;
  
  if ( $ch['value']=='a' ) 
  {
  QTbarchart(QTarraymerge($arrA,$arrU[$y-1]),320,100,$intTopY,2,true,$L['Users_per_'.$ch['time']].' '.($y-1),'','3');
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrU[$y-1])),350,100,$intTopY,2,'P',$L['Users_per_'.$ch['time']].' (%)'.' '.($y-1),'','3');
  }

  echo '</td>',N;  
  echo '<td class="td_o">&nbsp;</td>',N;
  echo '<td class="td_o" style="width:355px">',N;

  // USER second serie

  if ( $ch['value']=='a' ) 
  {
  QTbarchart(QTarraymerge($arrA,$arrU[$y]),320,100,$intTopY,2,true,$L['Users_per_'.$ch['time']].' '.$y,'','3');
  }
  else
  {
  QTbarchart(QTarraymerge($arrA,QTpercent($arrU[$y])),350,100,$intTopY,2,'P',$L['Users_per_'.$ch['time']].' (%)'.' '.$y,'','3');
  }

  echo '</td>',N;
  echo '</tr></table>',N;

}
else
{
  echo '<p class="small">Graphs cannot be displayed because one of these files is missing: bin/qt_lib_graph.php, ',$_SESSION[QT]['skin_dir'].'/qti_main2.css</p>';
}

?>
Return current item: QuickTicket