Subversion Repositories wpShopGermany4

Rev

Rev 2350 | Rev 4943 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>

<br /><br />
<?php 

        if (wpsg_isSizedArray($this->view['chart']['data'])) 
        {

                for ($i = 0; $i < count($this->view['chart']['data']); $i++)
                {
                        
                        $chartJS['legend'][$i] = "{";
                        
                        if (isset($this->view['chart']['data'][$i]['label']))
                        {
                                $chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
                        }
                        
                        $chartJS['legend'][$i] .= "     highlighter: {";
                        
                        $chartJS['legend'][$i] .= "             formatString: '<table><tr><td>KW %s ".$this->view['chart']['data'][$i]['year'].", %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
                        
                        $chartJS['legend'][$i] .= "     }";
                        
                        $chartJS['legend'][$i] .= "}";
                        
                        $j = 0;
                        
                        foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
                        {
                                
                                //immer das Datum vom Rootelement nutzen
                                $k = 0 ;
                                
                                foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
                                {
                                        if ($j == $k)
                                        {
                                                if ($record['week'] <= (int)date_i18n('W') || $record['year'] < date_i18n('Y'))
                                                {
                                                        $chartJS['area']['area'.$i][] = "['".$j."', ".wpsg_hspc($record['total'])."]";  
                                                
                                                        
                                                }
                                                $chartJS['ticks']['ticks'.$i][] = '['.$j.', \'KW '.$record['week'].'\']'; 
                                        }       
                                        $k++;
                                }
                        
                                if ($j == count($this->view['chart']['data'][$i]['records']) - 1) { 
                                        $chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']'; 
                                }
                                
                                $j++;
                        } 
                        
                }

        } 
        
?>

<?php if ($chartJS['area'] != '') { ?>
<div id="chartannualturnover-line" style="height:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_width'); ?>px;"></div>

<br />

<div id="table-data">
        <?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?> 
</div>

<div class="wpsg_clearer"></div>

<script type="text/javascript">


jQuery(document).ready(function(){
          <?php foreach ($chartJS['area'] as $index => $area) { ?>
                 var <?php echo $index; ?> = <?php echo $area; ?>;
          <?php } ?>
                
          var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
                  animate: true,
                  axesDefaults: {
                    labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
                  },
                  series:[
                        <?php echo implode(', ', $chartJS['legend']); ?>
          ],
          legend: {
            show: true,
            placement: 'outside'
          },
              axes:{
                xaxis:{
                        label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
                        syncTicks: false,
                        tickOptions:{formatString:'KW %d'},
                        ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
                },
                yaxis:{
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
                tickOptions: {
                        formatter: wpsg_statistics_number_format
                },
                        min:0
            }
              },
              highlighter: {
                    show: true
              }
          });

          wpsg_statistic_addExportButton();
          
});
</script>
<?php } else { ?>
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
<?php } ?>