<?php 

$shops = array();

foreach($this->shops as $item){
	$shops[] = $item['shop_id'];
}

if(empty($shops)){
	$statsStatus = false;
}

$stats = $this->getStatsWeek($shops);
$statsBalance[1] = 0;
$statsBalance[2] = 0;

$statsBalance[1] = $this->getBalanceAll("today", $shops); // $statsBalance[1][0]
$statsBalance[2] = $this->getBalanceAll("s", $shops); // $statsBalance[2][0]
$statsBalance[3] = $this->getBalanceAll("today2", $shops); // $statsBalance[2][0]
$statsBalance[4] = $this->getBalanceAll("s2", $shops); // $statsBalance[2][0]

$this->view(array("theme/_common/_header", "theme/index", "theme/_common/_footer"), array("user" => $this->user, "shops" => $this->shops, "stats" => $stats, "statsStatus" => $statsStatus, 'statsBalance' => $statsBalance)); 