PATH:
home
/
rwabteecom
/
project_11
/
resources
/
views
/
admin
/
pages
/
Editing: dashboard.blade.php
@extends('admin.layouts.app') @section("content") <div class="row"> <div class="col-md-3"> <a href="{{route('admin.users.index')}}" style="background: #4FC2F8" class="card hoverable card-xl-stretch mb-xl-8"> <div class="card-body text-center"> <img src="{{asset('images/users.png')}}" style="width: 55px;" alt=""> <div class="text-white fw-bolder fs-1 mb-2 mt-5"> {{\App\Models\User::query()->count()}} </div> <div class="fw-bolder fs-2 text-white">{{__("Users")}}</div> </div> </a> </div> </div> <div class="row mb-5"> <div class="col-md-7"> <div class="card card-xl-stretch"> <div class="card-header pt-5 justify-content-center"> <h3 class="card-title align-items-start"> <span class="card-label fw-bolder fs-3 mb-1">{{__("Users")}}</span> </h3> </div> <div class="card-body p-0"> <div id="users_chart" style="height: 300px"></div> </div> </div> </div> <div class="col-md-5"> <div class="card h-md-100"> <div class="card-header"> <h3 class="card-title align-items-start flex-column"> <span class="card-label fw-bold text-gray-800">{{__("Users Stats")}}</span> @if(\App\Models\User::query()->latest()->first()) <span class="text-gray-500 mt-1 fw-semibold fs-6">{{__("Updated")}} {{\App\Models\User::query()->latest()->first()->updated_at->diffForHumans()}}</span> @endif </h3> <div class="card-toolbar"> <a href="{{route('admin.users.index')}}" class="btn btn-sm btn-light">{{__("Users")}}</a> </div> </div> <div class="card-body pb-2"> @if(\App\Models\User::query()->count() == 0) <h2>{{__("No Users Found")}}</h2> @else <div class="table-responsive"> <table class="table table-row-dashed align-middle gs-0 gy-3 my-0"> <thead> <tr class="fs-7 fw-bold text-gray-500 border-bottom-0"> <th class="p-0 pb-3 min-w-175px text-start">{{__("Name")}}</th> <th class="p-0 pb-3 min-w-100px text-start">{{__("Phone")}}</th> <th class="p-0 pb-3 w-50px text-start">{{__("View")}}</th> </tr> </thead> <tbody> @foreach(\App\Models\User::query()->latest("created_at")->take(6)->get() as $user) <tr> <td> <div class="d-flex align-items-center"> <div class="symbol symbol-50px me-3"> <img src="{{$user->profile_image}}" class="" alt=""> </div> <div class="d-flex justify-content-start flex-column"> <a href="#" class="text-gray-800 fw-bold text-hover-primary mb-1 fs-6">{{$user->name}}</a> </div> </div> </td> <td class="text-start pe-0"> {{$user->phone}} </td> <td class="text-start"> <a href="{{route('admin.users.show', $user->id)}}" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary w-30px h-30px"> <i class="ki-duotone ki-black-{{LaravelLocalization::getCurrentLocale() == "ar" ? "left" : "right"}} fs-2 text-gray-500"></i> </a> </td> </tr> @endforeach </tbody> </table> </div> @endif </div> </div> </div> </div> @endsection @section("scripts") <script> function Charts(data, months, element) { const a = document.getElementById("kt_charts_widget_1_chart"), o = 350, s = KTUtil.getCssVariableValue("--bs-gray-500"), r = KTUtil.getCssVariableValue("--bs-gray-200"), i = KTUtil.getCssVariableValue("--bs-primary"), l = KTUtil.getCssVariableValue("--bs-gray-300"); var options = { series: [{name: "{{__("Counts")}}", data: data}], chart: {fontFamily: "inherit", type: "bar", height: o, toolbar: {show: !1}}, plotOptions: {bar: {horizontal: !1, columnWidth: ["30%"], borderRadius: 4}}, legend: {show: !1}, dataLabels: {enabled: !1}, stroke: {show: !0, width: 2, colors: ["transparent"]}, xaxis: { categories: months, axisBorder: {show: !1}, axisTicks: {show: !1}, labels: {style: {colors: s, fontSize: "12px"}} }, yaxis: {labels: {style: {colors: s, fontSize: "12px"}}}, fill: {opacity: 1}, states: { normal: {filter: {type: "none", value: 0}}, hover: {filter: {type: "none", value: 0}}, active: {allowMultipleDataPointsSelection: !1, filter: {type: "none", value: 0}} }, tooltip: { enabled: true, }, colors: [i, l], grid: {borderColor: r, strokeDashArray: 4, yaxis: {lines: {show: !0}}}, }; var chart = new ApexCharts(document.querySelector("#" + element), options); chart.render(); } </script> <script> $(function () { $.ajax({ url: "{{route('admin.charts.users')}}", method: "GET", beforeSend: function () { }, success: function (response) { Charts(response.data.counts, response.data.months, "users_chart") } }); }); </script> @endsection
SAVE
CANCEL