{include file="$admin_template_path/html/header.html"}
</head>
<body>
{include file="$admin_template_path/html/pagetops.html"}
{if $errorMessage}
<div id="errormsg">
<div class="msg">
  <div class="closebtn"><i data-icon="" class="icon-close"></i></div>
  {$errorMessage}
</div>
</div>
{literal}
<script type="text/javascript">
seajs.use(["modules/pageui/msg"], function(msg){
    msg.msginit("#errormsg");
});
</script>
{/literal}
{/if}

<div class="pagebg">
  	<div class="mcontent pagemain clr">
	    {include file="$admin_template_path/html/leftmenu.html"}
	    <div class="pagemainconent">

		<div class="rightdetail_admin">
			<div id="finance_chart" class="reportblock"></div>
			{if $updated_items}
			<div id="sales_chart" class="reportblock"></div>
			{/if}
			{if $lastContact}
			<h2 class="pagetit text-black">支持中心</h2>
			<table class="general_table">
				<tbody>
				{foreach from=$lastContact item=i}
				<tr><td><a href="?m=contacts&c=view&id={$i.id}">有新消息需要处理：</a>{$i.name}</td></tr>
				{/foreach}
				</tbody>
			</table>
			{/if}
			{if $items}
			<h2 class="pagetit text-black">待审核的新作品</h2>
			<table class="general_table">
				<tbody>
				{foreach from=$items item=i}
				<tr><td><a href="?m=items&c=queue_view&id={$i.id}" title="">{$i.name}</td></tr>
				{/foreach}
				</tbody>
			</table>
			{/if}
			{if $updated_items}
			<h2 class="pagetit text-black">待审核的作品更新</h2>
			<table class="general_table">
				<tbody>
				{foreach from=$updated_items item=i}
				<tr><td><a href="?m=items&c=queue_view_update&id={$i.id}" title="">{$i.name}</td></tr>
				{/foreach}
				</tbody>
			</table>
			{/if}
			<h2 class="pagetit text-black">本月收入情况统计</h2>
			<table class="general_table">	
				<tbody>
				<tr>
				<td>本月毛收入</td>
				<td class="ta-right"></td>
				<td class="ta-right">{$currency.symbol} {$sales.total|string_format:"%.2f"}</td>
				</tr>
				<tr>
				<td>本月用户分成</td>
				<td class="ta-right"></td>
				<td class="ta-right">{$currency.symbol} {$sales.receive|string_format:"%.2f"}</td>
				</tr>
				<tr>
				<td><strong>本月净收入</strong></td>
				<td class="ta-right"></td>
				<td class="ta-right"><strong style="color: {if $sales.win > 0}green{else}red{/if};">{$currency.symbol} {$sales.win|string_format:"%.2f"}</strong></td>
				</tr>
				</tbody>
			</table>
		</div>
		
		</div>
	</div>
</div>

{literal}
<script type="text/javascript">
seajs.use(["modules/pageui/admin"], function(admin){
	var
	settings1 = {
		credits: {
			enabled: false
		},
		chart: {
			renderTo: 'finance_chart', 
			defaultSeriesType: 'area'
		},	
		legend: {
			align: 'center',
			verticalAlign: 'top',
			y: 0,
			floating: false,
			borderWidth: 0
		},			
		title: {
			text: ""
		},
		xAxis: {
			categories: {/literal}{$days}{literal}
		},
		yAxis: {
			title: {
				text: ''
			},
			min: 0
		},
		plotOptions: {
			area: {
				marker: {
					enabled: false,
					symbol: 'circle',
					radius: 2,
					states: {
						hover: {
							enabled: true
						}
					}
				}
			}
		},
		tooltip: {
			shared: true,
			crosshairs: true,
			valueSuffix: ' {/literal}{$valuta}{literal}',
			headerFormat: '{/literal}{$smarty.now|date_format:"%Y-%m"}{literal}-{point.key}<br />'
		},
		series: {/literal}{$finance_array}{literal}
	},
	settings2 = {
		credits: {
			enabled: false
		},
		legend: { 
			align: 'center',
			verticalAlign: 'top',
			y: 0,
			floating: false,
			borderWidth: 0
		},		
		chart: {
			renderTo: 'sales_chart', 
			defaultSeriesType: 'area'
		},				
		title: {
			text: ""
		},
		xAxis: {
			categories: {/literal}{$days}{literal}
		},
		yAxis: {
			title: {
				text: ''
			},
			min: 0
		},
		tooltip: {
			shared: true,
			crosshairs: true,
			headerFormat: '{/literal}{$smarty.now|date_format:"%Y-%m"}{literal}-{point.key}<br />'
		},
		series: {/literal}{$sales_array}{literal}
	};
	admin.idxChartInit([settings1, settings2]);
});
</script>
{/literal}
</body>
</html>