@extends('layouts.layout') @section('title', 'Dashboard') @section('content')
@if(Session::has('message'))
@endif

Hello {{Auth::user()->name}}

Welcome to SHREE AARTHI JEWELLERY
Admin Panel

,

This Month
@php $this_month_payment = DB::table('payment_details')->whereMonth('created_at',date('m'))->orderBy('id', 'DESC')->sum('amount'); @endphp

{{number_format($this_month_payment,2)}}

This Year
@php $this_year_payment = DB::table('payment_details')->whereYear('created_at',date('Y'))->orderBy('id', 'DESC')->sum('amount'); @endphp

{{number_format($this_year_payment,2)}}

@php $total_payment = DB::table('payment_details')->orderBy('id', 'DESC')->sum('amount'); @endphp
Overall Payment

{{number_format($total_payment,2)}}

@php $users_count = DB::table('users')->where(function($q) { $q->where('is_member', 1); })->orderBy('id','DESC')->count(); @endphp
Total Active Users

{{$users_count}}

SWARNA AKSHYAM SCHEME
@php $this_year_gold = DB::table('payment_details AS p'); $this_year_gold = $this_year_gold->select('p.gold_weight'); $this_year_gold = $this_year_gold->join('chit_details AS c', 'c.id', '=', 'p.chit_detail_id'); $this_year_gold = $this_year_gold->where('c.scheme_id', 1); $this_year_gold = $this_year_gold->sum('gold_weight'); @endphp
Total Gold Accumulated

{{number_format((float)$this_year_gold, 2, '.', '')}} gms

@php $this_year_gold_interest = DB::table('chit_details')->where('scheme_id', 1)->sum('total_interest'); @endphp
Total Interest Gold Accumulated

{{number_format((float)$this_year_gold_interest, 2, '.', '')}} gms

@php $this_year_gold_claimed = DB::table('gold_claim AS g'); $this_year_gold_claimed = $this_year_gold_claimed->select('g.claimed_wt'); $this_year_gold_claimed = $this_year_gold_claimed->join('chit_details AS c', 'c.id', '=', 'g.chit_id'); $this_year_gold_claimed = $this_year_gold_claimed->where('c.scheme_id', 1); $this_year_gold_claimed = $this_year_gold_claimed->sum('claimed_wt'); @endphp
Total Gold Claimed

{{number_format((float)$this_year_gold_claimed, 2, '.', '')}} gms

@php $gold = $this_year_gold; $gold_claimed = $this_year_gold_claimed; @endphp
Total Gold Not Claimed

{{number_format((float)($gold - $gold_claimed), 2, '.', '')}} gms

GOLD WALLET
@php $this_year_gold = DB::table('payment_details AS p'); $this_year_gold = $this_year_gold->select('p.gold_weight'); $this_year_gold = $this_year_gold->join('chit_details AS c', 'c.id', '=', 'p.chit_detail_id'); $this_year_gold = $this_year_gold->where('c.scheme_id', 2); $this_year_gold = $this_year_gold->sum('gold_weight'); @endphp
Total Gold Accumulated

{{number_format((float)$this_year_gold, 2, '.', '')}} gms

@php $this_year_gold_interest = DB::table('chit_details')->where('scheme_id', 2)->sum('total_interest'); @endphp
Total Interest Gold Accumulated

{{number_format((float)$this_year_gold_interest, 2, '.', '')}} gms

@php $this_year_gold_claimed = DB::table('gold_claim AS g'); $this_year_gold_claimed = $this_year_gold_claimed->select('g.claimed_wt'); $this_year_gold_claimed = $this_year_gold_claimed->join('chit_details AS c', 'c.id', '=', 'g.chit_id'); $this_year_gold_claimed = $this_year_gold_claimed->where('c.scheme_id', 2); $this_year_gold_claimed = $this_year_gold_claimed->sum('claimed_wt'); @endphp
Total Gold Claimed

{{number_format((float)$this_year_gold_claimed, 2, '.', '')}} gms

@php $gold = $this_year_gold; $gold_claimed = $this_year_gold_claimed; @endphp
Total Gold Not Claimed

{{number_format((float)($gold - $gold_claimed), 2, '.', '')}} gms

Recent Payment Details

@php $payment_history = DB::table('payment_details')->orderBy('id', 'DESC')->limit('3')->get(); @endphp @if(count($payment_history)>0) @foreach($payment_history as $key=>$item) @php $userinfo = DB::table('users')->where('id',$item->user_id)->first(); $chitdetailinfo = DB::table('chit_details')->where('id',$item->chit_detail_id)->first(); $chitinfo = ''; if($chitdetailinfo) { if($chitdetailinfo->scheme_id && $chitdetailinfo->group_id) { $chitinfo = DB::table('chit_scheme')->where('scheme_id',$chitdetailinfo->scheme_id)->where('id',$chitdetailinfo->group_id)->first(); } } @endphp @endforeach @else @endif
# Group Bill No Payment Date Amount Rate Weight Instalment Mode
{{ $key+1 }} @if($chitinfo) @if($chitinfo->chit_name) {{ $chitinfo->chit_name }} @endif @endif @if($item->is_same_month=='1') @endif {{ $item->bill_no }} @if($item->payment_date && $item->payment_date!='0000-00-00') {{ date("d/m/Y",strtotime($item->payment_date))}} @else @if($item->created_at) {{ date("d/m/Y",strtotime($item->created_at))}} @endif @endif {{ number_format((int)$item->amount) }} {{ number_format((int)$item->gold_rate) }} {{ number_format($item->gold_weight,3) }} {{ $item->no_of_installments }} {{$item->payment_mode}}

No records found!

Today's Gold Rate

@php $gold_rate = DB::table('gold_rate')->orderBy('id', 'DESC')->first(); if($gold_rate) { $statistic = DB::table('gold_rate')->where('id','<',$gold_rate->id)->orderBy('id','DESC')->first(); } @endphp
  • Gold 24k Rate {{number_format($gold_rate->gold_24k_rate,2)}} @php if($gold_rate->id!=1) { $gold_24k_rate = isset($statistic->gold_24k_rate)?$statistic->gold_24k_rate:''; $difference = (int)$gold_rate->gold_24k_rate - (int)$gold_24k_rate; if($difference!=0) { if($gold_rate->gold_24k_rate < $gold_24k_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
  • Gold 22k Rate {{number_format($gold_rate->gold_22k_rate,2)}} @php if($gold_rate->id!=1) { $gold_22k_rate = isset($statistic->gold_22k_rate)?$statistic->gold_22k_rate:''; $difference = (int)$gold_rate->gold_22k_rate - (int)$gold_22k_rate; if($difference!=0) { if($gold_rate->gold_22k_rate < $gold_22k_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
  • Gold 18k Rate {{number_format($gold_rate->gold_18k_rate,2)}} @php if($gold_rate->id!=1) { $gold_18k_rate = isset($statistic->gold_18k_rate)?$statistic->gold_18k_rate:''; $difference = (int)$gold_rate->gold_18k_rate - (int)$gold_18k_rate; if($difference!=0) { if($gold_rate->gold_18k_rate < $gold_18k_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
  • Silver Rate {{number_format($gold_rate->silver_rate,2)}} @php if($gold_rate->id!=1) { $silver_rate = isset($statistic->silver_rate)?$statistic->silver_rate:''; $difference = (int)$gold_rate->silver_rate - (int)$silver_rate; if($difference!=0) { if($gold_rate->silver_rate < $silver_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
  • Platinum Rate {{number_format($gold_rate->platinum_rate,2)}} @php if($gold_rate->id!=1) { $platinum_rate = isset($statistic->platinum_rate)?$statistic->platinum_rate:''; $difference = (int)$gold_rate->platinum_rate - (int)$platinum_rate; if($difference!=0) { if($gold_rate->platinum_rate < $platinum_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
  • Diamand Rate {{number_format($gold_rate->diamond_rate,2)}} @php if($gold_rate->id!=1) { $diamond_rate = isset($statistic->diamond_rate)?$statistic->diamond_rate:''; $difference = (int)$gold_rate->diamond_rate - (int)$diamond_rate; if($difference!=0) { if($gold_rate->diamond_rate < $diamond_rate) { echo "".$difference." "; } else{ echo "+".$difference." "; } } else { echo '0'; } } @endphp
@endsection