@extends('admin.app') @section('title', 'التقرير المالي') @section('content')
{{Form::selectYear('date' , date("Y") , 2016 ,request('date') ? request('date') : now()->year, array('class'=>'form-control', 'onchange' => "javascript: document.getElementById('year_form').submit();"))}}
{{Form::select( 'show_name', array('no' => 'عرض رمز الدورة', 'yes' => 'عرض اسم الدورة'), request('show_name') ? request('show_name') : 'no', array('class'=>'form-control', 'onchange' => "javascript: document.getElementById('year_form').submit();") )}}
{{-- --}} {{-- --}} {{-- --}}
  {{--
--}}
 
@for($i = 1; $i < 13; $i++) @endfor @php $month1 = $month2= $month3= $month4= $month5= $month6= $month7= $month8= $month9= $month10= $month11= $month12= array(); @endphp @foreach ($orders as $order) @php $total_all = 0; @endphp @for($i = 1; $i < 13; $i++) @php $ii = sprintf('%02d', $i); @endphp @endfor @php $month1[] = $mon1; $month2[] = $mon2; $month3[] = $mon3; $month4[] = $mon4; $month5[] = $mon5; $month6[] = $mon6; $month7[] = $mon7; $month8[] = $mon8; $month9[] = $mon9; $month10[] = $mon10; $month11[] = $mon11; $month12[] = $mon12; @endphp @endforeach @for($i = 1; $i < 13; $i++) @endfor
اسم الدورهشهر
الاجمالي
@php if(Request::get('show_name') && Request::get('show_name') == 'yes') { echo $order->course->title; } else { echo $order->course->code; } @endphp {{${"mon{$i}"} = $order->where('course_id',$order->course_id)->whereMonth('created_at', '=', $ii)->whereYear('created_at', '=', (request('date') ? request('date') : now()->year))->where('status',1)->sum('total')}} @php $total_all+=${"mon{$i}"} @endphp {{number_format($total_all, 2)}}
الاجمالي {{array_sum(${"month{$i}"})}} {{ array_sum($month1) + array_sum($month2)+ array_sum($month3) + array_sum($month4) + array_sum($month5) +array_sum($month6) +array_sum($month7) +array_sum($month8) +array_sum($month9) +array_sum($month10) +array_sum($month11) +array_sum($month12) }}
{{-- {{ $courses->render()}} --}}
@endsection