From e729e9b92ee57b77725c68e1a55b3079cda8837a Mon Sep 17 00:00:00 2001 From: Gunawan19621 Date: Tue, 31 Oct 2023 22:55:43 +0700 Subject: [PATCH 1/2] update validasi warehouse --- .../Auth/AuthenticatedSessionController.php | 25 +++- .../Auth/RedirectAuthController.php | 28 ++++- app/Http/Controllers/CustomerController.php | 26 +--- app/Http/Controllers/M_userController.php | 12 +- app/Http/Controllers/WarehouseController.php | 19 +-- app/Http/Requests/ValidasiCreateCustomer.php | 53 +++++++++ app/Http/Requests/ValidasiCreateUser.php | 78 ++++++++++++ app/Http/Requests/ValidasiCreateWarehouse.php | 45 +++++++ app/Http/Requests/ValidasiUpdateWarehouse.php | 45 +++++++ app/Models/Customer.php | 6 +- ...10_23_073314_create_m_warehouses_table.php | 2 +- .../2023_10_23_075245_create_users_table.php | 22 ++-- ...23_10_28_080457_create_customers_table.php | 14 +-- database/seeders/Customer.php | 28 ++--- database/seeders/RoleSeeder.php | 6 +- database/seeders/UserSeeder.php | 26 ++-- resources/views/auth/login.blade.php | 20 +++- .../Master_Data/Customer/create.blade.php | 34 +----- .../Master_Data/Customer/edit.blade.php | 35 +----- .../Master_Data/Customer/index.blade.php | 7 +- .../Master_Data/Customer/show.blade.php | 29 +---- .../Master_Data/User/create.blade.php | 5 + .../Master_Data/User/index.blade.php | 1 + .../Master_Data/Warehouse/index.blade.php | 111 +++++++++--------- .../layouts/components/alert-prompt.blade.php | 26 ++++ resources/views/layouts/main.blade.php | 4 +- 26 files changed, 439 insertions(+), 268 deletions(-) create mode 100644 app/Http/Requests/ValidasiCreateCustomer.php create mode 100644 app/Http/Requests/ValidasiCreateUser.php create mode 100644 app/Http/Requests/ValidasiCreateWarehouse.php create mode 100644 app/Http/Requests/ValidasiUpdateWarehouse.php create mode 100644 resources/views/layouts/components/alert-prompt.blade.php diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index 494a106..ed42c84 100644 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -23,14 +23,29 @@ class AuthenticatedSessionController extends Controller /** * Handle an incoming authentication request. */ - public function store(LoginRequest $request): RedirectResponse + public function store(Request $request) { - $request->authenticate(); + $request->validate([ + 'email' => 'required|email', + 'password' => 'required', + ]); + + if (!Auth::attempt($request->only('email', 'password'), $request->input('remember'))) { + return back() + ->withInput($request->only('email')) + ->withErrors(['email' => 'Kombinasi email dan password tidak valid.']); + } + + return redirect(RouteServiceProvider::HOME); + } + // public function store(LoginRequest $request): RedirectResponse + // { + // $request->authenticate(); - $request->session()->regenerate(); + // $request->session()->regenerate(); - return redirect()->intended(RouteServiceProvider::HOME); - } + // return redirect()->intended(RouteServiceProvider::HOME); + // } /** * Destroy an authenticated session. diff --git a/app/Http/Controllers/Auth/RedirectAuthController.php b/app/Http/Controllers/Auth/RedirectAuthController.php index cbe2cb5..93a2b6b 100644 --- a/app/Http/Controllers/Auth/RedirectAuthController.php +++ b/app/Http/Controllers/Auth/RedirectAuthController.php @@ -10,13 +10,29 @@ class RedirectAuthController extends Controller { public function redirectAuth() { - if (Auth::check() && Auth::user()->role_id == '1') { - // Admin - return redirect()->route('dashboard.home.admin'); - } elseif (Auth::check() && Auth::user()->role_id == 'user') { - return redirect()->route('dashboard.home.user'); + if (Auth::check()) { + if (Auth::user()->role_id == '1') { + // Admin + return redirect()->route('dashboard.home.admin'); + } else { + return redirect()->route('dashboard.home.admin'); + // User (role_id selain 1) + // return redirect()->route('dashboard.home.user'); + } } else { - return redirect()->route('login'); + // Tidak ada akun atau kesalahan login + // return redirect()->route('login')->with('error', 'Kesalahan email atau password.'); + return redirect()->route('login')->with('error', 'Kesalahan email atau password.'); } + + // if (Auth::check() && Auth::user()->role_id == '1') { + // // Admin + // return redirect()->route('dashboard.home.admin'); + // } elseif (Auth::check() && Auth::user()->role_id == '2') { + // return redirect()->route('dashboard.home.admin'); + // // return redirect()->route('dashboard.home.user'); + // } else { + // return redirect()->route('login'); + // } } } diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 6682993..451aca2 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Http\Requests\ValidasiCreateCustomer; use App\Models\Customer; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -34,26 +35,13 @@ class CustomerController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreateCustomer $request) { - // dd('oke'); - $request->validate([ - 'name' => 'required', - 'code_customer' => 'required', - 'lot_no' => 'required', - 'nip' => '', - 'no_hp' => 'required', - 'tgl_lahir' => '', - 'jenis_kelamin' => '', - 'agama' => '', - 'address' => 'required', - ]); - try { $currentUser = Auth::user(); $validatedData = $request->except('_token'); - $validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by - $validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by + $validatedData['created_by'] = $currentUser->id; // Menggunakan nama pengguna sebagai created_by + $validatedData['updated_by'] = $currentUser->id; // Menggunakan nama pengguna sebagai updated_by Customer::create($validatedData); return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil ditambahkan'); } catch (\Throwable $th) { @@ -95,11 +83,7 @@ class CustomerController extends Controller 'name' => 'required', 'code_customer' => 'required', 'lot_no' => 'required', - 'nip' => 'required', - 'no_hp' => 'required', - 'tgl_lahir' => 'required', - 'jenis_kelamin' => 'required', - 'agama' => 'required', + 'no_tlp' => 'required', 'address' => 'required', ]); // dd($request); diff --git a/app/Http/Controllers/M_userController.php b/app/Http/Controllers/M_userController.php index f85b4cf..9d39ad3 100644 --- a/app/Http/Controllers/M_userController.php +++ b/app/Http/Controllers/M_userController.php @@ -7,6 +7,7 @@ use App\Models\m_role; use App\Models\m_warehouse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use App\Http\Requests\ValidasiCreateUser; class M_userController extends Controller { @@ -40,17 +41,8 @@ class M_userController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreateUser $request) { - $request->validate([ - 'username' => 'required', - 'fullname' => 'required', - 'email' => 'required|email', - 'divisi' => 'required', - 'role_id' => 'required', - 'warehouse_id' => 'required', - 'password' => 'required', - ]); try { $currentUser = Auth::user(); diff --git a/app/Http/Controllers/WarehouseController.php b/app/Http/Controllers/WarehouseController.php index fdf1aab..aaccb10 100644 --- a/app/Http/Controllers/WarehouseController.php +++ b/app/Http/Controllers/WarehouseController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use App\Http\Requests\ValidasiCreateWarehouse; +use App\Http\Requests\ValidasiUpdateWarehouse; use App\Models\m_warehouse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -30,13 +32,9 @@ class WarehouseController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreateWarehouse $request) { - $request->validate([ - 'name' => 'required', - 'description' => 'required', - 'address' => 'required', - ]); + try { $currentUser = Auth::user(); $validatedData = $request->except('_token'); @@ -71,15 +69,8 @@ class WarehouseController extends Controller /** * Update the specified resource in storage. */ - public function update(Request $request, $id) + public function update(ValidasiUpdateWarehouse $request, $id) { - // dd('oke'); - $request->validate([ - 'name' => 'required', - 'description' => 'required', - 'address' => 'required', - ]); - // dd($request); try { $warehouse = m_warehouse::findOrFail($id); $warehouse->update($request->all()); diff --git a/app/Http/Requests/ValidasiCreateCustomer.php b/app/Http/Requests/ValidasiCreateCustomer.php new file mode 100644 index 0000000..17e98b4 --- /dev/null +++ b/app/Http/Requests/ValidasiCreateCustomer.php @@ -0,0 +1,53 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:50', + 'code_customer' => 'required|string|max:15|unique:customers,code_customer', + 'lot_no' => 'required|string|max:50', + 'no_tlp' => 'required|numeric|max:20', + 'address' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Kolom name wajib diisi.', + 'name.string' => 'Kolom name harus berupa teks.', + 'name.max' => 'Kolom name tidak boleh lebih dari :max karakter.', + 'code_customer.required' => 'Kolom code_customer wajib diisi.', + 'code_customer.string' => 'Kolom code_customer harus berupa teks.', + 'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.', + 'code_customer.unique' => 'Kolom code_customer sudah ada.', + 'lot_no.required' => 'Kolom lot_no wajib diisi.', + 'lot_no.string' => 'Kolom lot_no harus berupa teks.', + 'lot_no.max' => 'Kolom lot_no tidak boleh lebih dari :max karakter.', + 'no_tlp.required' => 'Kolom no_tlp wajib diisi.', + 'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.', + 'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.', + 'address.required' => 'Kolom address wajib diisi.', + 'address.string' => 'Kolom address harus berupa teks.', + ]; + } +} diff --git a/app/Http/Requests/ValidasiCreateUser.php b/app/Http/Requests/ValidasiCreateUser.php new file mode 100644 index 0000000..7e47988 --- /dev/null +++ b/app/Http/Requests/ValidasiCreateUser.php @@ -0,0 +1,78 @@ +|string> + */ + public function rules(): array + { + return [ + 'username' => 'required|string|max:32', + 'fullname' => 'required|string|max:32', + 'nip' => 'nullable|numeric|max:20', + 'email' => 'required|email|string|max:45', + 'no_hp' => 'nullable|numeric|max:15', + 'divisi' => 'nullable|string|max:50', + 'foto' => 'nullable|string|max:255', + 'role_id' => 'required|exists:m_roles,id', + 'warehouse_id' => 'nullable|exists:m_warehouses,id', + 'address' => 'nullable|string', + 'email_verified_at' => 'nullable|date', + 'password' => 'required|string|min:6|max:16', + 'created_by' => 'nullable|string|max:32', + 'updated_by' => 'nullable|string|max:32', + ]; + } + + public function messages() + { + return [ + 'username.required' => 'Kolom username wajib diisi.', + 'username.string' => 'Kolom username harus berupa teks.', + 'username.max' => 'Kolom username tidak boleh lebih dari :max karakter.', + 'fullname.required' => 'Kolom fullname wajib diisi.', + 'fullname.string' => 'Kolom fullname harus berupa teks.', + 'fullname.max' => 'Kolom fullname tidak boleh lebih dari :max karakter.', + 'nip.numeric' => 'Kolom NIP harus berisi angka.', + 'nip.max' => 'Kolom NIP tidak boleh lebih dari :max karakter.', + 'email.required' => 'Kolom email wajib diisi.', + 'email.email' => 'Format email tidak valid.', + 'email.string' => 'Kolom email harus berupa teks.', + 'email.max' => 'Kolom email tidak boleh lebih dari :max karakter.', + 'no_hp.numeric' => 'Kolom no_hp harus berisi angka.', + 'no_hp.max' => 'Kolom no_hp tidak boleh lebih dari :max karakter.', + 'divisi.string' => 'Kolom divisi harus berupa teks.', + 'divisi.max' => 'Kolom divisi tidak boleh lebih dari :max karakter.', + 'foto.string' => 'Kolom foto harus berupa teks.', + 'foto.max' => 'Kolom foto tidak boleh lebih dari :max karakter.', + 'role_id.required' => 'Kolom role_id wajib diisi.', + 'role_id.exists' => 'Role yang dipilih tidak valid.', + 'warehouse_id.exists' => 'Warehouse yang dipilih tidak valid.', + 'address.string' => 'Kolom address harus berupa teks.', + 'email_verified_at.date' => 'Format tanggal email_verified_at tidak valid.', + 'password.required' => 'Kolom password wajib diisi.', + 'password.string' => 'Kolom password harus berupa teks.', + 'password.min' => 'Kolom password minimal harus :min karakter.', + 'password.max' => 'Kolom password tidak boleh lebih dari :max karakter.', + 'created_by.string' => 'Kolom created_by harus berupa teks.', + 'created_by.max' => 'Kolom created_by tidak boleh lebih dari :max karakter.', + 'updated_by.string' => 'Kolom updated_by harus berupa teks.', + 'updated_by.max' => 'Kolom updated_by tidak boleh lebih dari :max karakter.', + ]; + } +} diff --git a/app/Http/Requests/ValidasiCreateWarehouse.php b/app/Http/Requests/ValidasiCreateWarehouse.php new file mode 100644 index 0000000..148226b --- /dev/null +++ b/app/Http/Requests/ValidasiCreateWarehouse.php @@ -0,0 +1,45 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:32', + 'description' => 'required|string|max:255', + 'address' => 'required|string|max:255', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Kolom nama wajib diisi.', + 'name.string' => 'Kolom nama harus berupa teks.', + 'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.', + 'description.required' => 'Kolom deskripsi wajib diisi.', + 'description.string' => 'Kolom deskripsi harus berupa teks.', + 'description.max' => 'Kolom deskripsi tidak boleh lebih dari :max karakter.', + 'address.required' => 'Kolom alamat wajib diisi.', + 'address.string' => 'Kolom alamat harus berupa teks.', + 'address.max' => 'Kolom alamat tidak boleh lebih dari :max karakter.', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdateWarehouse.php b/app/Http/Requests/ValidasiUpdateWarehouse.php new file mode 100644 index 0000000..995937e --- /dev/null +++ b/app/Http/Requests/ValidasiUpdateWarehouse.php @@ -0,0 +1,45 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:32', + 'description' => 'required|string|max:255', + 'address' => 'required|string|max:255', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Kolom nama wajib diisi.', + 'name.string' => 'Kolom nama harus berupa teks.', + 'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.', + 'description.required' => 'Kolom deskripsi wajib diisi.', + 'description.string' => 'Kolom deskripsi harus berupa teks.', + 'description.max' => 'Kolom deskripsi tidak boleh lebih dari :max karakter.', + 'address.required' => 'Kolom alamat wajib diisi.', + 'address.string' => 'Kolom alamat harus berupa teks.', + 'address.max' => 'Kolom alamat tidak boleh lebih dari :max karakter.', + ]; + } +} diff --git a/app/Models/Customer.php b/app/Models/Customer.php index 2e5da6f..7ef3cb5 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -15,11 +15,7 @@ class Customer extends Model 'name', 'code_customer', 'lot_no', - 'nip', - 'no_hp', - 'tgl_lahir', - 'jenis_kelamin', - 'agama', + 'no_tlp', 'address', 'created_by', 'updated_by', diff --git a/database/migrations/2023_10_23_073314_create_m_warehouses_table.php b/database/migrations/2023_10_23_073314_create_m_warehouses_table.php index a0170a9..50c9bae 100644 --- a/database/migrations/2023_10_23_073314_create_m_warehouses_table.php +++ b/database/migrations/2023_10_23_073314_create_m_warehouses_table.php @@ -13,7 +13,7 @@ return new class extends Migration { Schema::create('m_warehouses', function (Blueprint $table) { $table->id(); - $table->string('name', 200)->nullable(); + $table->string('name', 32)->nullable(); $table->text('description')->nullable(); $table->text('address')->nullable(); $table->timestamps(); diff --git a/database/migrations/2023_10_23_075245_create_users_table.php b/database/migrations/2023_10_23_075245_create_users_table.php index bbfbdcd..2e35b64 100644 --- a/database/migrations/2023_10_23_075245_create_users_table.php +++ b/database/migrations/2023_10_23_075245_create_users_table.php @@ -14,28 +14,28 @@ return new class extends Migration { Schema::create('users', function (Blueprint $table) { $table->id(); - $table->string('username', 50)->nullable(); - $table->string('fullname', 255)->nullable(); + + $table->string('username', 32)->nullable(); + $table->string('fullname', 50)->nullable(); $table->string('nip', 20)->nullable(); - $table->string('email', 255)->nullable(); - $table->string('no_hp', 20)->nullable(); - $table->string('divisi', 255)->nullable(); + $table->string('email', 45)->nullable(); + $table->string('no_hp', 15)->nullable(); + $table->string('divisi', 100)->nullable(); $table->date('tgl_lahir')->nullable(); - $table->string('jenis_kelamin', 30)->nullable(); - $table->string('agama', 30)->nullable(); $table->string('foto', 255)->nullable(); - // $table->bigInteger('role_id')->unsigned()->nullable(); - // $table->foreign('role_id')->references('id')->on('m_roles')->onDelete('set null'); + $table->string('jenis_kelamin', 20)->nullable(); + $table->string('agama', 15)->nullable(); $table->foreignId('role_id')->constrained('m_roles')->onDelete('cascade'); $table->bigInteger('warehouse_id')->unsigned()->nullable(); $table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null'); $table->text('address')->nullable(); $table->timestamp('email_verified_at')->nullable(); $table->string('password', 255)->nullable(); + $table->string('created_by', 50)->nullable(); + $table->string('updated_by', 50)->nullable(); + $table->rememberToken(); $table->timestamps(); - $table->string('created_by', 200)->nullable(); - $table->string('updated_by', 200)->nullable(); $table->softDeletes(); }); } diff --git a/database/migrations/2023_10_28_080457_create_customers_table.php b/database/migrations/2023_10_28_080457_create_customers_table.php index 2625558..d65cd05 100644 --- a/database/migrations/2023_10_28_080457_create_customers_table.php +++ b/database/migrations/2023_10_28_080457_create_customers_table.php @@ -13,19 +13,15 @@ return new class extends Migration { Schema::create('customers', function (Blueprint $table) { $table->id(); - $table->string('name', 200); - $table->string('code_customer', 50); + $table->string('name', 50); + $table->string('code_customer', 15); $table->string('lot_no', 50); - $table->string('nip', 20)->nullable(); - $table->string('no_hp', 20)->nullable(); - $table->date('tgl_lahir')->nullable(); - $table->string('jenis_kelamin', 30)->nullable(); - $table->string('agama', 30)->nullable(); + $table->string('no_tlp', 20)->nullable(); $table->text('address')->nullable(); $table->timestamps(); $table->softDeletes(); - $table->string('created_by', 200)->nullable(); - $table->string('updated_by', 200)->nullable(); + $table->string('created_by', 50)->nullable(); + $table->string('updated_by', 50)->nullable(); }); } diff --git a/database/seeders/Customer.php b/database/seeders/Customer.php index 206b1b8..e776fa1 100644 --- a/database/seeders/Customer.php +++ b/database/seeders/Customer.php @@ -14,28 +14,20 @@ class Customer extends Seeder public function run(): void { DB::table('customers')->insert([ - 'name' => 'Gunawan', - 'code_customer' => 'G', - 'lot_no' => 'CWT', - 'nip' => '1234567890987654', - 'no_hp' => '085159079010', - // 'tgl_lahir' => '19-06-2001', - 'jenis_kelamin' => 'Laki-Laki', - 'agama' => 'Islam', - 'address' => 'CIwatu', + 'name' => 'DHARMA', + 'code_customer' => 'DPM', + 'lot_no' => 'JKT23', + 'no_tlp' => '02122344', + 'address' => 'Jalan Raya Ciwatu', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); DB::table('customers')->insert([ - 'name' => 'Andra Ryandra', - 'code_customer' => 'AR', - 'lot_no' => 'KA', - 'nip' => '1234567890987', - 'no_hp' => '085159079011', - // 'tgl_lahir' => '19-06-2001', - 'jenis_kelamin' => 'Laki-Laki', - 'agama' => 'Islam', - 'address' => 'CIwatu', + 'name' => 'ADHI CHANDRA', + 'code_customer' => 'ACJ', + 'lot_no' => 'JKT23', + 'no_tlp' => '02198765', + 'address' => 'Jalan Raya Gelarmendala', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); diff --git a/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php index b09ae13..19d9a3f 100644 --- a/database/seeders/RoleSeeder.php +++ b/database/seeders/RoleSeeder.php @@ -16,15 +16,15 @@ class RoleSeeder extends Seeder // Role Admin m_role::create([ 'name' => 'Admin', - 'description' => 'Peran admin sistem', + 'description' => 'admin sistem', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); // Role User m_role::create([ - 'name' => 'User', - 'description' => 'Peran pengguna biasa', + 'name' => 'Operator', + 'description' => 'Operator sistem', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 0b399e0..2fda37a 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -15,10 +15,10 @@ class UserSeeder extends Seeder { User::create([ 'username' => 'admin', - 'fullname' => 'Admin User', - 'nip' => '12345', + 'fullname' => 'Admin System', + 'nip' => '1234567890123456', 'email' => 'admin@gmail.com', - 'no_hp' => '1234567890', + 'no_hp' => '085159079010', 'divisi' => 'Admin Division', 'tgl_lahir' => '1990-01-01', 'jenis_kelamin' => 'Laki-laki', @@ -26,7 +26,7 @@ class UserSeeder extends Seeder 'foto' => '', // Ganti dengan nama berkas foto jika diperlukan 'role_id' => 1, // Ganti dengan ID peran yang sesuai 'warehouse_id' => 1, // Ganti dengan ID gudang yang sesuai - 'address' => 'Alamat Admin', + 'address' => 'Jalan Ciwatu', 'email_verified_at' => now(), 'password' => bcrypt('admin'), 'created_by' => 'Seeder', @@ -35,21 +35,21 @@ class UserSeeder extends Seeder // User lainnya User::create([ - 'username' => 'user1', - 'fullname' => 'User Satu', - 'nip' => '54321', - 'email' => 'user1@gmail.com', - 'no_hp' => '9876543210', - 'divisi' => 'Divisi Satu', + 'username' => 'Operator', + 'fullname' => 'Operator System', + 'nip' => '6543210987654321', + 'email' => 'operator@gmail.com', + 'no_hp' => '087779767603', + 'divisi' => 'Operator Gudang', 'tgl_lahir' => '1985-05-15', 'jenis_kelamin' => 'Perempuan', - 'agama' => 'Kristen', + 'agama' => 'Islam', 'foto' => '', // Ganti dengan nama berkas foto jika diperlukan 'role_id' => 2, // Ganti dengan ID peran yang sesuai 'warehouse_id' => 2, // Ganti dengan ID gudang yang sesuai - 'address' => 'Alamat User Satu', + 'address' => 'Jalan Gelarmendala', 'email_verified_at' => now(), - 'password' => bcrypt('user1'), + 'password' => bcrypt('operator'), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 49d4345..b2d436f 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -40,7 +40,7 @@
-

Welcome Back!

+

Selamat Datang!

@csrf @@ -49,16 +49,26 @@ aria-describedby="emailHelp" name="email" value="{{ old('email') }}" required autofocus autocomplete="username" placeholder="Masukan Email anda"> + @if ($errors->has('email')) +
+ {{ $errors->first('email') }} +
+ @endif
+ @if ($errors->has('password')) +
+ {{ $errors->first('password') }} +
+ @endif
- + @@ -79,9 +89,9 @@
diff --git a/resources/views/dashboard/Master_Data/Customer/create.blade.php b/resources/views/dashboard/Master_Data/Customer/create.blade.php index 81b0656..9857721 100644 --- a/resources/views/dashboard/Master_Data/Customer/create.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/create.blade.php @@ -1,5 +1,6 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt')
@@ -24,36 +25,9 @@ - - - - - - - - - - - - - - + + diff --git a/resources/views/dashboard/Master_Data/Customer/edit.blade.php b/resources/views/dashboard/Master_Data/Customer/edit.blade.php index 08b0f80..4c2be5d 100644 --- a/resources/views/dashboard/Master_Data/Customer/edit.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/edit.blade.php @@ -26,38 +26,9 @@ - - - - - - - - - - - - - - + + diff --git a/resources/views/dashboard/Master_Data/Customer/index.blade.php b/resources/views/dashboard/Master_Data/Customer/index.blade.php index 6436634..f980ebd 100644 --- a/resources/views/dashboard/Master_Data/Customer/index.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/index.blade.php @@ -1,10 +1,11 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt')
-
Data User
+
Data Customer
+ + + @include('layouts.components.alert-prompt') + +
@csrf diff --git a/resources/views/dashboard/Master_Data/User/index.blade.php b/resources/views/dashboard/Master_Data/User/index.blade.php index 67c0976..450bc33 100644 --- a/resources/views/dashboard/Master_Data/User/index.blade.php +++ b/resources/views/dashboard/Master_Data/User/index.blade.php @@ -1,5 +1,6 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt')
diff --git a/resources/views/dashboard/Master_Data/Warehouse/index.blade.php b/resources/views/dashboard/Master_Data/Warehouse/index.blade.php index cb453f8..f271f21 100644 --- a/resources/views/dashboard/Master_Data/Warehouse/index.blade.php +++ b/resources/views/dashboard/Master_Data/Warehouse/index.blade.php @@ -1,67 +1,66 @@ @extends('layouts.main') @section('title', 'Warehouse') @section('content') -
-
-
-
-
-
Data Warehouse
-
- + + @include('layouts.components.alert-prompt') + +
+
+
+
+
Data Warehouse
+
+
-
-
- - + +
+
+
+ + + + + + + + + + + @php + $nowarehouses = 1; + @endphp + @foreach ($warehouses as $data) - - - - - + + + + + - - - @php - $nowarehouses = 1; - @endphp - @foreach ($warehouses as $data) - - - - - - - - @endforeach - -
No.Nama WarehouseDeskripsiAlamatAction
No.Nama WarehouseDeskripsiAlamatAction{{ $nowarehouses++ }}{{ $data->name }}{{ $data->description }}{{ $data->address }} + + + + + @csrf + @method('DELETE') + + +
{{ $nowarehouses++ }}{{ $data->name }}{{ $data->description }}{{ $data->address }} - - - -
- @csrf - @method('DELETE') - -
-
-
- + @endforeach + +
+
diff --git a/resources/views/layouts/components/alert-prompt.blade.php b/resources/views/layouts/components/alert-prompt.blade.php new file mode 100644 index 0000000..60e7862 --- /dev/null +++ b/resources/views/layouts/components/alert-prompt.blade.php @@ -0,0 +1,26 @@ +@if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+@endif + +@if (Session::has('success')) + +@endif + + + diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 8efa85b..605164c 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -28,7 +28,7 @@
- @if (session()->has('success')) + {{-- @if (session()->has('success'))
{{ session()->get('success') }}
@@ -36,7 +36,7 @@
X {{ session()->get('error') }}
- @endif + @endif --}} @yield('content') From a8681f140608d5cdadfe4fc3d26028901857f9da Mon Sep 17 00:00:00 2001 From: Gunawan19621 Date: Wed, 1 Nov 2023 10:55:02 +0700 Subject: [PATCH 2/2] update validasi dan hak akses --- .../Auth/RedirectAuthController.php | 2 +- app/Http/Controllers/CustomerController.php | 12 +- app/Http/Controllers/HomeController.php | 14 +- app/Http/Controllers/PetiController.php | 150 ++++++------ app/Http/Controllers/RoleController.php | 24 +- app/Http/Controllers/TypePetiController.php | 20 +- app/Http/Requests/ValidasiCreateCustomer.php | 3 +- app/Http/Requests/ValidasiCreatePeti.php | 60 +++++ app/Http/Requests/ValidasiCreateRole.php | 40 +++ app/Http/Requests/ValidasiCreateType_Peti.php | 44 ++++ app/Http/Requests/ValidasiUpdateCustomer.php | 52 ++++ app/Http/Requests/ValidasiUpdatePeti.php | 59 +++++ app/Http/Requests/ValidasiUpdateRole.php | 40 +++ app/Http/Requests/ValidasiUpdateType_Peti.php | 44 ++++ app/Http/Requests/ValidasiUpdateUser.php | 78 ++++++ ...2023_10_23_075239_create_m_roles_table.php | 6 +- ...3_10_28_083930_create_type_petis_table.php | 8 +- database/seeders/Type_Peti.php | 8 +- resources/views/auth/login.blade.php | 22 +- .../Master_Data/Asset/asset_pdf.blade.php | 84 ------- .../Master_Data/Asset/index.blade.php | 231 ------------------ .../Master_Data/Asset/show.blade.php | 65 ----- .../Master_Data/Customer/create.blade.php | 1 + .../Master_Data/Customer/edit.blade.php | 2 + .../Master_Data/Customer/index.blade.php | 120 ++++----- .../Manajemen_Peti/Peti/create.blade.php | 2 + .../Manajemen_Peti/Peti/edit.blade.php | 2 + .../Manajemen_Peti/Peti/index.blade.php | 148 +++++------ .../Manajemen_Peti/Peti/label_pdf.blade.php | 1 + .../Manajemen_Peti/Peti/show.blade.php | 13 +- .../Manajemen_Peti/Type_peti/create.blade.php | 2 + .../Manajemen_Peti/Type_peti/edit.blade.php | 2 + .../Manajemen_Peti/Type_peti/index.blade.php | 117 ++++----- .../Master_Data/Role/index.blade.php | 7 +- .../Master_Data/User/create.blade.php | 7 +- .../dashboard/Master_Data/User/edit.blade.php | 2 + .../Master_Data/User/index.blade.php | 146 +++++------ .../Master_Data/Warehouse/index.blade.php | 117 ++++----- .../dashboard/Peminjaman/index.blade.php | 126 +++++----- .../dashboard/Pengembalian/index.blade.php | 9 +- resources/views/dashboard/index.blade.php | 1 - .../views/dashboard/peminjaman.blade.php | 1 - resources/views/layouts/sidebar.blade.php | 175 ++++++------- .../pages/layouts/sidebar_user.blade.php | 91 +++++++ .../user/Master_Data/Customer/index.blade.php | 64 +++++ .../Manajemen_Peti/Peti/index.blade.php | 76 ++++++ .../Manajemen_Peti/Type_peti/index.blade.php | 62 +++++ .../user/Master_Data/Role/index.blade.php | 34 +++ .../user/Master_Data/User/index.blade.php | 59 +++++ .../Master_Data/Warehouse/index.blade.php | 37 +++ .../pages/user/Peminjaman/index.blade.php | 65 +++++ .../pages/user/Pengembalian/index.blade.php | 88 +++++++ resources/views/pages/user/index.blade.php | 194 +++++++++++++++ routes/web.php | 12 +- 54 files changed, 1836 insertions(+), 1013 deletions(-) create mode 100644 app/Http/Requests/ValidasiCreatePeti.php create mode 100644 app/Http/Requests/ValidasiCreateRole.php create mode 100644 app/Http/Requests/ValidasiCreateType_Peti.php create mode 100644 app/Http/Requests/ValidasiUpdateCustomer.php create mode 100644 app/Http/Requests/ValidasiUpdatePeti.php create mode 100644 app/Http/Requests/ValidasiUpdateRole.php create mode 100644 app/Http/Requests/ValidasiUpdateType_Peti.php create mode 100644 app/Http/Requests/ValidasiUpdateUser.php delete mode 100644 resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php delete mode 100644 resources/views/dashboard/Master_Data/Asset/index.blade.php delete mode 100644 resources/views/dashboard/Master_Data/Asset/show.blade.php delete mode 100644 resources/views/dashboard/peminjaman.blade.php create mode 100644 resources/views/pages/layouts/sidebar_user.blade.php create mode 100644 resources/views/pages/user/Master_Data/Customer/index.blade.php create mode 100644 resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php create mode 100644 resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php create mode 100644 resources/views/pages/user/Master_Data/Role/index.blade.php create mode 100644 resources/views/pages/user/Master_Data/User/index.blade.php create mode 100644 resources/views/pages/user/Master_Data/Warehouse/index.blade.php create mode 100644 resources/views/pages/user/Peminjaman/index.blade.php create mode 100644 resources/views/pages/user/Pengembalian/index.blade.php create mode 100644 resources/views/pages/user/index.blade.php diff --git a/app/Http/Controllers/Auth/RedirectAuthController.php b/app/Http/Controllers/Auth/RedirectAuthController.php index 93a2b6b..f1e485f 100644 --- a/app/Http/Controllers/Auth/RedirectAuthController.php +++ b/app/Http/Controllers/Auth/RedirectAuthController.php @@ -15,7 +15,7 @@ class RedirectAuthController extends Controller // Admin return redirect()->route('dashboard.home.admin'); } else { - return redirect()->route('dashboard.home.admin'); + return redirect()->route('dashboard.home.user'); // User (role_id selain 1) // return redirect()->route('dashboard.home.user'); } diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 451aca2..9c5c956 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Http\Requests\ValidasiCreateCustomer; +use App\Http\Requests\ValidasiUpdateCustomer; use App\Models\Customer; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -76,17 +77,8 @@ class CustomerController extends Controller /** * Update the specified resource in storage. */ - public function update(Request $request, $id) + public function update(ValidasiUpdateCustomer $request, $id) { - // dd($request->all()); - $request->validate([ - 'name' => 'required', - 'code_customer' => 'required', - 'lot_no' => 'required', - 'no_tlp' => 'required', - 'address' => 'required', - ]); - // dd($request); try { $customer = Customer::findOrFail($id); $customerData = $request->all(); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index b780e45..bc607e0 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -15,11 +15,23 @@ class HomeController extends Controller 'jumlahAsset' => \App\Models\m_asset::count(), 'jumlahPeminjaman' => \App\Models\asset_status::count(), 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), - 'active' => 'menu-dashboard', + 'active' => 'menu-admin', ]; return view('dashboard.index', $data); } + public function indexUser() + { + $data = [ + 'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), + 'jumlahAsset' => \App\Models\m_asset::count(), + 'jumlahPeminjaman' => \App\Models\asset_status::count(), + 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), + 'active' => 'menu-user', + ]; + + return view('pages.user.index', $data); + } public function generateChartData() { diff --git a/app/Http/Controllers/PetiController.php b/app/Http/Controllers/PetiController.php index ecb58f7..7613142 100644 --- a/app/Http/Controllers/PetiController.php +++ b/app/Http/Controllers/PetiController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use App\Http\Requests\ValidasiCreatePeti; +use App\Http\Requests\ValidasiUpdatePeti; use Dompdf\Dompdf; use Dompdf\Options; use App\Models\Peti; @@ -44,21 +46,8 @@ class PetiController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreatePeti $request) { - // dd($request->all()); - $request->validate([ - 'tipe_peti_id' => 'required', - 'warna' => 'required', - 'customer_id' => 'required', - 'warehouse_id' => 'required', - 'jumlah' => 'required|numeric|min:1', - 'date_pembuatan' => 'required', - 'status_disposal' => 'nullable', - 'packing_no' => 'nullable', - 'fix_lot' => 'nullable', - ]); - // dd($request); try { $currenttype = Auth::user(); @@ -160,17 +149,8 @@ class PetiController extends Controller /** * Update the specified resource in storage. */ - public function update(Request $request, $id) + public function update(ValidasiUpdatePeti $request, $id) { - $request->validate([ - 'tipe_peti_id' => 'required', - 'warna' => 'required', - 'customer_id' => 'required', - 'warehouse_id' => 'required', - 'status_disposal' => 'nullable', - 'date_pembuatan' => 'required', - ]); - try { $currentuser = Auth::user(); $typepeti = Peti::findOrFail($id); @@ -219,58 +199,74 @@ class PetiController extends Controller public function cetakPdf($id) { - $peti = Peti::find($id); - - // Generate QR Code - $qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate( - 'Nama Customer : ' . - $peti->customer->name . - "\n" . - 'Code Customer : ' . - $peti->customer->code_customer . - "\n" . - 'ID Peti : ' . - $peti->tipe_peti->id . - "\n" . - 'Type Peti : ' . - $peti->tipe_peti->type . - "\n" . - 'ID Warehouse : ' . - $peti->warehouse->id . - "\n" . - 'Warehouse : ' . - $peti->warehouse->name . - "\n" . - 'Ukuran Peti : ' . - $peti->tipe_peti->size_peti . - "\n" . - 'Lot Number : ' . - $peti->customer->lot_no . - "\n" . - 'Paking Number : ' . - $peti->packing_no . - "\n" . - 'Status Peti : ' . - $peti->status_disposal - )); - - // Inisialisasi Dompdf - $options = new Options(); - $options->set('isHtml5ParserEnabled', true); - $options->set('isPhpEnabled', true); - $dompdf = new Dompdf($options); - - // Load HTML dari view - $html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render(); - - // Load HTML ke Dompdf - $dompdf->loadHtml($html); - - // Render PDF (portrait A4) - $dompdf->setPaper('A4', 'horizontal'); - $dompdf->render(); - - // Menggunakan stream untuk menghasilkan dan mengunduh PDF - return $dompdf->stream('Label_Peti.pdf'); + try { + $peti = Peti::find($id); + + // Generate QR Code + $qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate( + 'Nama Customer : ' . + $peti->customer->name . + "\n" . + 'Code Customer : ' . + $peti->customer->code_customer . + "\n" . + 'ID Peti : ' . + $peti->tipe_peti->id . + "\n" . + 'Type Peti : ' . + $peti->tipe_peti->type . + "\n" . + 'ID Warehouse : ' . + $peti->warehouse->id . + "\n" . + 'Warehouse : ' . + $peti->warehouse->name . + "\n" . + 'Ukuran Peti : ' . + $peti->tipe_peti->size_peti . + "\n" . + 'Lot Number : ' . + $peti->customer->lot_no . + "\n" . + 'Paking Number : ' . + $peti->packing_no . + "\n" . + 'Fix Lot : ' . + $peti->fix_lot . + + 'Status Peti : ' . + $peti->status_disposal + )); + + // Inisialisasi Dompdf + $options = new Options(); + $options->set('isHtml5ParserEnabled', true); + $options->set('isRemoteEnabled', true); + $options->set('defaultFont', 'Arial'); + $dompdf = new Dompdf($options); + + // Load HTML dari view + $html = view('dashboard.Master_Data.Manajemen_Peti.Peti.label_pdf', compact('peti', 'qrcode'))->render(); + $dompdf->loadHtml($html); + + // Render PDF (portrait A4) + $dompdf->setPaper('A4', 'portrait'); + $dompdf->render(); + $output = $dompdf->output(); + + // Download file PDF dengan nama yang sesuai + return response()->stream( + function () use ($output) { + echo $output; + }, + 200, + [ + 'Content-Type' => 'application/pdf', + 'Content-Disposition' => 'inline; filename="label_Peti.pdf"', + ] + ); + } catch (\Exception $e) { + return redirect()->back()->with('error', 'Terjadi kesalahan saat mencetak PDF.'); + } } } diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index fa78844..6532e4a 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -5,6 +5,8 @@ namespace App\Http\Controllers; use App\Models\m_role; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use App\Http\Requests\ValidasiCreateRole; +use App\Http\Requests\ValidasiUpdateRole; class RoleController extends Controller { @@ -31,12 +33,8 @@ class RoleController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreateRole $request) { - $request->validate([ - 'name' => 'required', - 'description' => 'required', - ]); try { $currentUser = Auth::user(); $validatedData = $request->except('_token'); @@ -71,9 +69,21 @@ class RoleController extends Controller /** * Update the specified resource in storage. */ - public function update(Request $request, $id) + public function update(ValidasiUpdateRole $request, $id) { - dd('oke'); + try { + $currentUser = Auth::user(); + $role = m_role::findOrFail($id); // Cari peran berdasarkan ID + + $validatedData = $request->except('_token'); + $validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by + + $role->update($validatedData); // Update data peran + + return redirect()->back()->with('success', 'Data role Berhasil Diperbarui.'); + } catch (\Throwable $th) { + return redirect()->back()->with('error', 'Data role Gagal Diperbarui.'); + } } /** diff --git a/app/Http/Controllers/TypePetiController.php b/app/Http/Controllers/TypePetiController.php index 46332b9..9a2c492 100644 --- a/app/Http/Controllers/TypePetiController.php +++ b/app/Http/Controllers/TypePetiController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use App\Http\Requests\ValidasiCreateType_Peti; +use App\Http\Requests\ValidasiUpdateType_Peti; use App\Models\Type_peti; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -34,15 +36,8 @@ class TypePetiController extends Controller /** * Store a newly created resource in storage. */ - public function store(Request $request) + public function store(ValidasiCreateType_Peti $request) { - // dd($request->all()); - $request->validate([ - 'type' => 'required', - 'size_peti' => 'required', - 'description' => 'required', - ]); - // dd($request); try { $currenttype = Auth::user(); $validatedData = $request->except('_token'); @@ -84,15 +79,8 @@ class TypePetiController extends Controller /** * Update the specified resource in storage. */ - public function update(Request $request, $id) + public function update(ValidasiUpdateType_Peti $request, $id) { - // dd($request->all()); - $request->validate([ - 'type' => 'required', - 'size_peti' => 'required', - 'description' => 'required', - ]); - // dd($request); try { $typepeti = Type_peti::findOrFail($id); $typepetiData = $request->all(); diff --git a/app/Http/Requests/ValidasiCreateCustomer.php b/app/Http/Requests/ValidasiCreateCustomer.php index 17e98b4..821610f 100644 --- a/app/Http/Requests/ValidasiCreateCustomer.php +++ b/app/Http/Requests/ValidasiCreateCustomer.php @@ -25,7 +25,7 @@ class ValidasiCreateCustomer extends FormRequest 'name' => 'required|string|max:50', 'code_customer' => 'required|string|max:15|unique:customers,code_customer', 'lot_no' => 'required|string|max:50', - 'no_tlp' => 'required|numeric|max:20', + 'no_tlp' => 'required|numeric', 'address' => 'required|string', ]; } @@ -42,7 +42,6 @@ class ValidasiCreateCustomer extends FormRequest 'code_customer.unique' => 'Kolom code_customer sudah ada.', 'lot_no.required' => 'Kolom lot_no wajib diisi.', 'lot_no.string' => 'Kolom lot_no harus berupa teks.', - 'lot_no.max' => 'Kolom lot_no tidak boleh lebih dari :max karakter.', 'no_tlp.required' => 'Kolom no_tlp wajib diisi.', 'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.', 'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.', diff --git a/app/Http/Requests/ValidasiCreatePeti.php b/app/Http/Requests/ValidasiCreatePeti.php new file mode 100644 index 0000000..1024a87 --- /dev/null +++ b/app/Http/Requests/ValidasiCreatePeti.php @@ -0,0 +1,60 @@ +|string> + */ + public function rules(): array + { + return [ + 'tipe_peti_id' => 'required|exists:type_petis,id', + 'warna' => 'required|string|max:50', + 'customer_id' => 'required|exists:customers,id', + 'warehouse_id' => 'required|exists:m_warehouses,id', + 'jumlah' => 'required|numeric|min:1', + 'date_pembuatan' => 'required|date', + 'status_disposal' => 'nullable|string', + 'packing_no' => 'nullable|integer', + 'fix_lot' => 'nullable|string|max:100', + ]; + } + + public function messages() + { + return [ + 'tipe_peti_id.required' => 'Tipe Peti harus diisi', + 'tipe_peti_id.exists' => 'Tipe Peti tidak ditemukan', + 'warna.required' => 'Warna harus diisi', + 'warna.string' => 'Warna harus berupa string', + 'warna.max' => 'Warna maksimal 50 karakter', + 'customer_id.required' => 'Customer harus diisi', + 'customer_id.exists' => 'Customer tidak ditemukan', + 'warehouse_id.required' => 'Warehouse harus diisi', + 'warehouse_id.exists' => 'Warehouse tidak ditemukan', + 'jumlah.required' => 'Jumlah harus diisi', + 'jumlah.numeric' => 'Jumlah harus berupa angka', + 'jumlah.min' => 'Jumlah minimal 1', + 'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi', + 'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal', + 'status_disposal.string' => 'Status Disposal harus berupa string', + 'packing_no.integer' => 'Packing No harus berupa angka', + 'fix_lot.string' => 'Fix Lot harus berupa string', + 'fix_lot.max' => 'Fix Lot maksimal 100 karakter', + ]; + } +} diff --git a/app/Http/Requests/ValidasiCreateRole.php b/app/Http/Requests/ValidasiCreateRole.php new file mode 100644 index 0000000..42e4de5 --- /dev/null +++ b/app/Http/Requests/ValidasiCreateRole.php @@ -0,0 +1,40 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:50', + 'description' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Nama Role harus diisi', + 'name.string' => 'Nama Role harus berupa string', + 'name.max' => 'Nama Role maksimal 50 karakter', + 'description.required' => 'Deskripsi harus diisi', + 'description.string' => 'Deskripsi harus berupa string', + ]; + } +} diff --git a/app/Http/Requests/ValidasiCreateType_Peti.php b/app/Http/Requests/ValidasiCreateType_Peti.php new file mode 100644 index 0000000..4052ce5 --- /dev/null +++ b/app/Http/Requests/ValidasiCreateType_Peti.php @@ -0,0 +1,44 @@ +|string> + */ + public function rules(): array + { + return [ + 'type' => 'required|string|max:20', + 'size_peti' => 'required|string|max:25', + 'description' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'type.required' => 'Type Peti tidak boleh kosong', + 'type.string' => 'Type Peti harus berupa string', + 'type.max' => 'Type Peti maksimal 20 karakter', + 'size_peti.required' => 'Size Peti tidak boleh kosong', + 'size_peti.string' => 'Size Peti harus berupa string', + 'size_peti.max' => 'Size Peti maksimal 25 karakter', + 'description.required' => 'Deskripsi tidak boleh kosong', + 'description.string' => 'Deskripsi harus berupa string', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdateCustomer.php b/app/Http/Requests/ValidasiUpdateCustomer.php new file mode 100644 index 0000000..e44126a --- /dev/null +++ b/app/Http/Requests/ValidasiUpdateCustomer.php @@ -0,0 +1,52 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:50', + 'code_customer' => 'required|string|max:15|unique:customers,code_customer', + 'lot_no' => 'required|string|max:50', + 'no_tlp' => 'required|numeric', + 'address' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Kolom name wajib diisi.', + 'name.string' => 'Kolom name harus berupa teks.', + 'name.max' => 'Kolom name tidak boleh lebih dari :max karakter.', + 'code_customer.required' => 'Kolom code_customer wajib diisi.', + 'code_customer.string' => 'Kolom code_customer harus berupa teks.', + 'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.', + 'code_customer.unique' => 'Kolom code_customer sudah ada.', + 'lot_no.required' => 'Kolom lot_no wajib diisi.', + 'lot_no.string' => 'Kolom lot_no harus berupa teks.', + 'no_tlp.required' => 'Kolom no_tlp wajib diisi.', + 'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.', + 'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.', + 'address.required' => 'Kolom address wajib diisi.', + 'address.string' => 'Kolom address harus berupa teks.', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdatePeti.php b/app/Http/Requests/ValidasiUpdatePeti.php new file mode 100644 index 0000000..b8ddbc5 --- /dev/null +++ b/app/Http/Requests/ValidasiUpdatePeti.php @@ -0,0 +1,59 @@ +|string> + */ + public function rules(): array + { + return [ + 'tipe_peti_id' => 'required|exists:type_petis,id', + 'warna' => 'required|string|max:50', + 'customer_id' => 'required|exists:customers,id', + 'warehouse_id' => 'required|exists:m_warehouses,id', + 'date_pembuatan' => 'required|date', + 'status_disposal' => 'nullable|string', + 'packing_no' => 'nullable|integer', + 'fix_lot' => 'nullable|string|max:100', + ]; + } + + public function messages() + { + return [ + 'tipe_peti_id.required' => 'Tipe Peti harus diisi', + 'tipe_peti_id.exists' => 'Tipe Peti tidak ditemukan', + 'warna.required' => 'Warna harus diisi', + 'warna.string' => 'Warna harus berupa string', + 'warna.max' => 'Warna maksimal 50 karakter', + 'customer_id.required' => 'Customer harus diisi', + 'customer_id.exists' => 'Customer tidak ditemukan', + 'warehouse_id.required' => 'Warehouse harus diisi', + 'warehouse_id.exists' => 'Warehouse tidak ditemukan', + 'jumlah.required' => 'Jumlah harus diisi', + 'jumlah.numeric' => 'Jumlah harus berupa angka', + 'jumlah.min' => 'Jumlah minimal 1', + 'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi', + 'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal', + 'status_disposal.string' => 'Status Disposal harus berupa string', + 'packing_no.integer' => 'Packing No harus berupa angka', + 'fix_lot.string' => 'Fix Lot harus berupa string', + 'fix_lot.max' => 'Fix Lot maksimal 100 karakter', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdateRole.php b/app/Http/Requests/ValidasiUpdateRole.php new file mode 100644 index 0000000..d5cc4dd --- /dev/null +++ b/app/Http/Requests/ValidasiUpdateRole.php @@ -0,0 +1,40 @@ +|string> + */ + public function rules(): array + { + return [ + 'name' => 'required|string|max:50', + 'description' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'name.required' => 'Nama Role harus diisi', + 'name.string' => 'Nama Role harus berupa string', + 'name.max' => 'Nama Role maksimal 50 karakter', + 'description.required' => 'Deskripsi harus diisi', + 'description.string' => 'Deskripsi harus berupa string', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdateType_Peti.php b/app/Http/Requests/ValidasiUpdateType_Peti.php new file mode 100644 index 0000000..2b228ee --- /dev/null +++ b/app/Http/Requests/ValidasiUpdateType_Peti.php @@ -0,0 +1,44 @@ +|string> + */ + public function rules(): array + { + return [ + 'type' => 'required|string|max:20', + 'size_peti' => 'required|string|max:25', + 'description' => 'required|string', + ]; + } + + public function messages() + { + return [ + 'type.required' => 'Type Peti tidak boleh kosong', + 'type.string' => 'Type Peti harus berupa string', + 'type.max' => 'Type Peti maksimal 20 karakter', + 'size_peti.required' => 'Size Peti tidak boleh kosong', + 'size_peti.string' => 'Size Peti harus berupa string', + 'size_peti.max' => 'Size Peti maksimal 25 karakter', + 'description.required' => 'Deskripsi tidak boleh kosong', + 'description.string' => 'Deskripsi harus berupa string', + ]; + } +} diff --git a/app/Http/Requests/ValidasiUpdateUser.php b/app/Http/Requests/ValidasiUpdateUser.php new file mode 100644 index 0000000..7a2d18f --- /dev/null +++ b/app/Http/Requests/ValidasiUpdateUser.php @@ -0,0 +1,78 @@ +|string> + */ + public function rules(): array + { + return [ + 'username' => 'required|string|max:32', + 'fullname' => 'required|string|max:32', + 'nip' => 'nullable|numeric|max:20', + 'email' => 'required|email|string|max:45', + 'no_hp' => 'nullable|numeric|max:15', + 'divisi' => 'nullable|string|max:50', + 'foto' => 'nullable|string|max:255', + 'role_id' => 'required|exists:m_roles,id', + 'warehouse_id' => 'nullable|exists:m_warehouses,id', + 'address' => 'nullable|string', + 'email_verified_at' => 'nullable|date', + 'password' => 'required|string|min:6|max:16', + 'created_by' => 'nullable|string|max:32', + 'updated_by' => 'nullable|string|max:32', + ]; + } + + public function messages() + { + return [ + 'username.required' => 'Kolom username wajib diisi.', + 'username.string' => 'Kolom username harus berupa teks.', + 'username.max' => 'Kolom username tidak boleh lebih dari :max karakter.', + 'fullname.required' => 'Kolom fullname wajib diisi.', + 'fullname.string' => 'Kolom fullname harus berupa teks.', + 'fullname.max' => 'Kolom fullname tidak boleh lebih dari :max karakter.', + 'nip.numeric' => 'Kolom NIP harus berisi angka.', + 'nip.max' => 'Kolom NIP tidak boleh lebih dari :max karakter.', + 'email.required' => 'Kolom email wajib diisi.', + 'email.email' => 'Format email tidak valid.', + 'email.string' => 'Kolom email harus berupa teks.', + 'email.max' => 'Kolom email tidak boleh lebih dari :max karakter.', + 'no_hp.numeric' => 'Kolom no_hp harus berisi angka.', + 'no_hp.max' => 'Kolom no_hp tidak boleh lebih dari :max karakter.', + 'divisi.string' => 'Kolom divisi harus berupa teks.', + 'divisi.max' => 'Kolom divisi tidak boleh lebih dari :max karakter.', + 'foto.string' => 'Kolom foto harus berupa teks.', + 'foto.max' => 'Kolom foto tidak boleh lebih dari :max karakter.', + 'role_id.required' => 'Kolom role_id wajib diisi.', + 'role_id.exists' => 'Role yang dipilih tidak valid.', + 'warehouse_id.exists' => 'Warehouse yang dipilih tidak valid.', + 'address.string' => 'Kolom address harus berupa teks.', + 'email_verified_at.date' => 'Format tanggal email_verified_at tidak valid.', + 'password.required' => 'Kolom password wajib diisi.', + 'password.string' => 'Kolom password harus berupa teks.', + 'password.min' => 'Kolom password minimal harus :min karakter.', + 'password.max' => 'Kolom password tidak boleh lebih dari :max karakter.', + 'created_by.string' => 'Kolom created_by harus berupa teks.', + 'created_by.max' => 'Kolom created_by tidak boleh lebih dari :max karakter.', + 'updated_by.string' => 'Kolom updated_by harus berupa teks.', + 'updated_by.max' => 'Kolom updated_by tidak boleh lebih dari :max karakter.', + ]; + } +} diff --git a/database/migrations/2023_10_23_075239_create_m_roles_table.php b/database/migrations/2023_10_23_075239_create_m_roles_table.php index 1b29b87..6147ad1 100644 --- a/database/migrations/2023_10_23_075239_create_m_roles_table.php +++ b/database/migrations/2023_10_23_075239_create_m_roles_table.php @@ -13,12 +13,12 @@ return new class extends Migration { Schema::create('m_roles', function (Blueprint $table) { $table->id(); - $table->string('name', 200)->nullable(); + $table->string('name', 50)->nullable(); $table->text('description')->nullable(); $table->timestamps(); $table->softDeletes(); - $table->string('created_by', 200)->nullable(); - $table->string('updated_by', 200)->nullable(); + $table->string('created_by', 50)->nullable(); + $table->string('updated_by', 50)->nullable(); }); } diff --git a/database/migrations/2023_10_28_083930_create_type_petis_table.php b/database/migrations/2023_10_28_083930_create_type_petis_table.php index 043f667..611c518 100644 --- a/database/migrations/2023_10_28_083930_create_type_petis_table.php +++ b/database/migrations/2023_10_28_083930_create_type_petis_table.php @@ -13,13 +13,13 @@ return new class extends Migration { Schema::create('type_petis', function (Blueprint $table) { $table->id(); - $table->string('type'); - $table->string('size_peti'); + $table->string('type', 20); + $table->string('size_peti', 25); $table->text('description')->nullable(); $table->timestamps(); $table->softDeletes(); - $table->string('created_by', 200)->nullable(); - $table->string('updated_by', 200)->nullable(); + $table->string('created_by', 50)->nullable(); + $table->string('updated_by', 50)->nullable(); }); } diff --git a/database/seeders/Type_Peti.php b/database/seeders/Type_Peti.php index e37c037..ec9d884 100644 --- a/database/seeders/Type_Peti.php +++ b/database/seeders/Type_Peti.php @@ -15,16 +15,16 @@ class Type_Peti extends Seeder public function run(): void { DB::table('type_petis')->insert([ - 'type' => 'BS', + 'type' => 'Bagus', 'size_peti' => '2 X 2 X 2 X 2', - 'description' => 'Detail BS', + 'description' => 'Detail Barang Bagus', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); DB::table('type_petis')->insert([ - 'type' => 'BCA', + 'type' => 'Standar', 'size_peti' => '3 X 3 X 3 X 3', - 'description' => 'Detail BCA', + 'description' => 'Detail Barang Standar', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index b2d436f..07b8e61 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -50,7 +50,7 @@ required autofocus autocomplete="username" placeholder="Masukan Email anda"> @if ($errors->has('email')) -
+
{{ $errors->first('email') }}
@endif @@ -59,12 +59,8 @@ - @if ($errors->has('password')) -
- {{ $errors->first('password') }} -
- @endif
+

- - - -
diff --git a/resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php b/resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php deleted file mode 100644 index ef8a35a..0000000 --- a/resources/views/dashboard/Master_Data/Asset/asset_pdf.blade.php +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - {{--

Laporan Keuangan

--}} -

Tabel Asset

-
-

Our Item Tables are enhanced with the help of the DataTables plugin. This is a powerful tool that allows you - to explore return data in a more interactive and efficient way

-
- - - - - - - - - - - - - @forelse ($asset as $data) - - - - - - - - - @empty -

Data Kosong

- @endforelse - - - - - - - - - - - - -
No. SeriNamaDeskripsiGudangTanggalQR
{{ $data->seri }}{{ $data->name }}{{ $data->description }}{{ $data->warehouse->name }}{{ \Carbon\Carbon::parse($data->date)->format('d-m-Y') }}{{ $data->qr_count }}
No. SeriNamaDeskripsiGudangTanggalQR
- - - - diff --git a/resources/views/dashboard/Master_Data/Asset/index.blade.php b/resources/views/dashboard/Master_Data/Asset/index.blade.php deleted file mode 100644 index 2ce586a..0000000 --- a/resources/views/dashboard/Master_Data/Asset/index.blade.php +++ /dev/null @@ -1,231 +0,0 @@ -@extends('layouts.main') -@section('title', 'Setting Platform') -@section('content') -
- -
-
- - - - - - - - - - - - - - @foreach ($asset as $data) - - - - - - - - - - @endforeach - -
No. SeriNamaDeskripsiGudangTanggalJumlah QR PrintAction
{{ $data->seri }}{{ $data->name }}{{ $data->description }}{{ $data->warehouse->name }}{{ \Carbon\Carbon::parse($data->date)->format('d-m-Y') }} - {!! QrCode::size(80)->generate(route('dashboard.asset.show', $data->id)) !!} - - - - - - - -
- @csrf - @method('DELETE') - -
-
-
- -
-
- - - - - - @foreach ($asset as $data) - - @endforeach - - - {{-- @foreach ($asset as $data) - - @endforeach --}} -@endsection diff --git a/resources/views/dashboard/Master_Data/Asset/show.blade.php b/resources/views/dashboard/Master_Data/Asset/show.blade.php deleted file mode 100644 index 89b19e8..0000000 --- a/resources/views/dashboard/Master_Data/Asset/show.blade.php +++ /dev/null @@ -1,65 +0,0 @@ -@extends('layouts.main') -@section('title', 'Setting Platform') -@section('content') -
- -
-
-

Detail Asset

-
-
- - - - - - - -
- {!! QrCode::size(75)->generate( - 'Name: ' . - $asset->name . - "\n" . - 'ID Asset: ' . - $asset->id . - "\n" . - 'Description: ' . - $asset->description . - "\n" . - 'QR Code: ' . - $asset->qr_count . - "\n" . - 'Date: ' . - \Carbon\Carbon::parse($asset->date)->format('d-m-Y') . - "\n" . - 'Name WH: ' . - $asset->warehouse->name . - "\n" . - 'ID WH: ' . - $asset->warehouse_id, - ) !!} -
- - - - - - -
- Kembali -
-
-
-@endsection diff --git a/resources/views/dashboard/Master_Data/Customer/create.blade.php b/resources/views/dashboard/Master_Data/Customer/create.blade.php index 9857721..3be5f4a 100644 --- a/resources/views/dashboard/Master_Data/Customer/create.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/create.blade.php @@ -1,6 +1,7 @@ @extends('layouts.main') @section('content') @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Customer/edit.blade.php b/resources/views/dashboard/Master_Data/Customer/edit.blade.php index 4c2be5d..223b42f 100644 --- a/resources/views/dashboard/Master_Data/Customer/edit.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/edit.blade.php @@ -1,5 +1,7 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Customer/index.blade.php b/resources/views/dashboard/Master_Data/Customer/index.blade.php index f980ebd..633241c 100644 --- a/resources/views/dashboard/Master_Data/Customer/index.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/index.blade.php @@ -1,68 +1,72 @@ @extends('layouts.main') @section('content') @include('layouts.components.alert-prompt') -
-
-
-
-
Data Customer
-
-
- - + Tambah data - + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Customer
+
+
-
-
-
- - - - - - - - - - - - - @php - $nocustomer = 1; - @endphp - @forelse ($customer as $data_customer) +
+
+
NoNamaKode CustomerNo. TeleponAlamatAction
+ - - - - - - + + + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $nocustomer++ }}{{ $data_customer->name }}{{ $data_customer->code_customer }}{{ $data_customer->no_tlp }}{{ $data_customer->address }} - - - - - - -
- @csrf - @method('DELETE') - -
-
NoNamaKode CustomerNo. TeleponAlamatAction
+ + + @php + $nocustomer = 1; + @endphp + @forelse ($customer as $data_customer) + + {{ $nocustomer++ }} + {{ $data_customer->name }} + {{ $data_customer->code_customer }} + {{ $data_customer->no_tlp }} + {{ $data_customer->address }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ + + @empty +

Data Kosong

+ @endforelse + + +
-
+ @else + @include('pages.user.Master_Data.Customer.index') + @endif @endsection diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php index 7c561fb..4a644ec 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php @@ -1,5 +1,7 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php index f957ff5..cc8849e 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php @@ -1,5 +1,7 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php index ed4a035..4218b20 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php @@ -10,83 +10,85 @@ } -
-
-
-
-
Data Peti
-
-
- - Tambah Peti - + @include('layouts.components.alert-prompt') + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Peti
+
+
-
-
-
- - - - - - - - - - - - - - - - - - - @php - $nopeti = 1; - @endphp - @forelse ($peti as $data_peti) +
+
+
NoUserCustomerWHKode CustomerTipe PetiUkuran PetiLot NoStatus PetiPacking NoQR CodeAction
+ - - - - - - - - - - - - {{-- --}} - + + + + + + + + + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $nopeti++ }}{{ $data_peti->created_by }}{{ $data_peti->customer->name }}{{ $data_peti->warehouse->name }}{{ $data_peti->customer->code_customer }}{{ $data_peti->tipe_peti->type }}{{ $data_peti->tipe_peti->size_peti }}{{ $data_peti->customer->lot_no }}{{ $data_peti->status_disposal }}{{ $data_peti->packing_no }}{{ $data_peti->fix_lot }} - {!! QrCode::size(80)->generate(route('dashboard.peti.show', $data_peti->id)) !!} - - - - - - - -
- @csrf - @method('DELETE') - -
-
NoUserCustomerWHKode CustomerTipe PetiUkuran PetiLot NoStatus PetiPacking NoFix LotAction
+ + + @php + $nopeti = 1; + @endphp + @forelse ($peti as $data_peti) + + {{ $nopeti++ }} + {{ $data_peti->created_by }} + {{ $data_peti->customer->name }} + {{ $data_peti->warehouse->name }} + {{ $data_peti->customer->code_customer }} + {{ $data_peti->tipe_peti->type }} + {{ $data_peti->tipe_peti->size_peti }} + {{ $data_peti->customer->lot_no }} + {{ $data_peti->status_disposal }} + {{ $data_peti->packing_no }} + {{ $data_peti->fix_lot }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ + + @empty +

Data Kosong

+ @endforelse + + +
-
+ @else + @include('pages.user.Master_Data.Manajemen_Peti.Peti.index') + @endif @endsection diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php index 8d39c33..e316ebc 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/label_pdf.blade.php @@ -66,6 +66,7 @@ 1 + diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php index 508a557..c52ff98 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php @@ -64,13 +64,16 @@ 'Paking Number : ' . $peti->packing_no . "\n" . + 'Fix Lot : ' . + $peti->fix_lot . + "\n" . 'Status Peti : ' . $peti->status_disposal, ) !!}
+ + @endsection diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php index 5a183e4..3ba4486 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php @@ -1,5 +1,7 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php index 6e15c15..da01c30 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php @@ -1,5 +1,7 @@ @extends('layouts.main') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php index 116fd2d..f5d9133 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php @@ -1,65 +1,70 @@ @extends('layouts.main') @section('content') -
-
-
-
-
Data Tipe Peti
-
-
- - Tambah Tipe Peti - + @include('layouts.components.alert-prompt') + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Tipe Peti
+
+
-
-
-
- - - - - - - - - - - - @php - $notype = 1; - @endphp - @forelse ($typepeti as $data_typepeti) +
+
+
NoTipe PetiUkuran PetiDeskripsi PetiAction
+ - - - - - + + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $notype++ }}{{ $data_typepeti->type }}{{ $data_typepeti->size_peti }}{{ $data_typepeti->description }} - - - - - - -
- @csrf - @method('DELETE') - -
-
NoTipe PetiUkuran PetiDeskripsi PetiAction
+ + + @php + $notype = 1; + @endphp + @forelse ($typepeti as $data_typepeti) + + {{ $notype++ }} + {{ $data_typepeti->type }} + {{ $data_typepeti->size_peti }} + {{ $data_typepeti->description }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ + + @empty +

Data Kosong

+ @endforelse + + +
-
+ @else + @include('pages.user.Master_Data.Manajemen_Peti.Type_peti.index') + @endif @endsection diff --git a/resources/views/dashboard/Master_Data/Role/index.blade.php b/resources/views/dashboard/Master_Data/Role/index.blade.php index 5f27acb..9c9d13e 100644 --- a/resources/views/dashboard/Master_Data/Role/index.blade.php +++ b/resources/views/dashboard/Master_Data/Role/index.blade.php @@ -1,7 +1,8 @@ @extends('layouts.main') @section('title', 'Role') @section('content') -
+ @include('layouts.components.alert-prompt') + @if (auth()->user()->role_id == 1)
@@ -59,7 +60,9 @@
-
+ @else + @include('pages.user.Master_Data.Role.index') + @endif - - - @include('layouts.components.alert-prompt') - -
@csrf diff --git a/resources/views/dashboard/Master_Data/User/edit.blade.php b/resources/views/dashboard/Master_Data/User/edit.blade.php index 2ace44b..caf9b5b 100644 --- a/resources/views/dashboard/Master_Data/User/edit.blade.php +++ b/resources/views/dashboard/Master_Data/User/edit.blade.php @@ -1,6 +1,8 @@ @extends('layouts.main') @section('title', 'Update Data User') @section('content') + @include('layouts.components.alert-prompt') +
diff --git a/resources/views/dashboard/Master_Data/User/index.blade.php b/resources/views/dashboard/Master_Data/User/index.blade.php index 450bc33..1710cb6 100644 --- a/resources/views/dashboard/Master_Data/User/index.blade.php +++ b/resources/views/dashboard/Master_Data/User/index.blade.php @@ -1,81 +1,85 @@ @extends('layouts.main') @section('content') @include('layouts.components.alert-prompt') -
-
-
-
-
Data User
-
-
- - + Tambah data - + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data User
+
+
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - @php - $noUser = 1; - @endphp - @forelse ($user as $data) +
+
+
NoNamaEmailNo. HPAlamatDitugaskanAction
NoNamaEmailNo. HPAlamatDitugaskanAction
+ - - - - - - - + + + + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $noUser++ }}{{ $data->fullname }}{{ $data->email }}{{ isset($data->no_hp) ? $data->no_hp : '-' }}{{ isset($data->address) ? $data->address : '-' }}{{ $data->warehouse->name }} - - - - - - - - @csrf - @method('DELETE') - - - NoNamaEmailNo. HPAlamatDitugaskanAction
+ + + + No + Nama + Email + No. HP + Alamat + Ditugaskan + Action + + + + @php + $noUser = 1; + @endphp + @forelse ($user as $data) + + {{ $noUser++ }} + {{ $data->fullname }} + {{ $data->email }} + {{ isset($data->no_hp) ? $data->no_hp : '-' }} + {{ isset($data->address) ? $data->address : '-' }} + {{ $data->warehouse->name }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ + + @empty +

Data Kosong

+ @endforelse + + +
-
+ @else + @include('pages.user.Master_Data.User.index') + @endif @endsection diff --git a/resources/views/dashboard/Master_Data/Warehouse/index.blade.php b/resources/views/dashboard/Master_Data/Warehouse/index.blade.php index f271f21..52427ca 100644 --- a/resources/views/dashboard/Master_Data/Warehouse/index.blade.php +++ b/resources/views/dashboard/Master_Data/Warehouse/index.blade.php @@ -3,66 +3,71 @@ @section('content') @include('layouts.components.alert-prompt') - -
-
-
-
-
Data Warehouse
-
-
- - Tambah Data Warehouse - - + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Gudang
+
+
-
-
-
- - - - - - - - - - - - @php - $nowarehouses = 1; - @endphp - @foreach ($warehouses as $data) +
+
+
No.Nama WarehouseDeskripsiAlamatAction
+ - - - - - + + + + + - @endforeach - -
{{ $nowarehouses++ }}{{ $data->name }}{{ $data->description }}{{ $data->address }} - - - -
- @csrf - @method('DELETE') - -
-
No.Nama GudangDeskripsiAlamatAction
-
+ + + @php + $nowarehouses = 1; + @endphp + @foreach ($warehouses as $data) + + {{ $nowarehouses++ }} + {{ $data->name }} + {{ $data->description }} + {{ $data->address }} + + + + +
+ @csrf + @method('DELETE') + +
+ + + @endforeach + + +
+
-
+ @else + @include('pages.user.Master_Data.Warehouse.index') + @endif