diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 7d9b0cf..fcc4986 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Models\Customer; use Illuminate\Http\Request; use App\Imports\CustomerImport; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; use App\Http\Requests\ValidasiCreateCustomer; @@ -15,12 +16,47 @@ class CustomerController extends Controller /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = Customer::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name', 'like', "%$search%") + ->orWhere('code_customer', 'like', "%$search%") + ->orWhere('lot_no', 'like', "%$search%") + ->orWhere('no_tlp', 'like', "%$search%") + ->orWhere('address', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $customers = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($customerChunk) use ($customers, &$currentPage) { + foreach ($customerChunk as $customer) { + $customer->setAttribute('i', ($currentPage - 1) * $customerChunk->perPage() + 1); + $customers->push($customer); + $currentPage++; + } + }); + } else { + $customers = $query->paginate($perPage); + } + $data = [ - 'customer' => Customer::orderBy('created_at', 'desc')->get(), + 'customers' => $customers, + 'i' => ($customers->currentPage() - 1) * $customers->perPage() + 1, + 'search' => $search, 'active' => 'menu-customer', ]; + return view('dashboard.Master_Data.Customer.index', $data); } diff --git a/app/Http/Controllers/DisposalController.php b/app/Http/Controllers/DisposalController.php index 6115537..e450784 100644 --- a/app/Http/Controllers/DisposalController.php +++ b/app/Http/Controllers/DisposalController.php @@ -9,18 +9,57 @@ use App\Models\m_warehouse; use Illuminate\Http\Request; use Symfony\Component\Uid\Uuid; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use App\Http\Requests\Disposal\ValidasiCreateDisposal; use App\Http\Requests\Disposal\ValidasiUpdateDisposal; class DisposalController extends Controller { - public function index() + // Halamam index + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = Disposal::where('status_disposal', 'INAKTIF') + ->orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('fix_lot', 'like', "%$search%") + ->orWhereHas('peti', function ($petiQuery) use ($search) { + $petiQuery->where('fix_lot', 'like', "%$search%"); + }) + ->orWhereHas('customer', function ($customerQuery) use ($search) { + $customerQuery->where('name', 'like', "%$search%"); + }) + ->orWhere('date_disposal', 'like', "%$search%") + ->orWhere('description', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $disposals = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($disposalChunk) use ($disposals, &$currentPage) { + foreach ($disposalChunk as $disposal) { + $disposal->setAttribute('i', ($currentPage - 1) * $disposalChunk->perPage() + 1); + $disposals->push($disposal); + $currentPage++; + } + }); + } else { + $disposals = $query->paginate($perPage); + } + $data = [ - 'disposal' => Disposal::where('status_disposal', 'INAKTIF') - ->orderBy('created_at', 'desc') - ->get(), + 'disposals' => $disposals, + 'i' => ($disposals->currentPage() - 1) * $disposals->perPage() + 1, + 'search' => $search, 'active' => 'menu-disposal', ]; diff --git a/app/Http/Controllers/HistoryController.php b/app/Http/Controllers/HistoryController.php index edeeb83..90206b2 100644 --- a/app/Http/Controllers/HistoryController.php +++ b/app/Http/Controllers/HistoryController.php @@ -217,12 +217,64 @@ class HistoryController extends Controller } // Halaman index history transfer - public function historyTransfer() + public function historyTransfer(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = Transfer::orderBy('created_at', 'desc'); + + // Add search logic similar to the Peti index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name_customer', 'like', "%$search%") + ->orWhereHas('peti', function ($petiQuery) use ($search) { + $petiQuery->where('fix_lot', 'like', "%$search%"); + }) + ->orWhereHas('customer', function ($customerQuery) use ($search) { + $customerQuery->where('name', 'like', "%$search%"); + }) + ->orWhereHas('sourceWarehouse', function ($sourceWarehouseQuery) use ($search) { + $sourceWarehouseQuery->where('name', 'like', "%$search%"); + }) + ->orWhereHas('destinationWarehouse', function ($destinationWarehouseQuery) use ($search) { + $destinationWarehouseQuery->where('name', 'like', "%$search%"); + }) + ->orWhere(function ($dateQuery) use ($search) { + try { + $formattedDate = \Carbon\Carbon::createFromFormat('d-m-Y', $search)->format('Y-m-d'); + $dateQuery->whereDate('date', $formattedDate); + } catch (\Exception $e) { + Log::error('Error parsing date: ' . $e->getMessage()); + } + }); + // ->orWhere('date', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $transfers = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($transferChunk) use ($transfers, &$currentPage) { + foreach ($transferChunk as $transfer) { + $transfer->setAttribute('i', ($currentPage - 1) * $transferChunk->perPage() + 1); + $transfers->push($transfer); + $currentPage++; + } + }); + } else { + $transfers = $query->paginate($perPage); + } + $data = [ - 'transfer' => Transfer::withTrashed()->orderBy('created_at', 'desc')->get(), + 'transfer' => $transfers, + 'i' => ($transfers->currentPage() - 1) * $transfers->perPage() + 1, + 'search' => $search, 'active' => 'history-transfer', ]; + return view('dashboard.History.Transfer.index', $data); } -} +} \ No newline at end of file diff --git a/app/Http/Controllers/KondisiPetiController.php b/app/Http/Controllers/KondisiPetiController.php index e09b8cc..4489db9 100644 --- a/app/Http/Controllers/KondisiPetiController.php +++ b/app/Http/Controllers/KondisiPetiController.php @@ -4,20 +4,53 @@ namespace App\Http\Controllers; use App\Models\Kondisi_Peti; use Illuminate\Http\Request; +use App\Imports\KondisiPetiImport; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; use App\Http\Requests\ValidasiCreateKondisiPeti; use App\Http\Requests\ValidasiUpdateKondisiPeti; -use App\Imports\KondisiPetiImport; class KondisiPetiController extends Controller { - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = Kondisi_Peti::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('nama_kondisi', 'like', "%$search%") + ->orWhere('deskripsi_kondisi', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $kondisiPetis = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($kondisiPetiChunk) use ($kondisiPetis, &$currentPage) { + foreach ($kondisiPetiChunk as $kondisiPeti) { + $kondisiPeti->setAttribute('i', ($currentPage - 1) * $kondisiPetiChunk->perPage() + 1); + $kondisiPetis->push($kondisiPeti); + $currentPage++; + } + }); + } else { + $kondisiPetis = $query->paginate($perPage); + } + $data = [ - 'kondisiPeti' => Kondisi_Peti::orderBy('created_at', 'desc')->get(), - 'active' => 'menu-kondisipeti' + 'kondisiPetis' => $kondisiPetis, + 'i' => ($kondisiPetis->currentPage() - 1) * $kondisiPetis->perPage() + 1, + 'search' => $search, + 'active' => 'menu-kondisipeti', ]; + return view('dashboard.Master_Data.Manajemen_Peti.Kondisi_Peti.index', $data); } diff --git a/app/Http/Controllers/M_userController.php b/app/Http/Controllers/M_userController.php index 01ce030..76adf54 100644 --- a/app/Http/Controllers/M_userController.php +++ b/app/Http/Controllers/M_userController.php @@ -6,6 +6,7 @@ use App\Models\User; use App\Models\m_role; use App\Models\m_warehouse; use Illuminate\Http\Request; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use App\Http\Requests\ValidasiCreateUser; @@ -14,14 +15,49 @@ class M_userController extends Controller /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = User::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('fullname', 'like', "%$search%") + ->orWhere('email', 'like', "%$search%") + ->orWhere('no_hp', 'like', "%$search%") + ->orWhere('address', 'like', "%$search%") + ->orWhereHas('warehouse', function ($warehouseQuery) use ($search) { + $warehouseQuery->where('name', 'like', "%$search%"); + }); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $users = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($userChunk) use ($users, &$currentPage) { + foreach ($userChunk as $user) { + $user->setAttribute('i', ($currentPage - 1) * $userChunk->perPage() + 1); + $users->push($user); + $currentPage++; + } + }); + } else { + $users = $query->paginate($perPage); + } + $data = [ - 'user' => User::orderBy('created_at', 'desc')->get(), - 'warehouse' => m_warehouse::get(), - 'role' => m_role::get(), + 'users' => $users, + 'i' => ($users->currentPage() - 1) * $users->perPage() + 1, + 'search' => $search, 'active' => 'menu-user', ]; + return view('dashboard.Master_Data.User.index', $data); } diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 4d1a734..62cebee 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -215,7 +215,7 @@ class PeminjamanController extends Controller 'warehouse' => m_warehouse::get(), 'kondisiPeti' => Kondisi_Peti::get(), 'customer' => Customer::get(), - 'active' => 'menu-pengembalian', + 'active' => 'menu-peminjaman', ]; return view('dashboard.Peminjaman.pengembalian', $data); } diff --git a/app/Http/Controllers/RecycleDataController.php b/app/Http/Controllers/RecycleDataController.php deleted file mode 100644 index 87fbd34..0000000 --- a/app/Http/Controllers/RecycleDataController.php +++ /dev/null @@ -1,77 +0,0 @@ -get(); - $customer = Customer::onlyTrashed()->get(); - - $data = [ - 'peti' => Peti::onlyTrashed()->get(), - 'customer' => Customer::onlyTrashed()->get(), - 'active' => 'menu-Recycle_Data', - ]; - - return view('dashboard.Master_Data.Recycle_Data.index', $data); - } - - public function pulihkanData(Request $request, $model, $id) - { - $data = null; - - switch ($model) { - case 'peti': - $data = Peti::withTrashed()->find($id); - break; - case 'customer': - $data = Customer::withTrashed()->find($id); - break; - // Add more cases for other models if needed - - default: - return redirect()->back()->with('error', 'Model tidak valid.'); - } - - if ($data) { - $data->restore(); - return redirect()->back()->with('success', "Data $model berhasil dipulihkan."); - } else { - return redirect()->back()->with('error', 'Data tidak ditemukan.'); - } - } - - public function hapusPermanenData($model, $id) - { - $data = null; - - switch ($model) { - case 'peti': - $data = Peti::withTrashed()->find($id); - break; - case 'customer': - $data = Customer::withTrashed()->find($id); - break; - // Add more cases for other models if needed - - default: - return redirect()->back()->with('error', 'Model tidak valid.'); - } - - if ($data) { - $data->forceDelete(); - return redirect()->back()->with('success', "Data $model berhasil dihapus permanen."); - } else { - return redirect()->back()->with('error', 'Data tidak ditemukan.'); - } - } -} diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 2d91d55..77ab770 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\m_role; use Illuminate\Http\Request; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use App\Http\Requests\ValidasiCreateRole; use App\Http\Requests\ValidasiUpdateRole; @@ -13,12 +14,44 @@ class RoleController extends Controller /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = m_role::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name', 'like', "%$search%") + ->orWhere('description', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $roles = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($roleChunk) use ($roles, &$currentPage) { + foreach ($roleChunk as $role) { + $role->setAttribute('i', ($currentPage - 1) * $roleChunk->perPage() + 1); + $roles->push($role); + $currentPage++; + } + }); + } else { + $roles = $query->paginate($perPage); + } + $data = [ - 'role' => m_role::orderBy('created_at', 'desc')->get(), + 'roles' => $roles, + 'i' => ($roles->currentPage() - 1) * $roles->perPage() + 1, + 'search' => $search, 'active' => 'menu-role', ]; + return view('dashboard.Master_Data.Role.index', $data); } diff --git a/app/Http/Controllers/TransaksiKeluarMasukController.php b/app/Http/Controllers/TransaksiKeluarMasukController.php index 3aee8cd..d50e8c6 100644 --- a/app/Http/Controllers/TransaksiKeluarMasukController.php +++ b/app/Http/Controllers/TransaksiKeluarMasukController.php @@ -2,95 +2,95 @@ namespace App\Http\Controllers; -use App\Http\Requests\ValidasiUpdatePengembalian; -use App\Models\Peti; -use App\Models\m_warehouse; -use App\Models\asset_status; -use Illuminate\Http\Request; -use Illuminate\Support\Facades\Auth; +// use App\Http\Requests\ValidasiUpdatePengembalian; +// use App\Models\Peti; +// use App\Models\m_warehouse; +// use App\Models\asset_status; +// use Illuminate\Http\Request; +// use Illuminate\Support\Facades\Auth; class TransaksiKeluarMasukController extends Controller { - public function index() - { - $data = [ - 'peminjaman' => asset_status::withTrashed()->all(), - 'active' => 'menu-transaksi', - ]; - return view('dashboard.transaksi.index', $data); - } + // public function index() + // { + // $data = [ + // 'peminjaman' => asset_status::withTrashed()->all(), + // 'active' => 'menu-transaksi', + // ]; + // return view('dashboard.transaksi.index', $data); + // } - /** - * Show the form for creating a new resource. - */ - public function create() - { - // - } + // /** + // * Show the form for creating a new resource. + // */ + // public function create() + // { + // // + // } - /** - * Store a newly created resource in storage. - */ - public function store(Request $request) - { - // - } + // /** + // * Store a newly created resource in storage. + // */ + // public function store(Request $request) + // { + // // + // } - /** - * Display the specified resource. - */ - public function show($id) - { - } + // /** + // * Display the specified resource. + // */ + // public function show($id) + // { + // } - /** - * Show the form for editing the specified resource. - */ - public function edit($id) - { - $data = [ - 'peti' => Peti::get(), - 'peminjaman' => asset_status::findOrFail($id), - 'warehouse' => m_warehouse::get(), - 'active' => 'menu-pengembalian', - ]; - return view('dashboard.Pengembalian.edit', $data); - } + // /** + // * Show the form for editing the specified resource. + // */ + // public function edit($id) + // { + // $data = [ + // 'peti' => Peti::get(), + // 'peminjaman' => asset_status::findOrFail($id), + // 'warehouse' => m_warehouse::get(), + // 'active' => 'menu-pengembalian', + // ]; + // return view('dashboard.Pengembalian.edit', $data); + // } - /** - * Update the specified resource in storage. - */ - public function update(ValidasiUpdatePengembalian $request, $id) - { - try { - $peminjaman = asset_status::findOrFail($id); + // /** + // * Update the specified resource in storage. + // */ + // public function update(ValidasiUpdatePengembalian $request, $id) + // { + // try { + // $peminjaman = asset_status::findOrFail($id); - // Update atribut-atribut yang diperlukan - $peminjaman->enter_pic = Auth::user()->fullname; - $peminjaman->updated_by = Auth::user()->fullname; + // // Update atribut-atribut yang diperlukan + // $peminjaman->enter_pic = Auth::user()->fullname; + // $peminjaman->updated_by = Auth::user()->fullname; - $peminjaman->peti_id = $request->input('peti_id'); - $peminjaman->exit_at = $request->input('exit_at'); - $peminjaman->est_pengembalian = $request->input('est_pengembalian'); - $peminjaman->exit_warehouse = $request->input('exit_warehouse'); - $peminjaman->enter_at = $request->input('enter_at'); - $peminjaman->enter_warehouse = $request->input('enter_warehouse'); - $peminjaman->kondisi_peti = $request->input('kondisi_peti'); + // $peminjaman->peti_id = $request->input('peti_id'); + // $peminjaman->exit_at = $request->input('exit_at'); + // $peminjaman->est_pengembalian = $request->input('est_pengembalian'); + // $peminjaman->exit_warehouse = $request->input('exit_warehouse'); + // $peminjaman->enter_at = $request->input('enter_at'); + // $peminjaman->enter_warehouse = $request->input('enter_warehouse'); + // $peminjaman->kondisi_peti = $request->input('kondisi_peti'); - $peminjaman->save(); + // $peminjaman->save(); - return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); - } catch (\Throwable $th) { - // Tampilkan pesan kesalahan untuk debugging - return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage()); - } - } + // return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); + // } catch (\Throwable $th) { + // // Tampilkan pesan kesalahan untuk debugging + // return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage()); + // } + // } - /** - * Remove the specified resource from storage. - */ - public function destroy($id) - { - // dd("oke"); - } -} + // /** + // * Remove the specified resource from storage. + // */ + // public function destroy($id) + // { + // // dd("oke"); + // } +} \ No newline at end of file diff --git a/app/Http/Controllers/TransferController.php b/app/Http/Controllers/TransferController.php index a51a9a8..5989cb6 100644 --- a/app/Http/Controllers/TransferController.php +++ b/app/Http/Controllers/TransferController.php @@ -9,22 +9,73 @@ use App\Models\m_warehouse; use Illuminate\Http\Request; use Symfony\Component\Uid\Uuid; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Collection; +use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Auth; use App\Http\Requests\Transfer\ValidasiCreateTransfer; use App\Http\Requests\Transfer\ValidasiUpdateTransfer; class TransferController extends Controller { - public function index() + public function index(Request $request) { - $transfers = Transfer::orderBy('created_at', 'desc')->get(); + $perPage = $request->input('perPage', 5); + + $query = Transfer::join(DB::raw('(SELECT peti_id, MAX(updated_at) as latest_update FROM transfers GROUP BY peti_id) as latest_peti'), function ($join) { + $join->on('transfers.peti_id', '=', 'latest_peti.peti_id') + ->on('transfers.updated_at', '=', 'latest_peti.latest_update'); + }) + ->orderBy('created_at', 'desc'); + + // Add search logic similar to the Peti index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name_customer', 'like', "%$search%") + ->orWhereHas('peti', function ($petiQuery) use ($search) { + $petiQuery->where('fix_lot', 'like', "%$search%"); + }) + ->orWhereHas('customer', function ($customerQuery) use ($search) { + $customerQuery->where('name', 'like', "%$search%"); + }) + ->orWhereHas('sourceWarehouse', function ($sourceWarehouseQuery) use ($search) { + $sourceWarehouseQuery->where('name', 'like', "%$search%"); + }) + ->orWhereHas('destinationWarehouse', function ($destinationWarehouseQuery) use ($search) { + $destinationWarehouseQuery->where('name', 'like', "%$search%"); + }) + ->orWhere(function ($dateQuery) use ($search) { + try { + $formattedDate = \Carbon\Carbon::createFromFormat('d-m-Y', $search)->format('Y-m-d'); + $dateQuery->whereDate('date', $formattedDate); + } catch (\Exception $e) { + Log::error('Error parsing date: ' . $e->getMessage()); + } + }); + }); + } - $latestTransfers = $transfers->groupBy('peti_id')->map(function ($group) { - return $group->first(); - }); + if ($perPage == 'Semua') { + $chunkSize = 100; + $transfers = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($transferChunk) use ($transfers, &$currentPage) { + foreach ($transferChunk as $transfer) { + $transfer->setAttribute('i', ($currentPage - 1) * $transferChunk->perPage() + 1); + $transfers->push($transfer); + $currentPage++; + } + }); + } else { + $transfers = $query->paginate($perPage); + } $data = [ - 'transfer' => $latestTransfers, + 'transfer' => $transfers, + 'i' => ($transfers->currentPage() - 1) * $transfers->perPage() + 1, + 'search' => $search, 'active' => 'menu-transfer', ]; diff --git a/app/Http/Controllers/TypePetiController.php b/app/Http/Controllers/TypePetiController.php index cbe6073..2c44b2c 100644 --- a/app/Http/Controllers/TypePetiController.php +++ b/app/Http/Controllers/TypePetiController.php @@ -4,23 +4,57 @@ namespace App\Http\Controllers; use App\Models\Type_peti; use Illuminate\Http\Request; +use App\Imports\TipePetiImport; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; use App\Http\Requests\ValidasiCreateType_Peti; use App\Http\Requests\ValidasiUpdateType_Peti; -use App\Imports\TipePetiImport; class TypePetiController extends Controller { /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = Type_peti::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('type', 'like', "%$search%") + ->orWhere('size_peti', 'like', "%$search%") + ->orWhere('description', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $TipePetis = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($TipePetiChunk) use ($TipePetis, &$currentPage) { + foreach ($TipePetiChunk as $TipePeti) { + $TipePeti->setAttribute('i', ($currentPage - 1) * $TipePetiChunk->perPage() + 1); + $TipePetis->push($TipePeti); + $currentPage++; + } + }); + } else { + $TipePetis = $query->paginate($perPage); + } + $data = [ - 'typepeti' => Type_peti::orderBy('created_at', 'desc')->get(), + 'TipePetis' => $TipePetis, + 'i' => ($TipePetis->currentPage() - 1) * $TipePetis->perPage() + 1, + 'search' => $search, 'active' => 'menu-typepeti', ]; + return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.index', $data); } diff --git a/app/Http/Controllers/WarehouseController.php b/app/Http/Controllers/WarehouseController.php index 7c72103..7a06ce3 100644 --- a/app/Http/Controllers/WarehouseController.php +++ b/app/Http/Controllers/WarehouseController.php @@ -5,25 +5,56 @@ namespace App\Http\Controllers; use App\Models\m_warehouse; use Illuminate\Http\Request; use App\Imports\WarehouseImport; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; -use Illuminate\Support\Facades\Session; use App\Http\Requests\ValidasiCreateWarehouse; use App\Http\Requests\ValidasiUpdateWarehouse; -use Maatwebsite\Excel\Exceptions\NoTypeDetectedException; -use Illuminate\Support\Facades\Log; class WarehouseController extends Controller { /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { + $perPage = $request->input('perPage', 5); + + $query = m_warehouse::orderBy('created_at', 'desc'); + + // Add search logic similar to the Transfer index controller + $search = $request->input('search') ?? ''; + if ($search) { + $query->where(function ($q) use ($search) { + $q->where('name', 'like', "%$search%") + ->orWhere('description', 'like', "%$search%") + ->orWhere('address', 'like', "%$search%"); + }); + } + + if ($perPage == 'Semua') { + $chunkSize = 100; + $warehouses = new Collection(); + $currentPage = 1; + + $query->chunk($chunkSize, function ($warehouseChunk) use ($warehouses, &$currentPage) { + foreach ($warehouseChunk as $warehouse) { + $warehouse->setAttribute('i', ($currentPage - 1) * $warehouseChunk->perPage() + 1); + $warehouses->push($warehouse); + $currentPage++; + } + }); + } else { + $warehouses = $query->paginate($perPage); + } + $data = [ - 'warehouses' => m_warehouse::orderBy('created_at', 'desc')->get(), + 'warehouse' => $warehouses, + 'i' => ($warehouses->currentPage() - 1) * $warehouses->perPage() + 1, + 'search' => $search, 'active' => 'menu-warehouse', ]; + return view('dashboard.Master_Data.Warehouse.index', $data); } @@ -114,4 +145,4 @@ class WarehouseController extends Controller } } } -} +} \ No newline at end of file diff --git a/database/seeders/AssetStatusSeeder.php b/database/seeders/AssetStatusSeeder.php new file mode 100644 index 0000000..52d2668 --- /dev/null +++ b/database/seeders/AssetStatusSeeder.php @@ -0,0 +1,53 @@ + $i, + 'exit_at' => now(), + 'est_pengembalian' => now(), + 'exit_pic' => 'Seeder', + 'customer_id' => $i, + 'warehouse_id' => $i, + 'enter_at' => now(), + 'enter_pic' => 'Seeder', + 'enter_warehouse' => $i, + 'kondisi_peti_id' => $i, + 'status' => 1, + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + + //barang out + for ($i = 31; $i <= 40; $i++) { + asset_status::create([ + 'peti_id' => $i, + 'exit_at' => now(), + 'est_pengembalian' => now(), + 'exit_pic' => 'Seeder', + 'customer_id' => $i, + 'warehouse_id' => $i, + 'status' => 0, + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } +} \ No newline at end of file diff --git a/database/seeders/Customer.php b/database/seeders/CustomerSeeder.php similarity index 50% rename from database/seeders/Customer.php rename to database/seeders/CustomerSeeder.php index ea7992e..2ad7c6c 100644 --- a/database/seeders/Customer.php +++ b/database/seeders/CustomerSeeder.php @@ -2,11 +2,10 @@ namespace Database\Seeders; +use App\Models\Customer; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; -class Customer extends Seeder +class CustomerSeeder extends Seeder { /** * Run the database seeds. @@ -14,8 +13,8 @@ class Customer extends Seeder public function run(): void { // Sisipkan data pertama - DB::table('customers')->insert([ - 'name' => 'DHARMA', + Customer::create([ + 'name' => 'DHARMA G', 'code_customer' => 'DPM', 'lot_no' => 'JKT23', 'no_tlp' => '02122344', @@ -25,8 +24,8 @@ class Customer extends Seeder ]); // Sisipkan data kedua - DB::table('customers')->insert([ - 'name' => 'ADHI CHANDRA', + Customer::create([ + 'name' => 'ADHI CHANDRA G', 'code_customer' => 'ACJ', 'lot_no' => 'JKT23', 'no_tlp' => '02198765', @@ -34,5 +33,17 @@ class Customer extends Seeder 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); + + for ($i = 3; $i <= 100; $i++) { + Customer::create([ + 'name' => 'Customer ' . $i, + 'code_customer' => 'Code ' . $i, // Adjust the length as needed + 'lot_no' => 'Lot ' . $i, // Adjust the length as needed + 'no_tlp' => '12345678 ' . $i, // Adjust the length as needed + 'address' => 'Address ' . $i, + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ]); + } } -} +} \ No newline at end of file diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 78e6113..175687e 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -5,6 +5,16 @@ namespace Database\Seeders; // use Illuminate\Database\Console\Seeds\WithoutModelEvents; use App\Models\User; use Illuminate\Database\Seeder; +use Database\Seeders\PetiSeeder; +use Database\Seeders\RoleSeeder; +use Database\Seeders\UserSeeder; +use Database\Seeders\CustomerSeeder; +use Database\Seeders\DisposalSeeder; +use Database\Seeders\TipePetiSeeder; +use Database\Seeders\TransferSeeder; +use Database\Seeders\WarehouseSeeder; +use Database\Seeders\AssetStatusSeeder; +use Database\Seeders\Kondisi_PetiSeeder; class DatabaseSeeder extends Seeder { @@ -24,10 +34,14 @@ class DatabaseSeeder extends Seeder RoleSeeder::class, WarehouseSeeder::class, UserSeeder::class, - // Type_Peti::class, - // Customer::class, + //batas ke bawah tidak terlalu penting + // TipePetiSeeder::class, + // CustomerSeeder::class, // Kondisi_PetiSeeder::class, // PetiSeeder::class, + // DisposalSeeder::class, + // TransferSeeder::class, + // AssetStatusSeeder::class, ]); } -} +} \ No newline at end of file diff --git a/database/seeders/DisposalSeeder.php b/database/seeders/DisposalSeeder.php new file mode 100644 index 0000000..f1d45fd --- /dev/null +++ b/database/seeders/DisposalSeeder.php @@ -0,0 +1,30 @@ + $i, // Assuming you have 1000 petis in the 'petis' table + 'customer_id' => $i, // Assuming you have 1000 customers in the 'customers' table + 'warehouse_id' => $i, // Assuming you have 4 warehouses in the 'm_warehouses' table + 'date_disposal' => now(), + 'description' => 'Description', + 'status_disposal' => 'INAKTIF', + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } +} \ No newline at end of file diff --git a/database/seeders/Kondisi_PetiSeeder.php b/database/seeders/Kondisi_PetiSeeder.php index c1cbac7..d6666af 100644 --- a/database/seeders/Kondisi_PetiSeeder.php +++ b/database/seeders/Kondisi_PetiSeeder.php @@ -3,7 +3,6 @@ namespace Database\Seeders; use App\Models\Kondisi_Peti; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class Kondisi_PetiSeeder extends Seeder @@ -28,5 +27,14 @@ class Kondisi_PetiSeeder extends Seeder 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); + + for ($i = 3; $i <= 100; $i++) { + Kondisi_Peti::create([ + 'nama_kondisi' => 'Kondisi ' . $i, + 'deskripsi_kondisi' => 'Description for Kondisi ' . $i, + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ]); + } } -} +} \ No newline at end of file diff --git a/database/seeders/PetiSeeder.php b/database/seeders/PetiSeeder.php index d1fc4ee..15e9ad8 100644 --- a/database/seeders/PetiSeeder.php +++ b/database/seeders/PetiSeeder.php @@ -2,10 +2,8 @@ namespace Database\Seeders; -use Illuminate\Support\Str; +use App\Models\Peti; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; class PetiSeeder extends Seeder { @@ -14,117 +12,23 @@ class PetiSeeder extends Seeder */ public function run() { - // Generate 5 dummy data - // for ($i = 0; $i < 5; $i++) { - // DB::table('petis')->insert([ - // 'tipe_peti_id' => $this->getRandomId('type_petis'), - // 'warna' => 'Warna', - // 'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), - // 'packing_no' => rand(1, 100), - // 'customer_id' => $this->getRandomId('customers'), - // 'jumlah' => rand(1, 10), - // 'date_pembuatan' => now(), - // 'warehouse_id' => $this->getRandomId('m_warehouses'), - // 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), - // 'status' => 'AKTIF', - // 'created_at' => now(), - // 'updated_at' => now(), - // 'created_by' => 'Seeder', - // 'updated_by' => 'Seeder', - // ]); - // } - DB::table('petis')->insert([ - [ - 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Warna', - 'fix_lot' => 'Dummy Fix Lot 1', - 'packing_no' => 1, - 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => 1, + for ($i = 1; $i <= 100; $i++) { + Peti::create([ + 'tipe_peti_id' => $i, + 'warna' => 'Warna ' . $i, + 'fix_lot' => 'Dummy Fix Lot ' . $i, + 'packing_no' => $i, + 'customer_id' => $i, + 'jumlah' => $i, 'date_pembuatan' => now(), - 'warehouse_id' => 1, - 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + 'warehouse_id' => $i, // Adjust based on the number of warehouses + 'kondisipeti_id' => $i, 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', - ], - [ - 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Warna', - 'fix_lot' => 'Dummy Fix Lot 2', - 'packing_no' => 2, - 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => 2, - 'date_pembuatan' => now(), - 'warehouse_id' => 2, - 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), - 'status' => 'AKTIF', - 'created_at' => now(), - 'updated_at' => now(), - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ], - [ - 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Warna', - 'fix_lot' => 'Dummy Fix Lot 3', - 'packing_no' => 3, - 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => 3, - 'date_pembuatan' => now(), - 'warehouse_id' => 3, - 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), - 'status' => 'AKTIF', - 'created_at' => now(), - 'updated_at' => now(), - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ], - [ - 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Warna', - 'fix_lot' => 'Dummy Fix Lot 4', - 'packing_no' => 4, - 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => 4, - 'date_pembuatan' => now(), - 'warehouse_id' => 4, - 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), - 'status' => 'AKTIF', - 'created_at' => now(), - 'updated_at' => now(), - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ], - [ - 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Warna', - 'fix_lot' => 'Dummy Fix Lot 5', - 'packing_no' => 5, - 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => 5, - 'date_pembuatan' => now(), - 'warehouse_id' => 1, - 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), - 'status' => 'AKTIF', - 'created_at' => now(), - 'updated_at' => now(), - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ], - ]); - } - - /** - * Get a random ID from a specific table - * - * @param string $tableName - * @return string|null - */ - protected function getRandomId($table) - { - return DB::table($table)->inRandomOrder()->first()->id; + ]); + } } -} +} \ No newline at end of file diff --git a/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php index 19d9a3f..af6779a 100644 --- a/database/seeders/RoleSeeder.php +++ b/database/seeders/RoleSeeder.php @@ -3,7 +3,6 @@ namespace Database\Seeders; use App\Models\m_role; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class RoleSeeder extends Seeder @@ -28,5 +27,14 @@ class RoleSeeder extends Seeder 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); + + // for ($i = 3; $i <= 100; $i++) { + // m_role::create([ + // 'name' => 'Role ' . $i, + // 'description' => 'Description ' . $i, + // 'created_by' => 'Seeder', + // 'updated_by' => 'Seeder', + // ]); + // } } -} +} \ No newline at end of file diff --git a/database/seeders/TipePetiSeeder.php b/database/seeders/TipePetiSeeder.php new file mode 100644 index 0000000..d79c90d --- /dev/null +++ b/database/seeders/TipePetiSeeder.php @@ -0,0 +1,48 @@ + 'Kecil', + 'size_peti' => '2 X 2 X 2', + 'description' => 'Peti dengan ukuran kecil', + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ]); + Type_peti::create([ + 'type' => 'Standar', + 'size_peti' => '3 X 3 X 3', + 'description' => 'Peti dengan ukuran standar', + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ]); + + for ($i = 3; $i <= 100; $i++) { + Type_peti::create([ + 'type' => 'Type ' . $i, + 'size_peti' => $this->generateSize(), + 'description' => 'Description for Type ' . $i, + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ]); + } + } + + /** + * Generate a random size for the peti. + */ + private function generateSize(): string + { + return rand(1, 10) . ' X ' . rand(1, 10) . ' X ' . rand(1, 10); + } +} \ No newline at end of file diff --git a/database/seeders/TransferSeeder.php b/database/seeders/TransferSeeder.php new file mode 100644 index 0000000..e9654c9 --- /dev/null +++ b/database/seeders/TransferSeeder.php @@ -0,0 +1,29 @@ + $i, // Assuming you have 1000 petis in the 'petis' table + 'name_customer' => $i, // Assuming you have 1000 customers in the 'customers' table + 'source_warehouse' => $i, // Assuming you have 4 warehouses in the 'm_warehouses' table + 'destination_warehouse' => $i, // Assuming you have 4 warehouses in the 'm_warehouses' table + 'date' => now(), + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } +} \ No newline at end of file diff --git a/database/seeders/Type_Peti.php b/database/seeders/Type_Peti.php deleted file mode 100644 index 233271a..0000000 --- a/database/seeders/Type_Peti.php +++ /dev/null @@ -1,32 +0,0 @@ -insert([ - 'type' => 'Kecil', - 'size_peti' => '2 X 2 X 2', - 'description' => 'Peti dengan ukuran kecil', - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ]); - DB::table('type_petis')->insert([ - 'type' => 'Standar', - 'size_peti' => '3 X 3 X 3', - 'description' => 'Peti dengan ukuran standar', - 'created_by' => 'Seeder', - 'updated_by' => 'Seeder', - ]); - } -} diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 561aa38..1c1c119 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -3,10 +3,7 @@ namespace Database\Seeders; use App\Models\User; -// use Faker\Provider\Uuid; -use Ramsey\Uuid\Uuid; use Illuminate\Database\Seeder; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; class UserSeeder extends Seeder { @@ -15,6 +12,7 @@ class UserSeeder extends Seeder */ public function run(): void { + // User admin User::create([ 'username' => 'admin', 'fullname' => 'Admin System', @@ -35,7 +33,7 @@ class UserSeeder extends Seeder 'updated_by' => 'Seeder', ]); - // User lainnya + // User operator User::create([ 'username' => 'Operator', 'fullname' => 'Operator System', @@ -55,5 +53,27 @@ class UserSeeder extends Seeder 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); + + // for ($i = 3; $i <= 100; $i++) { + // User::create([ + // 'username' => 'user' . $i, + // 'fullname' => 'User ' . $i, + // 'nip' => '1234567890123' . $i, + // 'email' => 'user' . $i . '@example.com', + // 'no_hp' => '1234567890' . $i, + // 'divisi' => 'Division ' . $i, + // 'tgl_lahir' => now(), + // 'jenis_kelamin' => ($i % 2 == 0) ? 'Laki-laki' : 'Perempuan', + // 'agama' => ($i % 2 == 0) ? 'Islam' : 'Kristen', + // 'foto' => '', // Ganti dengan nama berkas foto jika diperlukan + // 'role_id' => $i, + // 'warehouse_id' => $i, + // 'address' => 'Address ' . $i, + // 'email_verified_at' => now(), + // 'password' => bcrypt('password'), + // 'created_by' => 'Seeder', + // 'updated_by' => 'Seeder', + // ]); + // } } -} +} \ No newline at end of file diff --git a/database/seeders/WarehouseSeeder.php b/database/seeders/WarehouseSeeder.php index 8d7f34c..b02a0d1 100644 --- a/database/seeders/WarehouseSeeder.php +++ b/database/seeders/WarehouseSeeder.php @@ -13,7 +13,7 @@ class WarehouseSeeder extends Seeder */ public function run(): void { - // Warehouse 1 + // Warehouse Jakarta m_warehouse::create([ 'name' => 'Jakarta', 'description' => 'PT Indonesia Steel Tube Works Jakarta Office', @@ -22,7 +22,7 @@ class WarehouseSeeder extends Seeder 'updated_by' => 'Seeder', ]); - // Warehouse 2 + // Warehouse Bekasi m_warehouse::create([ 'name' => 'Bekasi', 'description' => 'PT Indonesia Steel Tube Works Bekasi Office', @@ -31,7 +31,7 @@ class WarehouseSeeder extends Seeder 'updated_by' => 'Seeder', ]); - // Warehouse 3 + // Warehouse Semarang m_warehouse::create([ 'name' => 'Semarang', 'description' => 'PT Indonesia Steel Tube Works Semarang Office', @@ -40,7 +40,7 @@ class WarehouseSeeder extends Seeder 'updated_by' => 'Seeder', ]); - // Warehouse 4 + // Warehouse Surabaya m_warehouse::create([ 'name' => 'Surabaya', 'description' => 'PT Indonesia Steel Tube Works Surabaya Office', @@ -48,5 +48,16 @@ class WarehouseSeeder extends Seeder 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); + + // Use a loop to add 1000 warehouses + // for ($i = 5; $i <= 100; $i++) { + // m_warehouse::create([ + // 'name' => 'Warehouse ' . $i, + // 'description' => 'Description for Warehouse ' . $i, + // 'address' => 'Address for Warehouse ' . $i, + // 'created_by' => 'Seeder', + // 'updated_by' => 'Seeder', + // ]); + // } } -} +} \ No newline at end of file diff --git a/public/assets/img/398.jpg b/public/assets/img/398.jpg deleted file mode 100644 index 521401e..0000000 Binary files a/public/assets/img/398.jpg and /dev/null differ diff --git a/public/assets/img/8487305.jpg b/public/assets/img/8487305.jpg index 6aa85b0..54206d7 100644 Binary files a/public/assets/img/8487305.jpg and b/public/assets/img/8487305.jpg differ diff --git a/public/assets/img/default-profile.png b/public/assets/img/default-profile.png index 36ab281..4104d22 100644 Binary files a/public/assets/img/default-profile.png and b/public/assets/img/default-profile.png differ diff --git a/public/assets/img/fotocewe.png b/public/assets/img/fotocewe.png deleted file mode 100644 index 04ad35f..0000000 Binary files a/public/assets/img/fotocewe.png and /dev/null differ diff --git a/public/assets/img/fotocowo.png b/public/assets/img/fotocowo.png deleted file mode 100644 index 2b83185..0000000 Binary files a/public/assets/img/fotocowo.png and /dev/null differ diff --git a/public/assets/img/istw_black&white.jpg b/public/assets/img/istw_black&white.jpg index 2ed8584..3cd86de 100644 Binary files a/public/assets/img/istw_black&white.jpg and b/public/assets/img/istw_black&white.jpg differ diff --git a/public/assets/img/istw_grey.png b/public/assets/img/istw_grey.png deleted file mode 100644 index 687cb80..0000000 Binary files a/public/assets/img/istw_grey.png and /dev/null differ diff --git a/public/assets/img/istw_red.jpg b/public/assets/img/istw_red.jpg deleted file mode 100644 index aae243d..0000000 Binary files a/public/assets/img/istw_red.jpg and /dev/null differ diff --git a/public/assets/img/logo_istw.png b/public/assets/img/logo_istw.png index 1fd93e9..ad9484e 100644 Binary files a/public/assets/img/logo_istw.png and b/public/assets/img/logo_istw.png differ diff --git a/public/assets/img/profile2.jpg b/public/assets/img/profile2.jpg deleted file mode 100644 index 10802bd..0000000 Binary files a/public/assets/img/profile2.jpg and /dev/null differ diff --git a/public/assets/img/undraw_posting_photo.svg b/public/assets/img/undraw_posting_photo.svg deleted file mode 100644 index fc0d549..0000000 --- a/public/assets/img/undraw_posting_photo.svg +++ /dev/null @@ -1 +0,0 @@ -posting photo \ No newline at end of file diff --git a/public/assets/img/undraw_profile.svg b/public/assets/img/undraw_profile.svg deleted file mode 100644 index 9802341..0000000 --- a/public/assets/img/undraw_profile.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/img/undraw_profile_1.svg b/public/assets/img/undraw_profile_1.svg deleted file mode 100644 index fcc91c7..0000000 --- a/public/assets/img/undraw_profile_1.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/img/undraw_profile_2.svg b/public/assets/img/undraw_profile_2.svg deleted file mode 100644 index 488d1bd..0000000 --- a/public/assets/img/undraw_profile_2.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/img/undraw_profile_3.svg b/public/assets/img/undraw_profile_3.svg deleted file mode 100644 index eecb335..0000000 --- a/public/assets/img/undraw_profile_3.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/img/undraw_rocket.svg b/public/assets/img/undraw_rocket.svg deleted file mode 100644 index 4542614..0000000 --- a/public/assets/img/undraw_rocket.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/resources/views/dashboard/Disposal/index.blade.php b/resources/views/dashboard/Disposal/index.blade.php index c443f28..d1f5853 100644 --- a/resources/views/dashboard/Disposal/index.blade.php +++ b/resources/views/dashboard/Disposal/index.blade.php @@ -25,8 +25,37 @@
+
+
+ +
+ + + + +
+
+
+ +
+ + + + +
+
+
- +
@@ -34,24 +63,20 @@ - {{-- --}} - @php - $nodisposal = 1; - @endphp - @forelse ($disposal as $data_disposal) + @forelse ($disposals as $data_disposal) - + - - {{-- --}} + @empty + + + @endforelse
NoNama Customer Tanggal Disposal Alasan DisposalStatus PetiAction
{{ $nodisposal++ }}{{ $i++ }} {{ optional($data_disposal->peti)->fix_lot }} {{ optional($data_disposal->customer)->name }} {{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d-m-Y') }}{{ $data_disposal->description }}{{ $data_disposal->status_disposal }}{{ optional($data_disposal)->description }} - +
Data Kosong
- +
+
+
+ + @if (!$disposals->isEmpty()) +

Showing {{ $disposals->firstItem() }} to + {{ $disposals->lastItem() }} of + {{ $disposals->total() }} entries

+ @endif +
+
+ @if ($disposals->total() > $disposals->perPage()) + + @endif +
diff --git a/resources/views/dashboard/Disposal/show.blade.php b/resources/views/dashboard/Disposal/show.blade.php deleted file mode 100644 index 8084102..0000000 --- a/resources/views/dashboard/Disposal/show.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@extends('layouts.main') -@section('content') - @include('layouts.components.alert-prompt') -

Halaman Show Disposal

-@endsection diff --git a/resources/views/dashboard/History/Peminjaman/index.blade.php b/resources/views/dashboard/History/Peminjaman/index.blade.php index 84fff5b..d5f5345 100644 --- a/resources/views/dashboard/History/Peminjaman/index.blade.php +++ b/resources/views/dashboard/History/Peminjaman/index.blade.php @@ -77,7 +77,7 @@ @empty - Data Kosong + Data Kosong @endforelse diff --git a/resources/views/dashboard/History/Transfer/index.blade.php b/resources/views/dashboard/History/Transfer/index.blade.php index e221704..969b221 100644 --- a/resources/views/dashboard/History/Transfer/index.blade.php +++ b/resources/views/dashboard/History/Transfer/index.blade.php @@ -18,8 +18,37 @@
+
+
+ + + + + + + +
+
+ +
+ + + + +
+
+
- +
@@ -31,22 +60,56 @@ - @php - $notransfer = 1; - @endphp - @foreach ($transfer as $data_transfer) + @forelse ($transfer as $data_transfer) - - - - - - + + + + + + - @endforeach + @empty + + + + @endforelse
No
{{ $notransfer++ }}{{ $data_transfer->peti->fix_lot }}{{ $data_transfer->customer->name ?? '' }}{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}{{ $data_transfer->sourceWarehouse->name ?? '' }}{{ $data_transfer->destinationWarehouse->name }}{{ $i++ }}{{ optional($data_transfer->peti)->fix_lot }}{{ optional($data_transfer->customer)->name }}{{ \Carbon\Carbon::parse($data_transfer->date)->format('d-m-Y') }}{{ optional($data_transfer->sourceWarehouse)->name }}{{ optional($data_transfer->destinationWarehouse)->name }}
Data Kosong
+
+
+ + @if (!$transfer->isEmpty()) +

Showing {{ $transfer->firstItem() }} to + {{ $transfer->lastItem() }} of + {{ $transfer->total() }} entries

+ @endif +
+
+ @if ($transfer->total() > $transfer->perPage()) + + @endif +
+
@endsection diff --git a/resources/views/dashboard/Master_Data/Customer/index.blade.php b/resources/views/dashboard/Master_Data/Customer/index.blade.php index a9c94fd..52cb970 100644 --- a/resources/views/dashboard/Master_Data/Customer/index.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/index.blade.php @@ -3,7 +3,7 @@ @include('layouts.components.alert-prompt') @if (auth()->user()->role_id == 1)
-
@else @@ -88,7 +150,8 @@