Browse Source

update proses user

master
Gunawan19621 1 year ago
parent
commit
fbe3550d38
  1. 4
      app/Http/Controllers/M_assetController.php
  2. 70
      app/Http/Controllers/M_userController.php
  3. 86
      app/Http/Controllers/WarehouseController.php
  4. 7
      database/migrations/2023_09_20_163615_create_m_warehouses_table.php
  5. 15
      database/migrations/2023_09_20_163617_create_users_table.php
  6. 31
      resources/views/MasterData/asset.blade.php
  7. 0
      resources/views/MasterData/asset_pdf.blade.php
  8. 0
      resources/views/MasterData/pengadaan.blade.php
  9. 0
      resources/views/MasterData/settingPlatform.blade.php
  10. 9
      resources/views/MasterData/update_user.blade.php
  11. 147
      resources/views/MasterData/user.blade.php
  12. 113
      resources/views/MasterData/warehouse.blade.php
  13. 86
      resources/views/addons/SettingPlatform/manajement_user.blade.php
  14. 243
      resources/views/dashboard/index.blade.php
  15. 34
      resources/views/layouts/main.blade.php
  16. 5
      resources/views/layouts/sidebar.blade.php
  17. 15
      routes/web.php

4
app/Http/Controllers/M_assetController.php

@ -20,7 +20,7 @@ class M_assetController extends Controller
{ {
$asset = m_asset::get(); $asset = m_asset::get();
$warehouse = m_warehouse::all(); $warehouse = m_warehouse::all();
return view('addons.SettingPlatform.manajement_asset', compact('asset', 'warehouse')); return view('MasterData.asset', compact('asset', 'warehouse'));
} }
/** /**
@ -165,7 +165,7 @@ class M_assetController extends Controller
// Buat objek Dompdf // Buat objek Dompdf
$dompdf = new Dompdf(); $dompdf = new Dompdf();
// Render tampilan ke PDF // Render tampilan ke PDF
$html = view('addons.SettingPlatform.asset_pdf', compact('asset'))->render(); $html = view('MasterData.asset_pdf', compact('asset'))->render();
// Muat HTML ke Dompdf // Muat HTML ke Dompdf
$dompdf->loadHtml($html); $dompdf->loadHtml($html);

70
app/Http/Controllers/M_userController.php

@ -6,6 +6,7 @@ use App\Models\User;
use App\Models\m_role; use App\Models\m_role;
use App\Models\m_warehouse; use App\Models\m_warehouse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class M_userController extends Controller class M_userController extends Controller
{ {
@ -15,8 +16,10 @@ class M_userController extends Controller
public function index() public function index()
{ {
// dd('oke'); // dd('oke');
$warehouse = m_warehouse::get();
$role = m_role::get();
$user = User::get(); $user = User::get();
return view('addons.SettingPlatform.manajement_user', compact('user')); return view('MasterData.user', compact('user', 'role', 'warehouse'));
} }
/** /**
@ -30,9 +33,53 @@ class M_userController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
// public function store(Request $request)
// {
// $request->validate([
// 'username' => 'required',
// 'fullname' => 'required',
// 'email' => 'required|email',
// 'divisi' => 'required',
// 'role_id' => 'required',
// 'warehouse_id' => 'required',
// 'password' => 'required',
// ]);
// try {
// $currentUser = Auth::user();
// $validatedData = $request->except('_token');
// $validatedData['created_by'] = $currentUser->name; // Menggunakan nama pengguna sebagai created_by
// $validatedData['updated_by'] = $currentUser->name; // Menggunakan nama pengguna sebagai updated_by
// $validatedData['password'] = bcrypt($request->input('password')); // Enkripsi password
// user::create($validatedData);
// return redirect()->back()->with('success', 'Data User Berhasil Ditambah.');
// } catch (\Throwable $th) {
// return redirect()->back()->with('error', 'Data User Gagal Ditambah.');
// }
// }
public function store(Request $request) public function store(Request $request)
{ {
// dd('oke'); $request->validate([
'username' => 'required',
'fullname' => 'required',
'email' => 'required|email',
'divisi' => 'required',
'role_id' => 'required',
'warehouse_id' => 'required',
'password' => '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['password'] = bcrypt($request->input('password')); // Enkripsi password
user::create($validatedData);
return redirect()->back()->with('success', 'Data User Berhasil Ditambah.');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data User Gagal Ditambah.');
}
} }
/** /**
@ -44,7 +91,7 @@ class M_userController extends Controller
$user = User::find($id); $user = User::find($id);
$role = m_role::get(); $role = m_role::get();
$warehouse = m_warehouse::get(); $warehouse = m_warehouse::get();
return view('addons.SettingPlatform.update_user', compact('user', 'role', 'warehouse')); return view('MasterData.update_user', compact('user', 'role', 'warehouse'));
} }
/** /**
@ -67,18 +114,31 @@ class M_userController extends Controller
'no_hp' => 'required', 'no_hp' => 'required',
'divisi' => 'required', 'divisi' => 'required',
'address' => 'required', 'address' => 'required',
'status' => 'required',
'role_id' => 'required', 'role_id' => 'required',
'warehouse_id' => 'required', 'warehouse_id' => 'required',
]); ]);
// dd($request->all()); // dd($request->all());
try { try {
$user = User::findOrFail($id); $user = User::findOrFail($id);
$user->update($request->all()); $userData = $request->all();
// Menambahkan nama pengguna yang melakukan pembaruan
$userData['updated_by'] = Auth::user()->fullname;
$user->update($userData);
return redirect()->route('user.index')->with('success', 'Data User berhasil diperbaharui'); return redirect()->route('user.index')->with('success', 'Data User berhasil diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data User gagal diperbaharui'); return redirect()->back()->with('error', 'Data User gagal diperbaharui');
} }
// try {
// $user = User::findOrFail($id);
// $user->update($request->all());
// return redirect()->route('user.index')->with('success', 'Data User berhasil diperbaharui');
// } catch (\Throwable $th) {
// return redirect()->back()->with('error', 'Data User gagal diperbaharui');
// }
} }
/** /**

86
app/Http/Controllers/WarehouseController.php

@ -0,0 +1,86 @@
<?php
namespace App\Http\Controllers;
use App\Models\m_warehouse;
use Illuminate\Http\Request;
class WarehouseController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$warehouses = m_warehouse::all();
return view('MasterData.warehouse', compact('warehouses'));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// dd('oke');
// dd($request);
$request->validate([
'name' => 'required',
'description' => 'required',
'address' => 'required',
]);
try {
$validatedData = $request->except('_token');
m_warehouse::create($validatedData);
return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data gudang gagal ditambah.');
}
return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
}
/**
* Display the specified resource.
*/
public function show($id)
{
// dd('oke');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
// dd('oke');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
// dd('oke');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
// dd("oke");
try {
$asset = m_warehouse::findOrFail($id);
$asset->delete();
return redirect()->back()->with('success', 'Data Gudang berhasil dihapus');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data Gudang gagal dihapus');
}
}
}

7
database/migrations/2023_09_20_163615_create_m_warehouses_table.php

@ -16,6 +16,7 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('name', 200); $table->string('name', 200);
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->text('address')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->string('created_by', 200)->nullable()->default('System'); $table->string('created_by', 200)->nullable()->default('System');
@ -23,9 +24,9 @@ return new class extends Migration
}); });
DB::table('m_warehouses')->insert([ DB::table('m_warehouses')->insert([
['name' => 'Gudangsatu', 'description' => 'Gudang Barang'], ['name' => 'Gudangsatu', 'description' => 'Gudang Barang', 'address' => 'Jln. Raya Kesatu'],
['name' => 'Gudangdua', 'description' => 'Gudang Makanan'], ['name' => 'Gudangdua', 'description' => 'Gudang Makanan', 'address' => 'Jln. Raya Kedua'],
['name' => 'Gudangtiga', 'description' => 'Gudang Pakaian'], ['name' => 'Gudangtiga', 'description' => 'Gudang Pakaian', 'address' => 'Jln. Raya Ketiga'],
]); ]);
} }

15
database/migrations/2023_09_20_163617_create_users_table.php

@ -16,22 +16,19 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('username', 50); $table->string('username', 50);
$table->string('fullname'); $table->string('fullname');
$table->string('nip', 20); $table->string('nip', 20)->nullable();
$table->string('email')->unique(); $table->string('email')->unique();
$table->string('no_hp', 20); $table->string('no_hp', 20)->nullable();
$table->string('divisi', 255); $table->string('divisi', 255);
$table->date('tgl_lahir')->nullable(); $table->date('tgl_lahir')->nullable();
$table->enum('jenis_kelamin', ['L', 'P'])->nullable(); $table->enum('jenis_kelamin', ['L', 'P'])->nullable();
$table->enum('agama', ['Islam', 'Kristen', 'Katolik', 'Hindu', 'Budha', 'Konghucu'])->nullable(); $table->enum('agama', ['Islam', 'Kristen', 'Katolik', 'Hindu', 'Budha', 'Konghucu'])->nullable();
$table->string('foto', 255)->nullable(); $table->string('foto', 255)->nullable();
// $table->integer('role_id');
$table->bigInteger('role_id')->unsigned(); $table->bigInteger('role_id')->unsigned();
$table->foreign('role_id')->references('id')->on('m_roles'); $table->foreign('role_id')->references('id')->on('m_roles');
// $table->integer('warehouse_id');
$table->bigInteger('warehouse_id')->unsigned(); $table->bigInteger('warehouse_id')->unsigned();
$table->foreign('warehouse_id')->references('id')->on('m_warehouses'); $table->foreign('warehouse_id')->references('id')->on('m_warehouses');
$table->text('address'); $table->text('address')->nullable();
$table->enum('status', ['aktif', 'tidak aktif']);
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password'); $table->string('password');
$table->rememberToken(); $table->rememberToken();
@ -42,9 +39,9 @@ return new class extends Migration
}); });
DB::table('users')->insert([ DB::table('users')->insert([
['username' => 'Gunawan19621', 'fullname' => 'Gunawan', 'nip' => '111111', 'email' => 'gunawan19621@gmail.com', 'no_hp' => '085159079010', 'divisi' => 'admin', 'role_id' => 1, 'warehouse_id' => 1, 'address' => 'Jl. Raya Gelarmendala', 'status' => 'aktif', 'password' => bcrypt('19062001')], ['username' => 'Gunawan19621', 'fullname' => 'Gunawan', 'nip' => '111111', 'email' => 'gunawan19621@gmail.com', 'no_hp' => '085159079010', 'divisi' => 'admin', 'role_id' => 1, 'warehouse_id' => 1, 'address' => 'Jl. Raya Gelarmendala', 'password' => bcrypt('19062001')],
['username' => 'warehouse123', 'fullname' => 'warehouse', 'nip' => '222222', 'email' => 'warehouse@gmail.com', 'no_hp' => '085159079020', 'divisi' => 'admin', 'role_id' => 2, 'warehouse_id' => 2, 'address' => 'Jl. Raya Ciwatu', 'status' => 'aktif', 'password' => bcrypt('warehouse123')], ['username' => 'warehouse123', 'fullname' => 'warehouse', 'nip' => '222222', 'email' => 'warehouse@gmail.com', 'no_hp' => '085159079020', 'divisi' => 'admin', 'role_id' => 2, 'warehouse_id' => 2, 'address' => 'Jl. Raya Ciwatu', 'password' => bcrypt('warehouse123')],
['username' => 'customer123', 'fullname' => 'customer', 'nip' => '333333', 'email' => 'customer@gmail.com', 'no_hp' => '085159079030', 'divisi' => 'admin', 'role_id' => 3, 'warehouse_id' => 3, 'address' => 'Jl. Raya Balongan', 'status' => 'aktif', 'password' => bcrypt('customer123')] ['username' => 'customer123', 'fullname' => 'customer', 'nip' => '333333', 'email' => 'customer@gmail.com', 'no_hp' => '085159079030', 'divisi' => 'admin', 'role_id' => 3, 'warehouse_id' => 3, 'address' => 'Jl. Raya Balongan', 'password' => bcrypt('customer123')]
]); ]);
} }

31
resources/views/addons/SettingPlatform/manajement_asset.blade.php → resources/views/MasterData/asset.blade.php

@ -3,13 +3,13 @@
@section('content') @section('content')
<div class="container-fluid"> <div class="container-fluid">
<!-- <h1 class="h3 mb-2 text-gray-800">Tabel Asset</h1> <!-- <h1 class="h3 mb-2 text-gray-800">Tabel Asset</h1>
<div class="mb-4"> <div class="mb-4">
<p>Our Item Tables are enhanced with the help of the DataTables plugin. This is a powerful tool that allows you <p>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</p> to explore return data in a more interactive and efficient way</p>
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal"> <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal">
<span class="text">+ Tambah data</span> <span class="text">+ Tambah data</span>
</a> </a>
</div> --> </div> -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<div class="row"> <div class="row">
@ -17,9 +17,10 @@
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Asset</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Data Asset</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal"> <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
<span class="text">+ Tambah data</span> data-target="#tambahDataModal">
</a> <span class="text">+ Tambah data</span>
</a>
<a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto" <a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank"> target="_blank">
<span class="text">Cetak PDF</span> <span class="text">Cetak PDF</span>
@ -31,16 +32,6 @@
</div> </div>
</div> </div>
</div> </div>
{{-- <div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary">DataTables Asset</h6>
<a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank">
<span class="text">CETAK PDF</span>
</a>
<a href="{{ route('assetexport.export') }}" class="btn btn-info btn-icon-split ml-auto" target="_blank">
<span class="text">CETAK Exel</span>
</a>
</div> --}}
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">

0
resources/views/addons/SettingPlatform/asset_pdf.blade.php → resources/views/MasterData/asset_pdf.blade.php

0
resources/views/addons/pengadaan.blade.php → resources/views/MasterData/pengadaan.blade.php

0
resources/views/addons/settingPlatform.blade.php → resources/views/MasterData/settingPlatform.blade.php

9
resources/views/addons/SettingPlatform/update_user.blade.php → resources/views/MasterData/update_user.blade.php

@ -37,15 +37,6 @@
<label for="address" class="col-form-label">Alamat:</label> <label for="address" class="col-form-label">Alamat:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukan detail alamat anda" required>{{ $user->address }}</textarea> <textarea class="form-control" name="address" id="address" placeholder="Masukan detail alamat anda" required>{{ $user->address }}</textarea>
<label for="status" class="col-form-label">Status:</label>
<select class="form-control" name="status" type="text" id="status">
<option disabled selected>Pilih Status</option>
<option value="aktif" {{ old('status', $user->status) == 'aktif' ? 'selected' : '' }}>Aktif
</option>
<option value="tidak aktif" {{ old('status', $user->status) == 'tidak aktif' ? 'selected' : '' }}>
Tidak Aktif
</option>
</select>
<label for="role_id" class="col-form-label">Hak Akses:</label> <label for="role_id" class="col-form-label">Hak Akses:</label>
<select class="form-control" name="role_id" type="text" id="role_id"> <select class="form-control" name="role_id" type="text" id="role_id">
<option disabled selected>Pilih Hak Akses</option> <option disabled selected>Pilih Hak Akses</option>

147
resources/views/MasterData/user.blade.php

@ -0,0 +1,147 @@
@extends('layouts.main')
@section('title', 'Manajemen User')
@section('content')
{{-- <h1>Halaman Manajement User</h1> --}}
<div class="container-fluid">
<!-- <h1 class="h3 mb-2 text-gray-800">Tabel User</h1>
<div class="mb-4">
<p>Our User 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</p>
{{-- <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal">
<span class="text">+ Tambah data</span> --}}
</a>
</div> -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
</div>
<div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
data-target="#tambahDataModal">
<span class="text">+ Tambah data</span>
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
<tbody>
@php
$noUser = 1;
@endphp
@forelse ($user as $data)
<tr>
<td class="text-center">{{ $noUser++ }}</td>
<td>{{ $data->fullname }}</td>
<td>{{ $data->email }}</td>
<td>{{ isset($data->no_hp) ? $data->no_hp : '-' }}</td>
<td>{{ isset($data->address) ? $data->address : '-' }}</td>
<td>{{ $data->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('user.show', [$data->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('hapusUser.destroy', $data->id) }}"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')">
<i class="fa fa-trash text-danger mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Modal Tambah Asset-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Tambah Data</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('user.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="username" class="col-form-label">Username:</label>
<input class="form-control" name="username" type="text" id="username"
value="{{ old('username') }}" placeholder="Masukan Username user" required>
<label for="fullname" class="col-form-label">Nama Lengkap:</label>
<input class="form-control" name="fullname" type="text" id="fullname"
value="{{ old('fullname') }}" placeholder="Masukan Nama Lengkap user" pattern="[^0-9]+"
oninput="this.value=this.value.replace(/[0-9]/g,'');" required>
<label for="email" class="col-form-label">Email:</label>
<input class="form-control" name="email" type="email" id="email"
value="{{ old('email') }}" placeholder="Masukan email user" required>
<label for="divisi" class="col-form-label">Divisi:</label>
<input class="form-control" name="divisi" type="text" id="divisi"
value="{{ old('divisi') }}" placeholder="Masukan Divisi user" pattern="[^0-9]+"
oninput="this.value=this.value.replace(/[0-9]/g,'');" required>
<label for="role_id" class="col-form-label">Hak Akses:</label>
<select class="form-control" name="role_id" id="role_id" required>
<option disabled selected>Pilih Hak Akses User</option>
@foreach ($role as $dt_role)
<option value="{{ $dt_role->id }}">{{ $dt_role->name }}</option>
@endforeach
</select>
<label for="warehouse_id" class="col-form-label">Ditugaskan:</label>
<select class="form-control" name="warehouse_id" id="warehouse_id" required>
<option disabled selected>Pilih Hak Akses User</option>
@foreach ($warehouse as $dt_warehouse)
<option value="{{ $dt_warehouse->id }}">{{ $dt_warehouse->name }}</option>
@endforeach
</select>
<label for="password" class="col-form-label">Password:</label>
<input class="form-control" name="password" type="text" id="password"
value="{{ old('password') }}" placeholder="Masukan password user" required>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection

113
resources/views/MasterData/warehouse.blade.php

@ -0,0 +1,113 @@
@extends('layouts.main')
@section('title', 'Update Data User')
@section('content')
<div class="container-fluid">
{{-- <h4>Halaman management warehouse</h4> --}}
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data Asset</h5>
</div>
<div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal"
data-target="#tambahDataModal">
<span class="text">+ Tambah data</span>
</a>
<a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak PDF</span>
</a>
<a href="{{ route('assetexport.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak Exel</span>
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 50px;">No.</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="text-center" style="width: 50px;">No.</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Alamat</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
<tbody>
@php
$nowarehouses = 1;
@endphp
@foreach ($warehouses as $data)
<tr>
<td class="text-center" style="width: 50px;">{{ $nowarehouses++ }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->address }}</td>
<td class="text-center">
<a href="#" data-toggle="modal"
data-target="#editDataModal{{ $data['id'] }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<a href="{{ route('hapuswarehouse.destroy', $data->id) }}"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')">
<i class="fa fa-trash text-danger mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Modal Tambah Asset-->
<div class="modal fade" id="tambahDataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Tambah Data</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('warehouse.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="name" class="col-form-label">Nama:</label>
<input class="form-control" name="name" type="text" id="name"
value="{{ old('name') }}" placeholder="Masukan Nama Gudang" required>
<label for="description" class="col-form-label">Deskripsi:</label>
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Gudang" required>{{ old('description') }}</textarea>
<label for="address" class="col-form-label">Alamat:</label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan Alamat Gudang" required>{{ old('address') }}</textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection

86
resources/views/addons/SettingPlatform/manajement_user.blade.php

@ -1,86 +0,0 @@
@extends('layouts.main')
@section('title', 'Manajemen User')
@section('content')
{{-- <h1>Halaman Manajement User</h1> --}}
<div class="container-fluid">
<!-- <h1 class="h3 mb-2 text-gray-800">Tabel User</h1>
<div class="mb-4">
<p>Our User 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</p>
{{-- <a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal">
<span class="text">+ Tambah data</span> --}}
</a>
</div> -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Data User</h5>
</div>
<div class="col-6 text-right">
{{--<a href="#" class="btn btn-success btn-icon-split" data-toggle="modal" data-target="#tambahDataModal">
<span class="text">+ Tambah data</span>
</a>--}}
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>No. HP</th>
<th>Alamat</th>
<th>Ditugaskan</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
<tbody>
@php
$noUser = 1;
@endphp
@forelse ($user as $data)
<tr>
<td>{{ $noUser++ }}</td>
<td>{{ $data->fullname }}</td>
<td>{{ $data->email }}</td>
<td>{{ $data->no_hp }}</td>
<td>{{ $data->address }}</td>
<td>{{ $data->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('user.show', [$data->id]) }}">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
{{-- <a href="{{ route('hapusUser.destroy', $data->id) }}">
<i class="fa fa-trash text-danger mr-2" style="font-size: 20px"></i>
</a> --}}
<a href="{{ route('hapusUser.destroy', $data->id) }}"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')">
<i class="fa fa-trash text-danger mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

243
resources/views/dashboard/index.blade.php

@ -1,156 +1,163 @@
@extends('layouts.main') @extends('layouts.main')
@section('title', 'Dashboard') @section('title', 'Dashboard')
@section('content') @section('content')
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="container-fluid">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i <h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
</div> class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
<div class="row"> </div>
<div class="col-xl-3 col-md-6 mb-4"> <div class="row">
<div class="card border-left-primary shadow h-100 py-2"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card-body"> <div class="card border-left-primary shadow h-100 py-2">
<div class="row no-gutters align-items-center"> <div class="card-body">
<div class="col mr-2"> <div class="row no-gutters align-items-center">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;"> <div class="col mr-2">
<strong>Pengadaan</strong> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1"
style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahAsset }}
</div>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">{{ $jumlahAsset }} <div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Earnings (Monthly) Card Example --> <!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2"> <div class="card border-left-success shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1" style="font-size: 14px;"> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"
<strong>Peminjaman</strong> style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Earnings (Monthly) Card Example --> <!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2"> <div class="card border-left-info shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1" style="font-size: 14px;"> <div class="text-xs font-weight-bold text-info text-uppercase mb-1"
<strong>Pengembalian</strong> style="font-size: 14px;">
<strong>Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Pending Requests Card Example --> <!-- Pending Requests Card Example -->
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2"> <div class="card border-left-warning shadow h-100 py-2">
<div class="card-body"> <div class="card-body">
<div class="row no-gutters align-items-center"> <div class="row no-gutters align-items-center">
<div class="col mr-2"> <div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1" style="font-size: 13px;"> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"
<strong>Reminder Pengembalian</strong> style="font-size: 13px;">
<strong>Reminder Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">28</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">28</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- Area Chart -->
<!-- Area Chart --> <div class="col-xl-8 col-lg-7">
<div class="col-xl-8 col-lg-7"> <div class="card shadow mb-4">
<div class="card shadow mb-4"> <!-- Card Header - Dropdown -->
<!-- Card Header - Dropdown --> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian
<h6 class="m-0 font-weight-bold text-primary">Grafik Peminjaman VS Pengembalian </h6>
</h6> <div class="dropdown no-arrow">
<div class="dropdown no-arrow"> <a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i> </a>
</a> <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
aria-labelledby="dropdownMenuLink"> <div class="dropdown-header">Dropdown Header:</div>
<div class="dropdown-header">Dropdown Header:</div> <a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Another action</a> <div class="dropdown-divider"></div>
<div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Something else here</a>
<a class="dropdown-item" href="#">Something else here</a> </div>
</div> </div>
</div> </div>
</div> <!-- Card Body -->
<!-- Card Body --> <div class="card-body">
<div class="card-body"> <div class="chart-bar">
<div class="chart-bar"> <canvas id="myBarChart"></canvas>
<canvas id="myBarChart"></canvas> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Pie Chart --> <!-- Pie Chart -->
<div class="col-xl-4 col-lg-5"> <div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<!-- Card Header - Dropdown --> <!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Barang</h6> <h6 class="m-0 font-weight-bold text-primary">Grafik Pengadaan Barang</h6>
<div class="dropdown no-arrow"> <div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" <a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i> <i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a> </a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby="dropdownMenuLink"> aria-labelledby="dropdownMenuLink">
<div class="dropdown-header">Dropdown Header:</div> <div class="dropdown-header">Dropdown Header:</div>
<a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a> <a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a> <a class="dropdown-item" href="#">Something else here</a>
</div>
</div> </div>
</div> </div>
</div> <!-- Card Body -->
<!-- Card Body --> <div class="card-body">
<div class="card-body"> <div class="chart-pie pt-4 pb-2">
<div class="chart-pie pt-4 pb-2"> <canvas id="myPieChart"></canvas>
<canvas id="myPieChart"></canvas> </div>
</div> <div class="mt-4 text-center small">
<div class="mt-4 text-center small"> <span class="mr-2">
<span class="mr-2"> <i class="fas fa-circle text-primary"></i> Direct
<i class="fas fa-circle text-primary"></i> Direct </span>
</span> <span class="mr-2">
<span class="mr-2"> <i class="fas fa-circle text-success"></i> Social
<i class="fas fa-circle text-success"></i> Social </span>
</span> <span class="mr-2">
<span class="mr-2"> <i class="fas fa-circle text-info"></i> Referral
<i class="fas fa-circle text-info"></i> Referral </span>
</span> </div>
</div> </div>
</div> </div>
</div> </div>

34
resources/views/layouts/main.blade.php

@ -29,29 +29,17 @@
<!-- Begin Page Content --> <!-- Begin Page Content -->
<!-- <div class="container-fluid"> --> <!-- <div class="container-fluid"> -->
<!-- allert update data foto --> <!-- allert update data foto -->
{{-- @if (session()->has('success')) @if (session()->has('success'))
<div id="success-alert" class="alert alert-success floating-alert"> <div id="success-alert" class="alert alert-success floating-alert">
{{ session()->get('success') }} {{ session()->get('success') }}
</div> </div>
@elseif(session()->has('error')) @elseif(session()->has('error'))
<div id="error-alert" class="alert alert-danger floating-alert"> <div id="error-alert" class="alert alert-danger floating-alert">
X {{ session()->get('error') }} X {{ session()->get('error') }}
</div> </div>
@endif --}} @endif
@if (session()->has('success')) @yield('content')
<div id="success-alert" class="alert alert-success">
{{ session()->get('success') }}
</div>
@elseif(session()->has('error'))
<div id="success-alert" class="alert alert-danger">
X {{ session()->get('error') }}
</div>
@endif
<!-- allert update data foto -->
@yield('content')
<!-- </div> -->
<!-- /.container-fluid -->
</div> </div>
<!-- End of Main Content --> <!-- End of Main Content -->

5
resources/views/layouts/sidebar.blade.php

@ -68,4 +68,9 @@
<span class="ml-4">User</span> <span class="ml-4">User</span>
</a> </a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="{{ route('warehouse.index') }}">
<span class="ml-4">Warehouse</span>
</a>
</li>
</ul> </ul>

15
routes/web.php

@ -14,6 +14,7 @@ use App\Http\Controllers\BarangMasukController;
use App\Http\Controllers\BarangKeluarController; use App\Http\Controllers\BarangKeluarController;
use App\Http\Controllers\PengembalianController; use App\Http\Controllers\PengembalianController;
use App\Http\Controllers\SettingPlatformController; use App\Http\Controllers\SettingPlatformController;
use App\Http\Controllers\WarehouseController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -27,8 +28,6 @@ use App\Http\Controllers\SettingPlatformController;
*/ */
Route::get('/', function () { Route::get('/', function () {
// return view('welcome');
// return view('landing_page.layouts.main');
return view('auth.login'); return view('auth.login');
}); });
@ -52,7 +51,7 @@ Route::group(['prefix' => 'dashboard'], function () {
}); });
//Halaman Transaksi //Halaman Transaksi
Route::middleware('auth')->resource('/transaksi', TransaksiController::class); // Route::middleware('auth')->resource('/transaksi', TransaksiController::class);
//Halaman Peminjaman //Halaman Peminjaman
Route::middleware('auth')->resource('/peminjaman', PeminjamanController::class); Route::middleware('auth')->resource('/peminjaman', PeminjamanController::class);
@ -74,12 +73,16 @@ Route::group(['prefix' => 'dashboard'], function () {
Route::middleware('auth')->resource('/user', M_userController::class); Route::middleware('auth')->resource('/user', M_userController::class);
Route::get('/hapusUser/{id}', [M_userController::class, 'destroy'])->name('hapusUser.destroy'); Route::get('/hapusUser/{id}', [M_userController::class, 'destroy'])->name('hapusUser.destroy');
//Halaman Warehouse
Route::middleware('auth')->resource('/warehouse', WarehouseController::class);
Route::get('/hapuswarehouse/{id}', [WarehouseController::class, 'destroy'])->name('hapuswarehouse.destroy');
//Halaman Barang Masuk //Halaman Barang Masuk
Route::middleware('auth')->resource('/barangMasuk', BarangMasukController::class); // Route::middleware('auth')->resource('/barangMasuk', BarangMasukController::class);
//Halaman Barang Keluar //Halaman Barang Keluar
Route::middleware('auth')->resource('/barangKeluar', BarangKeluarController::class); // Route::middleware('auth')->resource('/barangKeluar', BarangKeluarController::class);
Route::get('/hapusBarangK/{id}', [BarangKeluarController::class, 'destroy'])->name('hapusBarangK.destroy'); // Route::get('/hapusBarangK/{id}', [BarangKeluarController::class, 'destroy'])->name('hapusBarangK.destroy');
}); });
require __DIR__ . '/auth.php'; require __DIR__ . '/auth.php';

Loading…
Cancel
Save