Merge branch 'branch-jagad' into 'main'

Branch jagad

See merge request fiqhpratama1/xpendify!7
This commit is contained in:
Jagad Raya
2025-01-02 11:32:54 +00:00
36 changed files with 1471 additions and 967 deletions
@@ -22,7 +22,8 @@ class AuditTrailController extends Controller
return view( return view(
'backend.pages.audit_trail.index', 'backend.pages.audit_trail.index',
[ [
'data' => AuditTrail::orderBy('id', 'desc')->get(), // sort by newest
'data' => AuditTrail::orderBy('created_at', 'desc')->get(),
'pageInfo' => $pageInfo, 'pageInfo' => $pageInfo,
] ]
); );
@@ -63,7 +63,7 @@ class DashboardController extends Controller
// Sum the filtered queries // Sum the filtered queries
foreach ($forms as $key => $query) { foreach ($forms as $key => $query) {
$forms[$key] = $query->sum('total'); $forms[$key] = $query->sum('approved_total');
} }
return view( return view(
@@ -20,6 +20,7 @@ use App\Mail\ExpenseRejected;
use App\Mail\FinalApprove; use App\Mail\FinalApprove;
use App\Helpers\WhatsappHelper; use App\Helpers\WhatsappHelper;
use App\Helpers\AuditTrailHelper; use App\Helpers\AuditTrailHelper;
use App\Rules\FileType;
class FormEntertainmentPresentationController extends Controller class FormEntertainmentPresentationController extends Controller
{ {
@@ -84,8 +85,8 @@ class FormEntertainmentPresentationController extends Controller
'alamat' => 'required', 'alamat' => 'required',
'nik_or_npwp' => 'required', 'nik_or_npwp' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang; $cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
@@ -189,8 +190,8 @@ class FormEntertainmentPresentationController extends Controller
'alamat' => 'required', 'alamat' => 'required',
'nik_or_npwp' => 'required', 'nik_or_npwp' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$form = FormEntertaimentPresentation::findOrfail($id); $form = FormEntertaimentPresentation::findOrfail($id);
@@ -20,6 +20,7 @@ use App\Mail\ExpenseRejected;
use App\Mail\FinalApprove; use App\Mail\FinalApprove;
use App\Helpers\WhatsappHelper; use App\Helpers\WhatsappHelper;
use App\Helpers\AuditTrailHelper; use App\Helpers\AuditTrailHelper;
use App\Rules\FileType;
class FormMeetingSeminarController extends Controller class FormMeetingSeminarController extends Controller
{ {
@@ -80,8 +81,8 @@ class FormMeetingSeminarController extends Controller
'transport_ankot' => 'required', 'transport_ankot' => 'required',
'hotel' => 'required', 'hotel' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang; $cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
@@ -178,8 +179,8 @@ class FormMeetingSeminarController extends Controller
'transport_ankot' => 'required', 'transport_ankot' => 'required',
'hotel' => 'required', 'hotel' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$form = FormMeetingSeminar::findOrfail($id); $form = FormMeetingSeminar::findOrfail($id);
@@ -20,6 +20,7 @@ use App\Mail\ExpenseRejected;
use App\Mail\FinalApprove; use App\Mail\FinalApprove;
use App\Helpers\WhatsappHelper; use App\Helpers\WhatsappHelper;
use App\Helpers\AuditTrailHelper; use App\Helpers\AuditTrailHelper;
use App\Rules\FileType;
class FormOtherController extends Controller class FormOtherController extends Controller
{ {
@@ -83,8 +84,8 @@ class FormOtherController extends Controller
'keterangan' => 'required', 'keterangan' => 'required',
'total' => 'required', 'total' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang; $cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
@@ -183,8 +184,8 @@ class FormOtherController extends Controller
'keterangan' => 'required', 'keterangan' => 'required',
'total' => 'required', 'total' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$form = FormOthers::findOrfail($id); $form = FormOthers::findOrfail($id);
@@ -12,7 +12,6 @@ use App\Models\Region;
use App\Models\Cabang; use App\Models\Cabang;
use App\Models\UserHasCabang; use App\Models\UserHasCabang;
use App\Models\Kategori; use App\Models\Kategori;
use App\Helpers\NextCloudHelper;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use App\Mail\ExpenseApproved; use App\Mail\ExpenseApproved;
@@ -20,6 +19,8 @@ use App\Mail\ExpenseRejected;
use App\Mail\FinalApprove; use App\Mail\FinalApprove;
use App\Helpers\WhatsappHelper; use App\Helpers\WhatsappHelper;
use App\Helpers\AuditTrailHelper; use App\Helpers\AuditTrailHelper;
use App\Helpers\NextCloudHelper;
use App\Rules\FileType;
class FormUpCountryController extends Controller class FormUpCountryController extends Controller
{ {
@@ -64,6 +65,17 @@ class FormUpCountryController extends Controller
]); ]);
} }
public function detail($id)
{
$this->checkAuthorization(auth()->user(), ['forms.country.view']);
$form = FormUpCountry::with(['rayon', 'user'])->findOrFail($id);
$form->bukti1 = $form->bukti1 ? NextCloudHelper::getFileUrl($form->bukti1) : null;
$form->bukti2 = $form->bukti2 ? NextCloudHelper::getFileUrl($form->bukti2) : null;
$form->bukti3 = $form->bukti3 ? NextCloudHelper::getFileUrl($form->bukti3) : null;
return response()->json($form);
}
public function create() public function create()
{ {
$this->checkAuthorization(auth()->user(), ['forms.country.create']); $this->checkAuthorization(auth()->user(), ['forms.country.create']);
@@ -86,8 +98,8 @@ class FormUpCountryController extends Controller
'transport_dalkot' => 'required', 'transport_dalkot' => 'required',
'transport_ankot' => 'required', 'transport_ankot' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang; $cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
@@ -195,8 +207,8 @@ class FormUpCountryController extends Controller
'transport_ankot' => 'required', 'transport_ankot' => 'required',
'hotel' => 'required', 'hotel' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$form = FormUpCountry::findOrfail($id); $form = FormUpCountry::findOrfail($id);
@@ -272,15 +284,28 @@ class FormUpCountryController extends Controller
return redirect()->back(); return redirect()->back();
} }
public function approve($id) public function approve(Request $request, $id)
{ {
$this->checkAuthorization(auth()->user(), ['approval.approve']); $this->checkAuthorization(auth()->user(), ['approval.approve']);
$form = FormUpCountry::findOrfail($id); $form = FormUpCountry::findOrfail($id);
$approved_data = [
'allowance' => $request->allowance ? $form->allowance : 0,
'transport_dalkot' => $request->transport_dalkot ? $form->transport_dalkot : 0,
'transport_ankot' => $request->transport_ankot ? $form->transport_ankot : 0,
'hotel' => $request->hotel ? $form->hotel : 0,
];
$form->update([ $form->update([
'approved_at' => now(), 'approved_at' => now(),
'approved_by' => auth()->user()->id, 'approved_by' => auth()->user()->id,
'status' => 'Approved' 'status' => 'Approved',
'approved_allowance' => $approved_data['allowance'],
'approved_transport_dalkot' => $approved_data['transport_dalkot'],
'approved_transport_ankot' => $approved_data['transport_ankot'],
'approved_hotel' => $approved_data['hotel'],
'approved_total' => array_sum($approved_data),
]); ]);
$heads = $form->user->getCabangAndRegionHead(); $heads = $form->user->getCabangAndRegionHead();
@@ -20,6 +20,7 @@ use App\Mail\ExpenseRejected;
use App\Mail\FinalApprove; use App\Mail\FinalApprove;
use App\Helpers\WhatsappHelper; use App\Helpers\WhatsappHelper;
use App\Helpers\AuditTrailHelper; use App\Helpers\AuditTrailHelper;
use App\Rules\FileType;
class FormVehicleController extends Controller class FormVehicleController extends Controller
{ {
@@ -84,8 +85,8 @@ class FormVehicleController extends Controller
'nopol' => 'required', 'nopol' => 'required',
'keterangan' => 'required', 'keterangan' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang; $cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
@@ -189,8 +190,8 @@ class FormVehicleController extends Controller
'nopol' => 'required', 'nopol' => 'required',
'keterangan' => 'required', 'keterangan' => 'required',
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200', 'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,heic,heif|max:51200',
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv', 'bukti2' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
'bukti3' => 'nullable|file|mimes:pdf', 'bukti3' => ['nullable', 'file', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
]); ]);
$form = FormVehicleRunningCost::findOrfail($id); $form = FormVehicleRunningCost::findOrfail($id);
@@ -17,6 +17,7 @@ class FormEntertaimentPresentation extends Model
'jenis', 'jenis',
'keterangan', 'keterangan',
'total', 'total',
'approved_total',
'name', 'name',
'alamat', 'alamat',
'nik_or_npwp', 'nik_or_npwp',
+4
View File
@@ -17,6 +17,10 @@ class FormMeetingSeminar extends Model
'transport_ankot', 'transport_ankot',
'hotel', 'hotel',
'total', 'total',
'approved_allowance',
'approved_transport_ankot',
'approved_hotel',
'approved_total',
'bukti1', 'bukti1',
'bukti2', 'bukti2',
'bukti3', 'bukti3',
+1
View File
@@ -17,6 +17,7 @@ class FormOthers extends Model
'tanggal', 'tanggal',
'keterangan', 'keterangan',
'total', 'total',
'approved_total',
'bukti1', 'bukti1',
'bukti2', 'bukti2',
'bukti3', 'bukti3',
+5
View File
@@ -22,6 +22,11 @@ class FormUpCountry extends Model
'transport_ankot', 'transport_ankot',
'hotel', 'hotel',
'total', 'total',
'approved_allowance',
'approved_transport_dalkot',
'approved_transport_ankot',
'approved_hotel',
'approved_total',
'bukti1', 'bukti1',
'bukti2', 'bukti2',
'bukti3', 'bukti3',
+1
View File
@@ -16,6 +16,7 @@ class FormVehicleRunningCost extends Model
'tanggal', 'tanggal',
'liter', 'liter',
'total', 'total',
'approved_total',
'jarak', 'jarak',
'tipe_bensin', 'tipe_bensin',
'nopol', 'nopol',
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class FileType implements ValidationRule
{
protected array $disallowedExtensions;
/**
* Constructor to initialize disallowed file extensions.
*
* @param array $disallowedExtensions
*/
public function __construct(array $disallowedExtensions)
{
$this->disallowedExtensions = $disallowedExtensions;
}
/**
* Run the validation rule.
*
* @param string $attribute
* @param mixed $value
* @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if ($value && $value->isValid()) {
// Get the file extension
$extension = strtolower($value->getClientOriginalExtension());
// Check if the extension is in the disallowed list
if (in_array($extension, $this->disallowedExtensions)) {
$fail("The file type '{$extension}' is not allowed.");
}
} else {
$fail("The uploaded file for '{$attribute}' is invalid.");
}
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('form_up_country', function (Blueprint $table) {
$table->integer('approved_allowance')->after('total')->nullable();
$table->integer('approved_transport_dalkot')->after('approved_allowance')->nullable();
$table->integer('approved_transport_ankot')->after('approved_transport_dalkot')->nullable();
$table->integer('approved_hotel')->after('approved_transport_ankot')->nullable();
$table->integer('approved_total')->after('approved_hotel')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('form_up_country', function (Blueprint $table) {
$table->dropColumn('approved_allowance');
$table->dropColumn('approved_transport_dalkot');
$table->dropColumn('approved_transport_ankot');
$table->dropColumn('approved_hotel');
$table->dropColumn('approved_total');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('form_vehicle_running_cost', function (Blueprint $table) {
$table->integer('approved_total')->after('total')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('form_vehicle_running_cost', function (Blueprint $table) {
$table->dropColumn('approved_total');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('form_entertainment_presentation', function (Blueprint $table) {
$table->integer('approved_total')->after('total')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('form_entertainment_presentation', function (Blueprint $table) {
$table->dropColumn('approved_total');
});
}
};
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('form_meeting_seminar', function (Blueprint $table) {
$table->integer('approved_allowance')->after('total')->nullable();
$table->integer('approved_transport_ankot')->after('approved_allowance')->nullable();
$table->integer('approved_hotel')->after('approved_transport_ankot')->nullable();
$table->integer('approved_total')->after('approved_hotel')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('form_meeting_seminar', function (Blueprint $table) {
$table->dropColumn('approved_allowance');
$table->dropColumn('approved_transport_ankot');
$table->dropColumn('approved_hotel');
$table->dropColumn('approved_total');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('form_others', function (Blueprint $table) {
$table->integer('approved_total')->after('total')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('form_others', function (Blueprint $table) {
$table->dropColumn('approved_total');
});
}
};
@@ -35,6 +35,7 @@
<h4 class="header-title">Form Up Country</h4> <h4 class="header-title">Form Up Country</h4>
<div class="data-tables"> <div class="data-tables">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable-form_up_country"> <table id="dataTable-form_up_country">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -183,6 +184,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<!-- Form Vehicle Running Cost Table --> <!-- Form Vehicle Running Cost Table -->
@@ -192,6 +194,7 @@
<div class="card-body"> <div class="card-body">
<h4 class="header-title">Form Vehicle Running Cost</h4> <h4 class="header-title">Form Vehicle Running Cost</h4>
<div class="data-tables"> <div class="data-tables">
<div class="table-responsive">
<table id="dataTable-form_vehicle_running_cost"> <table id="dataTable-form_vehicle_running_cost">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -343,6 +346,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Form Entertainment Presentation Table --> <!-- Form Entertainment Presentation Table -->
<div class="row"> <div class="row">
@@ -351,6 +355,7 @@
<div class="card-body"> <div class="card-body">
<h4 class="header-title">Form Entertainment Presentation</h4> <h4 class="header-title">Form Entertainment Presentation</h4>
<div class="data-tables"> <div class="data-tables">
<div class="table-responsive">
<table id="dataTable-form_entertainment_presentation"> <table id="dataTable-form_entertainment_presentation">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -500,6 +505,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Form Meeting Seminar Table --> <!-- Form Meeting Seminar Table -->
<div class="row"> <div class="row">
@@ -508,6 +514,7 @@
<div class="card-body"> <div class="card-body">
<h4 class="header-title">Form Meeting Seminar</h4> <h4 class="header-title">Form Meeting Seminar</h4>
<div class="data-tables"> <div class="data-tables">
<div class="table-responsive">
<table id="dataTable-form_meeting_seminar"> <table id="dataTable-form_meeting_seminar">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -656,6 +663,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<!-- Form Others Table --> <!-- Form Others Table -->
@@ -665,6 +673,7 @@
<div class="card-body"> <div class="card-body">
<h4 class="header-title">Form Others</h4> <h4 class="header-title">Form Others</h4>
<div class="data-tables"> <div class="data-tables">
<div class="table-responsive">
<table id="dataTable-form_others"> <table id="dataTable-form_others">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -813,6 +822,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -820,19 +830,19 @@
<script> <script>
// Initialize DataTables for each table // Initialize DataTables for each table
if ($('#dataTable-form_up_country').length) { if ($('#dataTable-form_up_country').length) {
$('#dataTable-form_up_country').DataTable({ responsive: true }); $('#dataTable-form_up_country').DataTable({ responsive: false });
} }
if ($('#dataTable-form_vehicle_running_cost').length) { if ($('#dataTable-form_vehicle_running_cost').length) {
$('#dataTable-form_vehicle_running_cost').DataTable({ responsive: true }); $('#dataTable-form_vehicle_running_cost').DataTable({ responsive: false });
} }
if ($('#dataTable-form_entertainment_presentation').length) { if ($('#dataTable-form_entertainment_presentation').length) {
$('#dataTable-form_entertainment_presentation').DataTable({ responsive: true }); $('#dataTable-form_entertainment_presentation').DataTable({ responsive: false });
} }
if ($('#dataTable-form_meeting_seminar').length) { if ($('#dataTable-form_meeting_seminar').length) {
$('#dataTable-form_meeting_seminar').DataTable({ responsive: true }); $('#dataTable-form_meeting_seminar').DataTable({ responsive: false });
} }
if ($('#dataTable-form_others').length) { if ($('#dataTable-form_others').length) {
$('#dataTable-form_others').DataTable({ responsive: true }); $('#dataTable-form_others').DataTable({ responsive: false });
} }
</script> </script>
@endsection @endsection
@@ -40,6 +40,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="data-tables"> <div class="data-tables">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" class="text-center"> <table id="dataTable" class="text-center">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -98,6 +99,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -106,7 +108,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -33,6 +33,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="data-tables"> <div class="data-tables">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" class="text-center"> <table id="dataTable" class="text-center">
<thead class="bg-light text-capitalize"> <thead class="bg-light text-capitalize">
<tr> <tr>
@@ -42,7 +43,8 @@
<th width="15%">{{ __('Activity') }}</th> <th width="15%">{{ __('Activity') }}</th>
<th width="5%">Browser</th> <th width="5%">Browser</th>
<th width="15%">User Agent</th> <th width="15%">User Agent</th>
<th width="5%">Time</th> <th width="5%">Tanggal</th>
<th width="5%">Waktu</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -70,6 +72,7 @@
<td>{{ $item->activity }}</td> <td>{{ $item->activity }}</td>
<td>{{ $item->browser }}</td> <td>{{ $item->browser }}</td>
<td>{{ $item->user_agent }}</td> <td>{{ $item->user_agent }}</td>
<td>{{ $item->created_at }}</td>
<td>{{ $item->created_at->diffForHumans() }}</td> <td>{{ $item->created_at->diffForHumans() }}</td>
</tr> </tr>
@endforeach @endforeach
@@ -81,6 +84,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -89,11 +93,12 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
] ],
order: [[6, 'desc']]
}); });
} }
}); });
@@ -246,7 +246,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -246,7 +246,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -244,7 +244,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -48,7 +48,7 @@
<input type="text" class="form-control" name="tujuan" required value="{{ old('tujuan') }}"> <input type="text" class="form-control" name="tujuan" required value="{{ old('tujuan') }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Jarak</label> <label class="form-label">Jarak (km)</label>
<input type="number" class="form-control" name="jarak" required value="{{ old('jarak') }}"> <input type="number" class="form-control" name="jarak" required value="{{ old('jarak') }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
@@ -5,6 +5,7 @@
@endsection @endsection
@section('admin-content') @section('admin-content')
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.6.0/dist/autoNumeric.min.js"></script>
<section class="content-header"> <section class="content-header">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
@@ -48,27 +49,27 @@
<input type="text" class="form-control" name="tujuan" required value="{{ $form->tujuan }}"> <input type="text" class="form-control" name="tujuan" required value="{{ $form->tujuan }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Jarak</label> <label class="form-label">Jarak (km)</label>
<input type="number" class="form-control" name="jarak" required value="{{ $form->jarak }}"> <input type="number" class="form-control" name="jarak" required value="{{ $form->jarak }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Allowance</label> <label class="form-label">Allowance</label>
<input type="number" class="form-control" name="allowance" id="allowance" required value="{{ $form->allowance }}"> <input type="text" class="form-control" name="allowance" id="allowance" required value="{{ $form->allowance }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Transport Dalam Kota</label> <label class="form-label">Transport Dalam Kota</label>
<input type="number" class="form-control" name="transport_dalkot" id="transport_dalkot" required value="{{ $form->transport_dalkot }}"> <input type="text" class="form-control" name="transport_dalkot" id="transport_dalkot" required value="{{ $form->transport_dalkot }}">
</div> </div>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Transport Antar Kota</label> <label class="form-label">Transport Antar Kota</label>
<input type="number" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ $form->transport_ankot }}"> <input type="text" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ $form->transport_ankot }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Hotel</label> <label class="form-label">Hotel</label>
<input type="number" class="form-control" name="hotel" id="hotel" required value="{{ $form->hotel }}"> <input type="text" class="form-control" name="hotel" id="hotel" required value="{{ $form->hotel }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Bukti 1</label> <label class="form-label">Bukti 1</label>
@@ -91,4 +92,38 @@
</div> </div>
</div> </div>
</section> </section>
<script>
new AutoNumeric('#allowance', {
digitGroupSeparator: '.', // Pemisah ribuan
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
currencySymbol: 'Rp.', // Simbol mata uang
decimalPlaces: 0, // Tidak ada angka desimal
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
});
new AutoNumeric('#transport_dalkot', {
digitGroupSeparator: '.', // Pemisah ribuan
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
currencySymbol: 'Rp.', // Simbol mata uang
decimalPlaces: 0, // Tidak ada angka desimal
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
});
new AutoNumeric('#transport_ankot', {
digitGroupSeparator: '.', // Pemisah ribuan
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
currencySymbol: 'Rp.', // Simbol mata uang
decimalPlaces: 0, // Tidak ada angka desimal
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
});
new AutoNumeric('#hotel', {
digitGroupSeparator: '.', // Pemisah ribuan
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
currencySymbol: 'Rp.', // Simbol mata uang
decimalPlaces: 0, // Tidak ada angka desimal
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
});
</script>
@endsection @endsection
@@ -39,7 +39,7 @@
<div class="col-lg-4 col-6"> <div class="col-lg-4 col-6">
<div class="small-box bg-success"> <div class="small-box bg-success">
<div class="inner"> <div class="inner">
<h3>Rp {{ number_format($forms->whereIn('status', ['Approved', 'Closed'])->sum('total'), 0, ',', '.') }}</h3> <h3>Rp {{ number_format($forms->whereIn('status', ['Approved', 'Closed'])->sum('approved_total'), 0, ',', '.') }}</h3>
<p>Approved Expenses</p> <p>Approved Expenses</p>
</div> </div>
<div class="icon"> <div class="icon">
@@ -90,6 +90,7 @@
<th>Tujuan</th> <th>Tujuan</th>
<th>Jarak</th> <th>Jarak</th>
<th>Total</th> <th>Total</th>
<th>Total Approved</th>
<th>Bukti 1</th> <th>Bukti 1</th>
<th>Bukti 2</th> <th>Bukti 2</th>
<th>Bukti 3</th> <th>Bukti 3</th>
@@ -117,9 +118,16 @@
<td>{{ $item->tujuan }}</td> <td>{{ $item->tujuan }}</td>
<td>{{ $item->jarak }} km</td> <td>{{ $item->jarak }} km</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td>
@if ($item->approved_total)
{{ number_format($item->approved_total, 0, ',', '.') }}
@else
-
@endif
</td>
<td> <td>
@if ($item->bukti1) @if ($item->bukti1)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank"> <a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}">
Download Download
</a> </a>
@else @else
@@ -128,7 +136,7 @@
</td> </td>
<td> <td>
@if ($item->bukti2) @if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank"> <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}">
Download Download
</a> </a>
@else @else
@@ -137,7 +145,7 @@
</td> </td>
<td> <td>
@if ($item->bukti3) @if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank"> <a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}">
Download Download
</a> </a>
@else @else
@@ -158,10 +166,10 @@
<td> <td>
{{-- approve / reject button --}} {{-- approve / reject button --}}
@if ($item->status == 'On Progress') @if ($item->status == 'On Progress')
<form action="{{ route('forms.up-country.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> <form action="javascript:void(0);" class="d-inline">
@csrf <button type="button"
@method('PUT') class="btn btn-success btn-sm open-approve-modal"
<button type="submit" class="btn btn-success btn-sm"> data-id="{{ route('forms.up-country.approve', $item->id) }}">
Approve Approve
</button> </button>
</form> </form>
@@ -239,20 +247,211 @@
</div> </div>
</div> </div>
</section> </section>
<section>
<div class="modal fade" id="approveModal" tabindex="-1" role="dialog" aria-labelledby="approveModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<form id="approveForm" method="POST" action="">
@csrf
@method('PUT')
<div class="modal-header">
<h5 class="modal-title" id="approveModalLabel">Approve Item</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<!-- Loading spinner -->
<div id="loadingSpinner" class="d-flex justify-content-center align-items-center" style="height: 200px;">
<div class="spinner-border text-primary" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- Modal content (hidden initially) -->
<div id="modalContent" class="d-none">
<p>Please review the details below:</p>
<ul class="list-group">
<li class="list-group-item">
<strong>Expense Number:</strong> <span id="expense_number"></span>
</li>
<li class="list-group-item">
<strong>User:</strong> <span id="user"></span>
</li>
<li class="list-group-item">
<strong>Tipe:</strong> Up Country
</li>
<li class="list-group-item">
<strong>Rayon:</strong> <span id="rayon"></span>
</li>
<li class="list-group-item">
<strong>Tanggal:</strong> <span id="tanggal"></span>
</li>
<li class="list-group-item">
<strong>Tujuan:</strong> <span id="tujuan"></span>
</li>
<li class="list-group-item">
<strong>Jarak:</strong> <span id="jarak"></span>
</li>
<li class="list-group-item">
<strong>Bukti 1:</strong> <span id="bukti1"></span>
</li>
<li class="list-group-item">
<strong>Bukti 2:</strong> <span id="bukti2"></span>
</li>
<li class="list-group-item">
<strong>Bukti 3:</strong> <span id="bukti3"></span>
</li>
</ul>
<p class="mt-2">Please select the items you want to approve:</p>
<ul class="list-group list-unstyled">
<li>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="allowance" name="allowance">
<label class="custom-control-label" for="allowance">Allowance (<span id="allowance_value"></span>)</label>
</div>
</div>
</li>
<li>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="transport_dalkot" name="transport_dalkot">
<label class="custom-control-label" for="transport_dalkot">Transport Dalkot (<span id="transport_dalkot_value"></span>)</label>
</div>
</div>
</li>
<li>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="transport_ankot" name="transport_ankot">
<label class="custom-control-label" for="transport_ankot">Transport Ankot (<span id="transport_ankot_value"></span>)</label>
</div>
</div>
</li>
<li>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="hotel" name="hotel">
<label class="custom-control-label" for="hotel">Hotel (<span id="hotel_value"></span>)</label>
</div>
</div>
</li>
<li>
<div class="form-group">
<label for="total">Total</label>
<input type="text" class="form-control" id="total" name="total" value="0" readonly>
</div>
</li>
</ul>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Approve</button>
</div>
</form>
</div>
</div>
</div>
</section>
@endsection @endsection
@section('scripts') @section('scripts')
<script> <script>
$(document).ready(function () { $(document).ready(function () {
// Uncheck all checkboxes on page refresh
$('.custom-control-input').prop('checked', false);
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: ['excel', 'pdf', 'print']
'excel', 'pdf', 'print'
]
}); });
} }
// Handle Approve Button Click
$('.open-approve-modal').on('click', function () {
const approveUrl = $(this).data('id');
// Show spinner and hide content initially
$('#loadingSpinner').show();
$('#modalContent').addClass('d-none');
$('#approveForm').attr('action', approveUrl); // Set the form action
$('#approveModal').modal('show'); // Show the modal
// Get detail from /forms/up-country/detail/{id}
$.get(approveUrl.replace('approve', 'detail'), function (data) {
const formatter = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR',
minimumFractionDigits: 0
});
$('#allowance_value').text(formatter.format(data.allowance));
$('#transport_dalkot_value').text(formatter.format(data.transport_dalkot));
$('#transport_ankot_value').text(formatter.format(data.transport_ankot));
$('#hotel_value').text(formatter.format(data.hotel));
// Assign data values to checkboxes
$('#allowance').data('value', data.allowance);
$('#transport_dalkot').data('value', data.transport_dalkot);
$('#transport_ankot').data('value', data.transport_ankot);
$('#hotel').data('value', data.hotel);
// Detail data
$('#user').text(data.user.name);
$('#expense_number').text(data.expense_number);
$('#rayon').text(data.rayon.code);
$('#tanggal').text(new Date(data.tanggal).toLocaleDateString('id-ID', {
year: 'numeric',
month: 'long',
day: 'numeric'
}));
$('#tujuan').text(data.tujuan);
$('#jarak').text(data.jarak + ' km');
$('#bukti1').html(data.bukti1 ? '<a href="' + data.bukti1 + '" target="_blank">Download</a>' : '-');
$('#bukti2').html(data.bukti2 ? '<a href="' + data.bukti2 + '" target="_blank">Download</a>' : '-');
$('#bukti3').html(data.bukti3 ? '<a href="' + data.bukti3 + '" target="_blank">Download</a>' : '-');
// Hide spinner and show content
$('#loadingSpinner').hide();
$('#loadingSpinner').removeClass('d-flex');
$('#loadingSpinner').addClass('d-none');
$('#modalContent').removeClass('d-none');
// Reset the total to zero
$('#total').val(0);
});
});
// Update total dynamically
$('.custom-control-input').on('change', function () {
let total = 0;
// Calculate the total based on checked checkboxes
$('.custom-control-input:checked').each(function () {
total += parseFloat($(this).data('value') || 0);
});
// Update the total field with formatted value
const formatter = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR',
minimumFractionDigits: 0
});
$('#total').val(formatter.format(total));
});
// Uncheck all checkboxes when the modal is closed
$('#approveModal').on('hidden.bs.modal', function () {
$('.custom-control-input').prop('checked', false); // Uncheck all checkboxes
$('#total').val('0'); // Reset total to 0
});
}); });
</script> </script>
@endsection @endsection
@@ -44,7 +44,7 @@
<input type="string" class="form-control" name="total" id="total" required value="{{ old('total') }}"> <input type="string" class="form-control" name="total" id="total" required value="{{ old('total') }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Jarak</label> <label class="form-label">Jarak (km)</label>
<input type="number" class="form-control" name="jarak" id="jarak" required value="{{ old('jarak') }}"> <input type="number" class="form-control" name="jarak" id="jarak" required value="{{ old('jarak') }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
@@ -44,7 +44,7 @@
<input type="string" class="form-control" name="total" id="total" required value="{{ $form->total }}"> <input type="string" class="form-control" name="total" id="total" required value="{{ $form->total }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Jarak</label> <label class="form-label">Jarak (km)</label>
<input type="number" class="form-control" name="jarak" id="jarak" required value="{{ $form->jarak }}"> <input type="number" class="form-control" name="jarak" id="jarak" required value="{{ $form->jarak }}">
</div> </div>
<div class="mb-3"> <div class="mb-3">
@@ -116,7 +116,7 @@
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td> <td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td>
<td>{{ $item->liter }}</td> <td>{{ $item->liter }}</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td>{{ $item->jarak }}</td> <td>{{ $item->jarak }} km</td>
<td>{{ $item->tipe_bensin }}</td> <td>{{ $item->tipe_bensin }}</td>
<td>{{ $item->nopol }}</td> <td>{{ $item->nopol }}</td>
<td> <td>
@@ -248,7 +248,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -35,6 +35,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" <table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline" class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%"> style="width:100%">
@@ -78,6 +79,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -86,7 +88,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -35,6 +35,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" <table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline" class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%"> style="width:100%">
@@ -78,6 +79,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -86,7 +88,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -35,6 +35,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" <table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline" class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%"> style="width:100%">
@@ -78,6 +79,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
@endsection @endsection
@@ -38,6 +38,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4"> <div class="dataTables_wrapper dt-bootstrap4">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<div class="table-responsive">
<table id="dataTable" <table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline" class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%"> style="width:100%">
@@ -93,6 +94,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</section> </section>
@@ -103,7 +105,7 @@
$(document).ready(function () { $(document).ready(function () {
if ($('#dataTable').length) { if ($('#dataTable').length) {
$('#dataTable').DataTable({ $('#dataTable').DataTable({
responsive: true, responsive: false,
dom: 'Bfrtip', dom: 'Bfrtip',
buttons: [ buttons: [
'excel', 'pdf', 'print' 'excel', 'pdf', 'print'
@@ -25,6 +25,11 @@
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<style type="text/css"> <style type="text/css">
.table-responsive {
overflow-x: scroll;
white-space: nowrap;
}
/* Chart.js */ /* Chart.js */
@keyframes chartjs-render-animation { @keyframes chartjs-render-animation {
from { from {
+1
View File
@@ -76,6 +76,7 @@ Route::middleware(['auth:admin', 'menu'])->group(function () {
Route::prefix('forms')->group(function () { Route::prefix('forms')->group(function () {
// Up Country // Up Country
Route::get('/up-country', [FormUpCountryController::class, 'index'])->name('forms.up-country'); Route::get('/up-country', [FormUpCountryController::class, 'index'])->name('forms.up-country');
Route::get('/up-country/detail/{id}', [FormUpCountryController::class, 'detail'])->name('forms.up-country.detail');
Route::get('/up-country/create', [FormUpCountryController::class, 'create'])->name('forms.up-country.create'); Route::get('/up-country/create', [FormUpCountryController::class, 'create'])->name('forms.up-country.create');
Route::post('/up-country/store', [FormUpCountryController::class, 'store'])->name('forms.up-country.store'); Route::post('/up-country/store', [FormUpCountryController::class, 'store'])->name('forms.up-country.store');
Route::get('/up-country/edit/{id}', [FormUpCountryController::class, 'edit'])->name('forms.up-country.edit'); Route::get('/up-country/edit/{id}', [FormUpCountryController::class, 'edit'])->name('forms.up-country.edit');