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

 <div class="container-xxl flex-grow-1 container-p-y">
    <?php
    // Retrieve the value from the database
    $totalDataCount = DB::table('tbl_prescription_order')->count();;
// Using the DB facade
$cancelled = DB::table('tbl_prescription_order')->where('o_status', 0)->count();
$pending = DB::table('tbl_prescription_order')->where('o_status', 1)->count();
$completed = DB::table('tbl_prescription_order')->where('o_status', 2)->count();
$deliver = DB::table('tbl_prescription_order')->where('o_status', 3)->count();

    
    ?>
              <div class="row">
                <div class="col-lg-12 mb-4 order-0">
                  <div class="card">
                        <div class="card-body">
                            <div>
                                <h3>{{__('Analytics')}}</h3>
                            </div>
                        </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-12 mb-4 order-0">

                    <div class="card">
                        <div class="card-header">
                          <h4>{{__('medicineOrderStatistics')}}</h4>
                        </div>
                        <div class="card-body">
                          <div class="row text-center">
                            <div class="col">
                              <h3><?php echo $pending; ?></h3>
                              <p>{{__('pending')}}</p>
                            </div>
                            <div class="col">
                              <h3><?php echo $totalDataCount; ?></h3>
                              <p>{{__('process')}}</p>
                            </div>
                            <div class="col">
                              <h3><?php echo $deliver; ?></h3>
                              <p>{{__('onRoute')}}</p>
                            </div>
                            <div class="col">
                              <h3><?php echo $cancelled; ?></h3>
                              <p>{{__('cancel')}}</p>
                            </div>
                            <div class="col">
                              <h3><?php echo $completed; ?></h3>
                              <p>{{__('completed')}}</p>
                            </div>
                          </div>
                        </div>
                      </div>
                </div>
              </div>
 </div>

@endsection
