public function showAll() { $key = cacheKey('Transfers', 'showAll'); if (Cache::has($key)) { $data = Cache::get($key); } else { $data = array(); $transf = Auth::user()->transfers()->leftJoin('categories', 'categories.id', '=', 'category_id')->leftJoin('accounts as af', 'af.id', '=', 'account_from')->leftJoin('accounts as at', 'at.id', '=', 'account_to')->leftJoin('budgets', 'budgets.id', '=', 'budget_id')->leftJoin('targets', 'targets.id', '=', 'target_id')->orderBy('transfers.date', 'DESC')->orderBy('transfers.created_at', 'DESC')->get(array('transfers.id', 'category_id', 'categories.name AS category_name', 'account_to', 'at.name AS account_to_name', 'account_from', 'af.name AS account_from_name', 'budget_id', 'budgets.name AS budget_name', 'target_id', 'targets.description AS target_description', 'transfers.date', 'transfers.description', 'transfers.amount')); foreach ($transf as $t) { $month = new Carbon($t->date); $strMonth = $month->format('F Y'); $data[$strMonth] = isset($data[$strMonth]) ? $data[$strMonth] : array(); $strDate = $month->format('d F Y'); $current = array('id' => intval($t->id), 'date' => $strDate, 'description' => Crypt::decrypt($t->description), 'amount' => mf(floatval($t->amount)), 'account_to' => $t->account_to, 'account_to_name' => Crypt::decrypt($t->account_to_name), 'account_from' => $t->account_from, 'account_from_name' => Crypt::decrypt($t->account_from_name), 'budget_id' => $t->budget_id, 'budget_name' => is_null($t->budget_id) ? null : Crypt::decrypt($t->budget_name), 'target_id' => $t->target_id, 'target_description' => is_null($t->target_id) ? null : Crypt::decrypt($t->target_description), 'category_id' => $t->category_id, 'category_name' => is_null($t->category_id) ? null : Crypt::decrypt($t->category_name)); $data[$strMonth][] = $current; } //Cache::put($key, $data, 4000); } return View::make('transfers.all')->with('transfers', $data); }
public function showAll() { $key = cacheKey('Transactions', 'showAll'); if (Cache::has($key)) { $data = Cache::get($key); } else { $data = array(); $trans = Auth::user()->transactions()->leftJoin('accounts', 'accounts.id', '=', 'account_id')->leftJoin('budgets', 'budgets.id', '=', 'budget_id')->leftJoin('categories', 'categories.id', '=', 'category_id')->leftJoin('beneficiaries', 'beneficiaries.id', '=', 'beneficiary_id')->orderBy('transactions.date', 'DESC')->get(array('transactions.id', 'account_id', 'accounts.name AS account_name', 'budget_id', 'budgets.name AS budget_name', 'category_id', 'categories.name AS category_name', 'beneficiary_id', 'beneficiaries.name AS beneficiary_name', 'transactions.date', 'description', 'transactions.amount', 'onetime')); foreach ($trans as $t) { $month = new Carbon($t->date); $strMonth = $month->format('F Y'); $data[$strMonth] = isset($data[$strMonth]) ? $data[$strMonth] : array(); $date = new Carbon($t->date); $strDate = $date->format('d F Y'); $current = array('id' => intval($t->id), 'date' => $strDate, 'description' => Crypt::decrypt($t->description), 'amount' => mf(floatval($t->amount)), 'onetime' => $t->onetime == 1 ? true : false, 'account_id' => $t->account_id, 'account_name' => Crypt::decrypt($t->account_name), 'budget_id' => $t->budget_id, 'budget_name' => !is_null($t->budget_name) ? Crypt::decrypt($t->budget_name) : null, 'beneficiary_id' => $t->beneficiary_id, 'beneficiary_name' => !is_null($t->beneficiary_name) ? Crypt::decrypt($t->beneficiary_name) : null, 'category_id' => $t->category_id, 'category_name' => !is_null($t->category_name) ? Crypt::decrypt($t->category_name) : null); $data[$strMonth][] = $current; } Cache::put($key, $data, 1440); } return View::make('transactions.all')->with('transactions', $data); }
<body> _PREFACE; $footer = <<<_FOOTER <p><b>Generated at: %s</b></p> </body> </html> _FOOTER; if ($_SERVER['argc'] < 2) { die("Usage: {$_SERVER['argv'][0]} <file>[ <file> ...]\n"); } $TOC = array(); printf($preface, basename(getcwd())); foreach (array_slice($_SERVER['argv'], 1) as $fp) { foreach (glob($fp) as $f) { if (mf($f, $m)) { e("\nAnalyzing %s\n", basename($f)); printf("<h1 id=\"%s\">%s</h1>\n", basename($f), basename($f)); foreach ($m[1] as $i => $p) { e("Documenting {$p}\n"); if ($o = preg_match('/^(.*), (.*)$/', $m[4][$i], $n)) { if ($n[2] == '__construct') { printf("<h2 id=\"%s\" class=\"o\">%s</h2>\n", $n[1], $n[1]); } $TOC[basename($f)][$n[1]][$n[2]] = $n[1] . '::' . $n[2] . '()'; printf("<h%d id=\"%s\">%s</h%d>\n", 3, $n[1] . '_' . $n[2], $p, 3); } else { $TOC[basename($f)][$m[4][$i]] = $m[4][$i] . '()'; printf("<h%d id=\"%s\">%s</h%d>\n", 2, $m[4][$i], $p, 2); } print ff($m[3][$i]) . "\n";
function mChar($p) { return mByte(mf($p, 0)) . mByte(mf($p, 8)); }
echo HTML::Link('/home/account/overview/' . $account['id'], $account['name']); ?> </td> <td> <?php if ($account['balance'] > 0) { ?> <span class="text-success"><?php echo mf($account['balance']); ?> </span> <?php } else { ?> <span class="text-error"><?php echo mf($account['balance']); ?> </span> <?php } ?> </td> <td> <a href="/home/account/edit/<?php echo $account['id']; ?> " class="btn"><i class="icon-pencil"></i> Edit <?php echo $account['name']; ?> </a> </td><td>
public function showAll() { $key = cacheKey('Targets', 'showAll'); if (Cache::has($key)) { $data = Cache::get($key); } else { $data = array(); $targets = Auth::user()->targets()->orderBy('closed')->get(); foreach ($targets as $t) { $daily = $t->guide(null, false); $left = floatval($t->amount) - $t->hassaved(); $start = new Carbon($t->startdate); $due = $t->duedate == null ? null : new Carbon($t->duedate); $duestr = is_null($due) ? '-' : $due->format('j F Y'); $target = array('id' => $t->id, 'description' => Crypt::decrypt($t->description), 'amount' => mf($t->amount), 'current' => mf($t->hassaved()), 'should' => mf($t->shouldhavesaved()), 'daily' => $daily < $left ? mf($daily) : mf(0), 'weekly' => $daily * 7 < $left ? mf($daily * 7) : mf(0), 'monthly' => $daily * 31 < $left ? mf($daily * 31) : mf(0), 'start' => $start->format('j F Y'), 'due' => $duestr, 'closed' => intval($t->closed) == 1 ? true : false); $data[] = $target; } //Cache::put($key, $data, 1440); } return View::make('targets.all')->with('data', $data); }
<tr> <td><?php echo HTML::link('/home/category/overview/' . $c['id'], $c['name']); ?> </td> <td><?php if ($c['month'] == 0) { $class = 'muted'; } else { if ($c['month'] < 0) { $class = 'text-warning'; } else { $class = 'text-success'; } } echo '<span class="' . $class . '">' . mf($c['month']) . '</span>'; ?> </td> <td> <a href="/home/category/edit/<?php echo $c['id']; ?> " class="btn"><i class="icon-pencil"></i></a> <a href="#" data-value="<?php echo $c['id']; ?> " title="Delete <?php echo $c['name']; ?> " class="btn btn-danger deleteCategory"><i data-value="<?php echo $c['id'];
echo $s->id; ?> " data-datetext="<?php echo $dates[$s->date]; ?> " data-datevalue="<?php echo $s->date; ?> "> <td><?php echo $dates[$s->date]; unset($dates[$s->date]); ?> </td> <td><?php echo mf(intval(Crypt::decrypt($s->value))); ?> </td> <td><a href="#" class="btn btn-danger deleteSetting" data-value="<?php echo $s->id; ?> "><i data-value="<?php echo $s->id; ?> " class="icon-trash icon-white"</a></td> </tr> <?php } ?> </table>
</tr> <?php foreach ($data['transfers'] as $t) { ?> <tr> <td> <?php echo HTML::Link('/home/transfer/edit/' . $t['id'], $t['description']); ?> </td> <td><?php echo $t['date']->format('d F Y'); ?> </td> <td><?php echo mf($t['amount']); ?> </td> <td> <?php echo HTML::Link('home/account/overview/' . $t['account_from'], $t['account_from_name']); ?> → <?php echo HTML::Link('home/account/overview/' . $t['account_to'], $t['account_to_name']); ?> </td> <td><?php echo !is_null($t['budget_id']) ? HTML::Link('/home/budget/overview/' . $t['budget_id'], $t['budget_name']) : ''; ?>
<th>Month</th> <th>Spent</th> </tr> <?php foreach ($data['past'] as $r) { ?> <tr> <td><?php echo $r['date']; ?> </td> <td><?php echo HTML::Link('/home/category/overview/' . $category->id . '?start=' . $r['start_date'] . '&end=' . $r['end_date'], mf($r['spent'])); ?> </td> </tr> <?php } ?> <tr> <td><strong>Average</strong></td> <td><strong><?php echo mf($data['average']); ?> </strong></td> </tr> </table> </div> </div> <?php require_once __DIR__ . '/../layouts/bottom.php';
<br /> Budgeted: <?php echo mf($sum); ?> <br /> Diff: <?php echo mf($data['budget_data']['amount'] - $sum); ?> <br /> <br /> Spent in budgets: <?php echo mf($spent); ?> <br /> Spent outside budgets: <?php echo mf($data['budget_data']['spent_outside']); ?> <br /> Left: <?php echo mf($data['budget_data']['amount'] - $data['budget_data']['spent_outside'] - $spent); ?> <br /> <?php } ?> </p> </div> </div> <?php require_once __DIR__ . '/../layouts/bottom.php';
" data-value="<?php echo $budget; ?> " class="loading budgetProgressChart"></div> <table class="table table-condensed"> <tr> <td><?php echo mf($data['spent']); ?> </td> <td style="text-align:center;"><?php echo mf($data['avg']); ?> </td> <td style="text-align:right;"><?php echo mf(0); ?> </td> </tr> </table> </div> <!-- We place three budgets next to each other. So if index %3 == 0, end the new block: --> <?php if ($index % 3 == 0) { ?> </div> <div class="row-fluid">
<div class="span6"> <h4>Saving targets</h4> <table class="table table-striped table-condensed"> <?php foreach ($data['targets'] as $target) { ?> <tr> <th style="width:30%;"><?php echo HTML::Link('home/target/overview/' . $target['id'], $target['description']); ?> </th> <td><small><?php echo mf($target['saved']); ?> ... <?php echo mf($target['amount']); ?> </td> <tr> <td colspan="3"> <div class="targetOverviewChart loading" data-value="<?php echo $target['id']; ?> " id="targetOverviewChart<?php echo $target['id']; ?> "></div> </td> <?php } ?>
<td> <?php if ($b['left'] > 0) { echo '<span class="text-success">' . mf($b['left']) . '</span>'; } else { echo '<span class="text-error">' . mf($b['left']) . '</span>'; } ?> </td> <td><?php echo mf($b['amount']); ?> </td> <td><?php echo mf($b['spent']); ?> </td> <td style="width:300px;"> <?php if ($b['amount'] != 0) { ?> <?php if ($b['overspent'] === false) { ?> <div class="progress progress-striped"> <div class="bar bar-success" style="width: <?php echo $b['pct']; ?> %;"></div> </div>