说明：数据从2011-01-12开始，其他的没有统计，k表示1000的意思，10k就是1W
<br/>
<?php echo CHtml::link('查看详细推广记录', array('/admin/flux/reward'));?>
<?php echo CHtml::beginForm(array('/'.$this->route), 'get', array('name'=>'form'));?>
时间：<?php echo Operate::date('date');?> <?php echo CHtml::submitButton('查询');?>
<?php echo CHtml::endForm();?>
<?php
$path = Yii::getPathOfAlias('application.extensions.FusionCharts');
include($path.'/FusionCharts.php');
?>

<?php
$strXML = '';
$strXML .= "<graph xaxisname='' yaxisname='Export' hovercapbg='DEDEBE' hovercapborder='889E6D' rotateNames='0' yAxisMaxValue='100' numdivlines='9' divLineColor='CCCCCC' divLineAlpha='80' decimalPrecision='0' showAlternateHGridColor='1' AlternateHGridAlpha='30' AlternateHGridColor='CCCCCC' caption='一周推广流量统计' subcaption='时间：{$start} 到 {$end}' >";
$strXML .= "<categories font='Arial' fontSize='11' fontColor='000000'>
      <category name='周一' />
      <category name='周二' />
      <category name='周三' />
      <category name='周四' />
      <category name='周五' />
      <category name='周六' />
      <category name='周日' />
   </categories>";
$array = array(
    'pv' => array('总PV', '8BBA00'),
	'valid_pv' => array('手机PV', 'AFD8F8'),
    'uv' => array('总UV', 'F6BD0F'),
    'valid_uv' => array('手机UV', 'FF8E46'),
    'register' => array('注册用户', '008E8E'),
    'valid_u' => array('验证用户', 'D64646'),
);
$week = array();
foreach ($array as $k => $a)
{
    $strXML .= "<dataset seriesname='{$a[0]}' color='{$a[1]}'>";
    $i = 1;
    foreach ($flux as $f)
    {
        $strXML .= "<set value='".$f->$k ."' />";
        $week[$k][$i++] = $f->$k;
    }
    $strXML .= "</dataset>";
}
$strXML .= "</graph>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_MSColumn3D.swf", "", $strXML, "myFirst", 900, 500);
?>
<br/>
<?php 
$pvSum = $validPvSum = 0;
$pvSum = $week['pv'][1] + $week['pv'][2] + $week['pv'][3] + $week['pv'][4] + $week['pv'][5] + $week['pv'][6] + $week['pv'][7];
$validPvSum = $week['valid_pv'][1] + $week['valid_pv'][2] + $week['valid_pv'][3] + $week['valid_pv'][4] + $week['valid_pv'][5] + $week['valid_pv'][6] + $week['valid_pv'][7];
$pSum = $pvSum - $validPvSum;

$strXML = '';
$strXML .= "<chart caption='一周推广流量类型分布' subCaption='{$start} 到 {$end}' bgColor='#ffffff'>";
$strXML .= "<set label='手机流量' value='".$validPvSum."' />";
$strXML .= "<set label='非手机流量' value='".$pSum."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>

<?php
$uSum = $validUSum = 0;
$uSum = $week['register'][1] + $week['register'][2] + $week['register'][3] + $week['register'][4] + $week['register'][5] + $week['register'][6] + $week['register'][7];
$validUSum = $week['valid_u'][1] + $week['valid_u'][2] + $week['valid_u'][3] + $week['valid_u'][4] + $week['valid_u'][5] + $week['valid_u'][6] + $week['valid_u'][7];
$strXML = '';
$strXML .= "<chart caption='一周推广用户分布' subCaption='{$start} 到 {$end}' bgColor='#ffffff'>";
$strXML .= "<set label='注册用户' value='".$uSum."' />";
$strXML .= "<set label='验证用户' value='".$validUSum."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>

<?php
$strXML = '';
$strXML .= "<chart caption='一周推广流量分布' subCaption='{$start} 到 {$end}' bgColor='#ffffff'>";
$strXML .= "<set label='周一' value='".$week['pv'][1]."' />";
$strXML .= "<set label='周二' value='".$week['pv'][2]."' />";
$strXML .= "<set label='周三' value='".$week['pv'][3]."' />";
$strXML .= "<set label='周四' value='".$week['pv'][4]."' />";
$strXML .= "<set label='周五' value='".$week['pv'][5]."' />";
$strXML .= "<set label='周六' value='".$week['pv'][6]."' />";
$strXML .= "<set label='周日' value='".$week['pv'][7]."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>
<br/>
<?php
$strXML = '';
$strXML .= "<chart caption='一周推广手机流量分布' subCaption='{$start} 到 {$end}' showPercentValues='０' bgColor='#ffffff'>";
$strXML .= "<set label='周一' value='".$week['valid_pv'][1]."' />";
$strXML .= "<set label='周二' value='".$week['valid_pv'][2]."' />";
$strXML .= "<set label='周三' value='".$week['valid_pv'][3]."' />";
$strXML .= "<set label='周四' value='".$week['valid_pv'][4]."' />";
$strXML .= "<set label='周五' value='".$week['valid_pv'][5]."' />";
$strXML .= "<set label='周六' value='".$week['valid_pv'][6]."' />";
$strXML .= "<set label='周日' value='".$week['valid_pv'][7]."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>

<?php
$strXML = '';
$strXML .= "<chart caption='一周推广注册用户分布' subCaption='{$start} 到 {$end}' bgColor='#ffffff'>";
$strXML .= "<set label='周一' value='".$week['register'][1]."' />";
$strXML .= "<set label='周二' value='".$week['register'][2]."' />";
$strXML .= "<set label='周三' value='".$week['register'][3]."' />";
$strXML .= "<set label='周四' value='".$week['register'][4]."' />";
$strXML .= "<set label='周五' value='".$week['register'][5]."' />";
$strXML .= "<set label='周六' value='".$week['register'][6]."' />";
$strXML .= "<set label='周日' value='".$week['register'][7]."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>

<?php
$strXML = '';
$strXML .= "<chart caption='一周推广验证用户分布' subCaption='{$start} 到 {$end}' bgColor='#ffffff'>";
$strXML .= "<set label='周一' value='".$week['valid_u'][1]."' />";
$strXML .= "<set label='周二' value='".$week['valid_u'][2]."' />";
$strXML .= "<set label='周三' value='".$week['valid_u'][3]."' />";
$strXML .= "<set label='周四' value='".$week['valid_u'][4]."' />";
$strXML .= "<set label='周五' value='".$week['valid_u'][5]."' />";
$strXML .= "<set label='周六' value='".$week['valid_u'][6]."' />";
$strXML .= "<set label='周日' value='".$week['valid_u'][7]."' />";
$strXML .= "</chart>";
echo renderChartHTML("protected/extensions/FusionCharts/FCF_Pie2D.swf", "", $strXML, "myFirst", 300, 300);
?>