git add .
git commit "fix(assets): self-host Chart.js instead of loading from CDN"
This commit is contained in:
@@ -28,14 +28,21 @@ class DashboardController extends Controller
|
||||
->orderBy('date')
|
||||
->get();
|
||||
|
||||
$flightViews=Flight::query()
|
||||
->selectRaw('DATE(created_at) as date,SUM(views) as total')
|
||||
->where('created_at','>=',now()->subDays(9))
|
||||
->groupBy('date')
|
||||
->orderBy('date')
|
||||
->get();
|
||||
|
||||
$logs = ActivityLog::with('admin')
|
||||
->latest()
|
||||
->take(5)
|
||||
->get();
|
||||
|
||||
return view('admin.dashboard',compact('adminsCount',
|
||||
'usersCount','toursCount','flightsCount','tourViews'
|
||||
,'logs'
|
||||
'usersCount','toursCount','flightsCount','tourViews',
|
||||
'flightViews','logs'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CityStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ProvinceStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class ExcelServices
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class ReportServices
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1 +1,5 @@
|
||||
<?php
|
||||
|
||||
return[
|
||||
'title'=>'سامانه آژانس هواپیمایی'
|
||||
];
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -20,9 +20,7 @@
|
||||
</div>
|
||||
|
||||
<h4>
|
||||
{{Auth::user()->first_name}}
|
||||
{{Auth::user()->last_name}}
|
||||
</h4>
|
||||
</h4>
|
||||
|
||||
<span>
|
||||
{{Auth::user()->email}}
|
||||
|
||||
@@ -8,15 +8,12 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@include('account.layout.app')
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
|
||||
@@ -24,41 +21,28 @@
|
||||
|
||||
|
||||
<h2 class="account-title">
|
||||
نظرات من 💬
|
||||
نظرات من
|
||||
</h2>
|
||||
|
||||
|
||||
|
||||
@if($comments->count())
|
||||
|
||||
|
||||
<div class="comments-list">
|
||||
|
||||
|
||||
@foreach($comments as $comment)
|
||||
|
||||
|
||||
<div class="comment-card">
|
||||
|
||||
|
||||
<div class="comment-header">
|
||||
|
||||
<div>
|
||||
|
||||
<h4>
|
||||
{{ $comment->tour->title ?? 'مورد حذف شده' }}
|
||||
</h4>
|
||||
|
||||
|
||||
<span>
|
||||
{{ $comment->created_at->format('Y/m/d') }}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="comment-status">
|
||||
|
||||
@if($comment->status == 1)
|
||||
|
||||
<span class="approved">
|
||||
@@ -66,7 +50,6 @@
|
||||
</span>
|
||||
|
||||
@else
|
||||
|
||||
<span class="pending">
|
||||
در انتظار تایید
|
||||
</span>
|
||||
@@ -75,54 +58,32 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="comment-body">
|
||||
|
||||
{{ $comment->body }}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@else
|
||||
|
||||
|
||||
<div class="empty-favorite">
|
||||
|
||||
<i class="fa fa-comments"></i>
|
||||
|
||||
<p>
|
||||
هنوز نظری ثبت نکردهاید.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -8,41 +8,30 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@include('account.layout.app')
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
|
||||
<div class="account-content">
|
||||
|
||||
|
||||
<h2 class="account-title">
|
||||
علاقهمندیهای من ❤️
|
||||
علاقهمندیهای من
|
||||
</h2>
|
||||
|
||||
|
||||
@if($favorites->count())
|
||||
|
||||
|
||||
<div class="favorite-list">
|
||||
|
||||
|
||||
@foreach($favorites as $favorite)
|
||||
|
||||
|
||||
<div class="favorite-card">
|
||||
|
||||
|
||||
<div class="favorite-info">
|
||||
|
||||
|
||||
@if($favorite->favoritable_type == 'App\Models\Tour')
|
||||
|
||||
<h3>
|
||||
@@ -52,10 +41,8 @@
|
||||
تور
|
||||
</p>
|
||||
|
||||
|
||||
@elseif($favorite->favoritable_type == 'App\Models\Flight')
|
||||
|
||||
|
||||
<h3>
|
||||
{{ $favorite->favoritable->name }}
|
||||
</h3>
|
||||
@@ -64,42 +51,29 @@
|
||||
پرواز
|
||||
</p>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form action="{{route('users.favorite.destroy',$favorite)}}" method="POST">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
|
||||
<button class="remove-favorite">
|
||||
|
||||
<i class="fa fa-trash"></i>
|
||||
|
||||
حذف
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@else
|
||||
|
||||
<div class="empty-favorite">
|
||||
@@ -112,19 +86,13 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
{{-- Sidebar --}}
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@@ -17,8 +16,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Profile --}}
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="theme-account">
|
||||
@@ -35,7 +32,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
@@ -59,9 +55,7 @@
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
|
||||
{{-- Personal Information --}}
|
||||
<div class="theme-account-box">
|
||||
<div class="theme-account-box">
|
||||
|
||||
<div class="theme-account-box-header">
|
||||
<h3>
|
||||
@@ -97,7 +91,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -122,7 +115,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -147,7 +139,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -197,7 +188,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -228,9 +218,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Gender & Marital Status --}}
|
||||
<div class="theme-account-box">
|
||||
<div class="theme-account-box">
|
||||
|
||||
<div class="theme-account-box-header">
|
||||
<h3>
|
||||
@@ -371,9 +359,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Location --}}
|
||||
<div class="theme-account-box">
|
||||
<div class="theme-account-box">
|
||||
|
||||
<div class="theme-account-box-header">
|
||||
<h3>
|
||||
@@ -453,8 +439,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Profile Image --}}
|
||||
<div class="theme-account-box">
|
||||
<div class="theme-account-box">
|
||||
|
||||
<div class="theme-account-box-header">
|
||||
<h3>
|
||||
@@ -504,9 +489,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Password --}}
|
||||
<div class="theme-account-box">
|
||||
<div class="theme-account-box">
|
||||
|
||||
<div class="theme-account-box-header">
|
||||
|
||||
@@ -601,9 +584,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Submit --}}
|
||||
<div class="text-left">
|
||||
<div class="text-left">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
@@ -627,7 +608,6 @@
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</th>
|
||||
|
||||
<th>
|
||||
کاربر
|
||||
مدیر
|
||||
</th>
|
||||
|
||||
<th>
|
||||
@@ -76,7 +76,7 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $log->admin->name ?? '-' }}
|
||||
{{ $log->admin->first_name ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>کاربر</th>
|
||||
<th>مدیر</th>
|
||||
<th>عملیات</th>
|
||||
<th>بخش</th>
|
||||
<th>تاریخ</th>
|
||||
@@ -124,7 +124,7 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $log->admin->name ?? '-' }}
|
||||
{{ $log->admin->first_name ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -164,18 +164,28 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<canvas id="viewsChart" height="100"></canvas>
|
||||
<canvas id="tourViewsChart" height="100"></canvas>
|
||||
|
||||
</div>
|
||||
<div class="card-header bg-white fw-bold">
|
||||
|
||||
نمودار بازدید پروازها در ۱۰ روز اخیر
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<canvas id="flightViewsChart" height="100"></canvas>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="{{asset('assets/js/chart.js')}}"></script>
|
||||
<script>
|
||||
const ctx = document.getElementById('viewsChart');
|
||||
const tourChart = document.getElementById('tourViewsChart');
|
||||
|
||||
new Chart(ctx, {
|
||||
new Chart(tourChart, {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
@@ -191,6 +201,42 @@
|
||||
}]
|
||||
},
|
||||
|
||||
options: {
|
||||
responsive:true,
|
||||
|
||||
plugins:{
|
||||
|
||||
legend:{
|
||||
|
||||
position:'top'
|
||||
}
|
||||
},
|
||||
scales:{
|
||||
|
||||
y:{
|
||||
beginAtZero:true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
const flightChart = document.getElementById('flightViewsChart');
|
||||
|
||||
new Chart(flightChart, {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
data: {
|
||||
labels: @json($flightViews->pluck('date')),
|
||||
|
||||
datasets: [{
|
||||
|
||||
label: 'بازدید پرواز ها',
|
||||
|
||||
data: @json($flightViews->pluck('total')),
|
||||
|
||||
}]
|
||||
},
|
||||
|
||||
options: {
|
||||
responsive:true,
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<script src="{{asset('assets/js/fitvid.js')}}"></script>
|
||||
<script src="{{asset('assets/js/youtube-bg.js')}}"></script>
|
||||
<script src="{{asset('assets/js/custom.js')}}"></script>
|
||||
<script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYeBBmgAkyAN_QKjAVOiP_kWZ_eQdadeI&callback=initMap&libraries=places"></script>
|
||||
<script async="" defer="" src="{{asset('assets/js/js.js')}}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user