Subversion Repositories wpShopGermany4

Rev

Rev 2304 | 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'); ?>

<?php 

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

                $this->view['month'] = 0;
                $this->view['year'] = 0;

                $i = 0;
                $j = 0; 

                foreach ($this->view['chart']['data']['records'] as $data)
                {
                        
                        $this->view['chart']['month'] = $data['month'];
                        $this->view['chart']['year'] = $data['year'];

                        $series = "{";
                        
                        if (isset($this->view['chart']['data']['label']))
                        {
                                $series .= "label:'".$this->view['chart']['data']['label'].' '.$data['year']."',";
                        }
                        else
                        {
                                $series .= "label:'KW ".date('W', strtotime($data['day'].'.'.$data['month'].'.'.$data['year']))." ".$data['year']."', ";        
                        }
                        
                        $series .= "    highlighter: {";
                        
                        $series .= "            formatString: '<table><tr><td>%s ".$data['year'].", %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
                        
                        $series .= "    }";
                        
                        $series .= "}";
                        
                        if (!in_array($series, (array)$chartJS['legend']) || !isset($chartJS['legend'][$i]))
                        {
                                $chartJS['legend'][$i] = $series;
                        }
                        
                        $chartJS['week'] .= "['".$data['year'].'/'.$data['month'].'/'.$data['day']."', ".wpsg_hspc($data['total'])."], ";  
                        
                        if ($j == count($this->view['chart']['data']['records']) - 1) { 
                                $chartJS['week'] = 'var week = ['.substr($chartJS['week'], 0, -2).'];'; 
                        }
                        
                        $j++;

                }

        } 
        
?>
<?php if ($chartJS['week'] != '') { ?>
<div id="chartannualturnover-line" style="height:500px; width:800px;"></div>

<script type="text/javascript">


jQuery(document).ready(function(){
          <?php echo $chartJS['week']; ?>
                
          var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [week], {
                  animate: true,
                  axesDefaults: {
                    labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
                  },
                  series:[
                        <?php echo implode(', ', $chartJS['legend']); ?>
          ],
          legend: {
            show: true,
            placement: 'outsideGrid'
          },
              axes:{
                xaxis:{
                        renderer:jQuery.jqplot.DateAxisRenderer,
                        label:'<?php echo __('Tag', 'wpsg'); ?>',
                        tickOptions:{formatString:'%d.%m.%Y'},
                        tickInterval: '1 day',
                        min:'<?php echo date('Y', $this->view['chart']['data']['firstdayofweek']); ?>/<?php echo date('m', $this->view['chart']['data']['firstdayofweek']); ?>/<?php echo date('d', $this->view['chart']['data']['firstdayofweek']); ?>',
                        max:'<?php echo date('Y', $this->view['chart']['data']['lastdayofweek']); ?>/<?php echo date('m', $this->view['chart']['data']['lastdayofweek']); ?>/<?php echo date('d', $this->view['chart']['data']['lastdayofweek']); ?>'
                },
                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 } ?>