fix beberapa revisi
This commit is contained in:
@@ -141,6 +141,8 @@ class AdminsController extends Controller
|
|||||||
if($request->cabang_id) {
|
if($request->cabang_id) {
|
||||||
$userHasCabang = UserHasCabang::where('user_id', $admin->id)->first();
|
$userHasCabang = UserHasCabang::where('user_id', $admin->id)->first();
|
||||||
$userHasCabang ? $userHasCabang->update(['cabang_id' => $request->cabang_id]) : UserHasCabang::create(['user_id' => $admin->id, 'cabang_id' => $request->cabang_id]);
|
$userHasCabang ? $userHasCabang->update(['cabang_id' => $request->cabang_id]) : UserHasCabang::create(['user_id' => $admin->id, 'cabang_id' => $request->cabang_id]);
|
||||||
|
} else {
|
||||||
|
UserHasCabang::where('user_id', $admin->id)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
AuditTrailHelper::AddAuditTrail('Update', 'Update User Data (' . $request->email . ') in the User Table');
|
AuditTrailHelper::AddAuditTrail('Update', 'Update User Data (' . $request->email . ') in the User Table');
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use App\Models\FormMeetingSeminar;
|
|||||||
use App\Models\FormOthers;
|
use App\Models\FormOthers;
|
||||||
use App\Models\FormEntertaimentPresentation;
|
use App\Models\FormEntertaimentPresentation;
|
||||||
use App\Models\FormVehicleRunningCost;
|
use App\Models\FormVehicleRunningCost;
|
||||||
|
use App\Models\UserHasCabang;
|
||||||
|
|
||||||
class BudgetControlController extends Controller
|
class BudgetControlController extends Controller
|
||||||
{
|
{
|
||||||
@@ -23,7 +24,30 @@ class BudgetControlController extends Controller
|
|||||||
session()->put('redirect_url', route('budget_control'));
|
session()->put('redirect_url', route('budget_control'));
|
||||||
|
|
||||||
// Get the budget control data
|
// Get the budget control data
|
||||||
$budget = BudgetControl::orderBy('created_at', 'desc')->with(['user', 'cabang'])->get();
|
// $budget = BudgetControl::orderBy('created_at', 'desc')->with(['user', 'cabang'])->get();
|
||||||
|
$role = auth()->user()->getRoleNames()[0];
|
||||||
|
$budget = null;
|
||||||
|
|
||||||
|
if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') {
|
||||||
|
$region_id = auth()->user()->getMyCabangAndRegionId()['region'];
|
||||||
|
|
||||||
|
if ($region_id) {
|
||||||
|
// Get budget controls where the region matches
|
||||||
|
$budget = BudgetControl::whereHas('cabang', function ($query) use ($region_id) {
|
||||||
|
$query->where('region_id', $region_id);
|
||||||
|
})->get();
|
||||||
|
}
|
||||||
|
} elseif ($role == 'Area Manager Cabang') {
|
||||||
|
$cabang_id = auth()->user()->getMyCabangAndRegionId()['cabang'];
|
||||||
|
|
||||||
|
if ($cabang_id) {
|
||||||
|
// Get budget controls where the cabang matches
|
||||||
|
$budget = BudgetControl::where('cabang_id', $cabang_id)->get();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Get all budget controls for other roles
|
||||||
|
$budget = BudgetControl::all();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize an empty array to hold the used budget sums
|
// Initialize an empty array to hold the used budget sums
|
||||||
$usedBudget = [];
|
$usedBudget = [];
|
||||||
|
|||||||
@@ -638,23 +638,25 @@ class ReportController extends Controller
|
|||||||
{
|
{
|
||||||
$role = auth()->user()->getRoleNames()[0];
|
$role = auth()->user()->getRoleNames()[0];
|
||||||
$cabangs = [];
|
$cabangs = [];
|
||||||
|
$regions = [];
|
||||||
|
|
||||||
if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') {
|
if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') {
|
||||||
$region_id = auth()->user()->getMyCabangAndRegionId()['region'];
|
$region_id = auth()->user()->getMyCabangAndRegionId()['region'];
|
||||||
|
|
||||||
if ($region_id) {
|
if ($region_id) {
|
||||||
$cabangs = Cabang::where('region_id', $region_id)->get();
|
$cabangs = Cabang::where('region_id', $region_id)->get();
|
||||||
|
$regions = Region::where('id', $region_id)->get();
|
||||||
}
|
}
|
||||||
} else if ($role == 'Area Manager Cabang') {
|
} else if ($role == 'Area Manager Cabang') {
|
||||||
$cabang_id = auth()->user()->getMyCabangAndRegionId()['cabang'];
|
$cabang_id = auth()->user()->getMyCabangAndRegionId()['cabang'];
|
||||||
|
|
||||||
if ($cabang_id) {
|
if ($cabang_id) {
|
||||||
$cabangs = Cabang::where('id', $cabang_id)->get();
|
$cabangs = Cabang::where('id', $cabang_id)->get();
|
||||||
|
$regions = Region::where('id', $cabangs[0]->region_id)->get();
|
||||||
}
|
}
|
||||||
} else if ($role == 'Medical Representatif') {
|
|
||||||
$cabangs = null;
|
|
||||||
} else {
|
} else {
|
||||||
$cabangs = Cabang::all();
|
$cabangs = Cabang::all();
|
||||||
|
$regions = Region::all();
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('backend.pages.report.jurnal', [
|
return view('backend.pages.report.jurnal', [
|
||||||
@@ -662,6 +664,7 @@ class ReportController extends Controller
|
|||||||
'title' => 'Generate Reports For Jurnal',
|
'title' => 'Generate Reports For Jurnal',
|
||||||
],
|
],
|
||||||
'cabang' => $cabangs,
|
'cabang' => $cabangs,
|
||||||
|
'regions' => $regions
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ class CabangController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCabangByRegion($regionCode)
|
||||||
|
{
|
||||||
|
$region_id = Region::where('code', $regionCode)->first()->id;
|
||||||
|
$cabang = Cabang::where('region_id', $region_id)->get(['code', 'name']);
|
||||||
|
return response()->json($cabang);
|
||||||
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$this->checkAuthorization(auth()->user(), ['cabang.create']);
|
$this->checkAuthorization(auth()->user(), ['cabang.create']);
|
||||||
|
|||||||
@@ -338,8 +338,32 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -338,8 +338,32 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -327,8 +327,32 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -364,8 +364,32 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,8 +343,32 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,10 +96,32 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: true,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf', 'print'
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,9 +89,31 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf', 'print'
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,9 +89,31 @@
|
|||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf', 'print'
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,10 +88,32 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: true,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf', 'print'
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,10 +92,32 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if ($('#dataTable').length) {
|
if ($('#dataTable').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable').DataTable({
|
||||||
responsive: true,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf', 'print'
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,15 +98,11 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<label for="month">Pilih Periode Bulan</label>
|
<label for="month">Pilih Periode Bulan</label>
|
||||||
<select name="month" id="month" class="form-control">
|
<select name="month" id="month" class="form-control">
|
||||||
@@ -127,7 +123,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<label for="year">Pilih Periode Tahun</label>
|
<label for="year">Pilih Periode Tahun</label>
|
||||||
<select name="year" id="year" class="form-control">
|
<select name="year" id="year" class="form-control">
|
||||||
@@ -139,6 +135,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="status">Status</label>
|
||||||
|
<select name="status" id="status" class="form-control">
|
||||||
|
<option value="">Semua Status</option>
|
||||||
|
<option value="On Progress" {{ request()->status == 'On Progress' ? 'selected' : '' }}>On Progress</option>
|
||||||
|
<option value="Approved" {{ request()->status == 'Approved' ? 'selected' : '' }}>Approved</option>
|
||||||
|
<option value="Closed" {{ request()->status == 'Closed' ? 'selected' : '' }}>Closed</option>
|
||||||
|
<option value="Rejected" {{ request()->status == 'Rejected' ? 'selected' : '' }}>Rejected</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@@ -225,9 +234,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('reports.entertainment') }}" method="GET">
|
<form action="{{ route('reports.upcountry') }}" method="GET">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
@@ -42,11 +42,7 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +75,7 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
<a href="{{ route('reports.entertainment') }}" class="btn btn-secondary">Reset</a>
|
<a href="{{ route('reports.upcountry') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -176,9 +172,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -143,11 +143,32 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'csv', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
paging: false,
|
buttons: [
|
||||||
info: false,
|
{
|
||||||
pageLength: -1
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,20 +13,29 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('reports.jurnal.generate') }}" method="GET">
|
<form action="{{ route('reports.jurnal.generate') }}" method="GET">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="region">Pilih Region</label>
|
||||||
<select name="cabang" id="cabang" class="form-control" required>
|
<select name="region" id="region" class="form-control" required>
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Region</option>
|
||||||
@foreach ($cabang as $cabang)
|
@foreach ($regions as $region)
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
<option value="{{ $region->code }}" {{ request()->region == $region->code ? 'selected' : '' }}>
|
||||||
{{ $cabang->name }}
|
{{ $region->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="cabang">Pilih Cabang</label>
|
||||||
|
<select name="cabang" id="cabang" class="form-control" required>
|
||||||
|
<option value="">Semua Cabang</option>
|
||||||
|
<!-- Cabang options will be dynamically populated -->
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<label for="month">Pilih Periode Bulan</label>
|
<label for="month">Pilih Periode Bulan</label>
|
||||||
<select name="month" id="month" class="form-control" required>
|
<select name="month" id="month" class="form-control" required>
|
||||||
@@ -47,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<label for="year">Pilih Periode Tahun</label>
|
<label for="year">Pilih Periode Tahun</label>
|
||||||
<select name="year" id="year" class="form-control" required>
|
<select name="year" id="year" class="form-control" required>
|
||||||
@@ -81,9 +90,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('reports.meeting') }}" method="GET">
|
<form action="{{ route('reports.upcountry') }}" method="GET">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
@@ -42,11 +42,7 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +75,7 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
<a href="{{ route('reports.meeting') }}" class="btn btn-secondary">Reset</a>
|
<a href="{{ route('reports.upcountry') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -162,13 +158,61 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
<script>
|
<script>
|
||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('reports.others') }}" method="GET">
|
<form action="{{ route('reports.upcountry') }}" method="GET">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
@@ -42,11 +42,7 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +75,7 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
<a href="{{ route('reports.others') }}" class="btn btn-secondary">Reset</a>
|
<a href="{{ route('reports.upcountry') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -174,9 +170,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -42,11 +42,7 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -172,9 +168,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('reports.vehicle') }}" method="GET">
|
<form action="{{ route('reports.upcountry') }}" method="GET">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
@@ -42,11 +42,7 @@
|
|||||||
<label for="cabang">Pilih Cabang</label>
|
<label for="cabang">Pilih Cabang</label>
|
||||||
<select name="cabang" id="cabang" class="form-control">
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
<option value="">Semua Cabang</option>
|
<option value="">Semua Cabang</option>
|
||||||
@foreach ($cabang as $cabang)
|
<!-- Cabang options will be dynamically populated -->
|
||||||
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
|
||||||
{{ $cabang->name }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +75,7 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-primary">Filter</button>
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
<a href="{{ route('reports.vehicle') }}" class="btn btn-secondary">Reset</a>
|
<a href="{{ route('reports.upcountry') }}" class="btn btn-secondary">Reset</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -178,9 +174,57 @@
|
|||||||
if ($('#dataTable-table').length) {
|
if ($('#dataTable-table').length) {
|
||||||
$('#dataTable-table').DataTable({
|
$('#dataTable-table').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
lengthMenu: [ [10, 50, 100, -1], [10, 50, 100, "All"] ], // Control the entries dropdown
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'print',
|
||||||
|
text: 'Print',
|
||||||
|
orientation: 'landscape',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('region').addEventListener('change', function () {
|
||||||
|
const regionCode = this.value;
|
||||||
|
const cabangSelect = document.getElementById('cabang');
|
||||||
|
|
||||||
|
// Clear existing options
|
||||||
|
cabangSelect.innerHTML = '<option value="">Semua Cabang</option>';
|
||||||
|
|
||||||
|
if (regionCode) {
|
||||||
|
fetch(`/api/cabang-by-region/${regionCode}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
data.forEach(cabang => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = cabang.code;
|
||||||
|
option.textContent = cabang.name;
|
||||||
|
cabangSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching cabang data:', error));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -22,16 +22,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="main-header navbar navbar-expand navbar-dark bg-primary">
|
<nav class="main-header navbar navbar-expand navbar-dark bg-primary">
|
||||||
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i
|
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
|
||||||
class="fas fa-bars"></i></a>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="navbar-nav ml-auto">
|
<div class="navbar-center text-white m-auto">
|
||||||
|
<span id="date-time" class="font-weight-bold"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
|
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
|
||||||
<i class="fas fa-expand-arrows-alt"></i>
|
<i class="fas fa-expand-arrows-alt"></i>
|
||||||
@@ -44,12 +45,9 @@
|
|||||||
</a>
|
</a>
|
||||||
@include('layouts.partials.logout')
|
@include('layouts.partials.logout')
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
<aside class="main-sidebar elevation-1 sidebar-light-danger">
|
<aside class="main-sidebar elevation-1 sidebar-light-danger">
|
||||||
|
|
||||||
<a href="#" class="brand-link bg-light">
|
<a href="#" class="brand-link bg-light">
|
||||||
@@ -78,12 +76,18 @@
|
|||||||
<a class="d-block font-weight-bold" style="font-size: 11px;">
|
<a class="d-block font-weight-bold" style="font-size: 11px;">
|
||||||
{{ Auth::guard('admin')->user()->getRoleNames()[0] }}
|
{{ Auth::guard('admin')->user()->getRoleNames()[0] }}
|
||||||
</a>
|
</a>
|
||||||
@if(auth()->user()->getMyCabangAndRegion()['cabang'] != '-')
|
@if(auth()->user()->getMyCabangAndRegion()['cabang'] != '-' && Auth::guard('admin')->user()->getRoleNames()[0] == 'Medical Representatif')
|
||||||
<a class="d-block" style="font-size: 14px;">
|
<a class="d-block" style="font-size: 14px;">
|
||||||
<span class="badge badge-primary">
|
<span class="badge badge-primary">
|
||||||
{{ auth()->user()->getMyCabangAndRegion()['cabang'] }}
|
{{ auth()->user()->getMyCabangAndRegion()['cabang'] }}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
@elseif(Auth::guard('admin')->user()->getRoleNames()[0] != 'superadmin')
|
||||||
|
<a class="d-block" style="font-size: 14px;">
|
||||||
|
<span class="badge badge-primary">
|
||||||
|
Head Office
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -115,5 +119,30 @@
|
|||||||
@include('layouts.partials.scripts')
|
@include('layouts.partials.scripts')
|
||||||
@yield('scripts')
|
@yield('scripts')
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function updateDateTime() {
|
||||||
|
const dateTimeElement = document.getElementById('date-time');
|
||||||
|
const now = new Date();
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
timeZone: 'Asia/Jakarta',
|
||||||
|
weekday: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hour12: false // Use 24-hour format
|
||||||
|
};
|
||||||
|
|
||||||
|
dateTimeElement.textContent = new Intl.DateTimeFormat('id-ID', options).format(now);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the clock every second
|
||||||
|
setInterval(updateDateTime, 1000);
|
||||||
|
|
||||||
|
// Initialize the clock on page load
|
||||||
|
updateDateTime();
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -93,5 +93,11 @@
|
|||||||
.dt-search {
|
.dt-search {
|
||||||
float: right;
|
float: right;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dt-length {
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Http\Controllers\Master\CabangController;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -17,3 +18,5 @@ use Illuminate\Support\Facades\Route;
|
|||||||
// Route::middleware('auth:api')->get('/user', function (Request $request) {
|
// Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||||
// return $request->user();
|
// return $request->user();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
Route::get('/api/cabang-by-region/{regionCode}', [CabangController::class, 'getCabangByRegion']);
|
||||||
@@ -23,6 +23,7 @@ use App\Http\Controllers\Master\RegionController;
|
|||||||
use App\Http\Controllers\Master\CabangController;
|
use App\Http\Controllers\Master\CabangController;
|
||||||
|
|
||||||
Auth::routes();
|
Auth::routes();
|
||||||
|
require __DIR__ . '/api.php';
|
||||||
|
|
||||||
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function () {
|
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function () {
|
||||||
// Login Routes.
|
// Login Routes.
|
||||||
|
|||||||
Reference in New Issue
Block a user