@extends('layouts.app') @section('content')

Monthly Report

{!! Form::open(['method' => 'get']) !!}
{!! Form::label('year','Year',['class' => 'control-label']) !!} {!! Form::select('y', array_combine(range(date("Y"), 1900), range(date("Y"), 1900)), old('y', Request::get('y', date('Y'))), ['class' => 'form-control']) !!}
{!! Form::label('month','Month',['class' => 'control-label']) !!} {!! Form::select('m', cal_info(0)['months'], old('m', Request::get('m', date('m'))), ['class' => 'form-control']) !!}

{!! Form::submit('Select month',['class' => 'btn btn-primary']) !!}
Report
{!! Form::close() !!}
Income {{ number_format($inc_total, 2) }}
Expenses {{ number_format($exp_total, 2) }}
Profit {{ number_format($profit, 2) }}
@foreach($inc_summary as $inc) @endforeach
Income by category {{ number_format($inc_total, 2) }}
{{ $inc['name'] }} {{ number_format($inc['amount'], 2) }}
@foreach($exp_summary as $inc) @endforeach
Expenses by category {{ number_format($exp_total, 2) }}
{{ $inc['name'] }} {{ number_format($inc['amount'], 2) }}
@stop