Removed my own validation source in favour of Ardent.

This commit is contained in:
James Cole
2014-07-15 17:09:59 +02:00
parent a1fb4bdb60
commit aa36e8b7cf
17 changed files with 212 additions and 163 deletions

View File

@@ -19,11 +19,16 @@ class ChartController extends BaseController
/**
* Show home charts.
*/
public function homeAccount($account = null)
public function homeAccount($id = null)
{
list($start, $end) = tk::getDateRange();
$current = clone $start;
$return = [];
$account = null;
if(!is_null($id)) {
$account = $this->accounts->find($id);
}
if (is_null($account)) {
$accounts = $this->accounts->getActiveDefault();
@@ -40,14 +45,8 @@ class ChartController extends BaseController
$current->addDay();
}
} else {
// do something experimental:
$account = $this->accounts->find($account);
if (is_null($account)) {
return View::make('error')->with('message', 'No account found.');
}
$return[0] = ['name' => $account->name, 'data' => []];
while ($current <= $end) {
$return[0]['data'][] = [$current->timestamp * 1000, $account->balance(clone $current)];