Gunawan19621
1 year ago
29 changed files with 1581 additions and 92 deletions
@ -0,0 +1,134 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\Models\Customer; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
|
||||||
|
class CustomerController extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Display a listing of the resource. |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'customer' => Customer::all(), |
||||||
|
'active' => 'menu-customer', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Customer.index', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for creating a new resource. |
||||||
|
*/ |
||||||
|
public function create() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'active' => 'menu-customer', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Customer.create', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Store a newly created resource in storage. |
||||||
|
*/ |
||||||
|
public function store(Request $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 |
||||||
|
Customer::create($validatedData); |
||||||
|
return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil ditambahkan'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data customer Gagal Ditambah.'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Display the specified resource. |
||||||
|
*/ |
||||||
|
public function show($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'customer' => Customer::findOrFail($id), |
||||||
|
'active' => 'menu-customer', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Customer.show', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for editing the specified resource. |
||||||
|
*/ |
||||||
|
public function edit($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'customer' => Customer::findOrFail($id), |
||||||
|
'active' => 'menu-customer', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Customer.edit', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update the specified resource in storage. |
||||||
|
*/ |
||||||
|
public function update(Request $request, $id) |
||||||
|
{ |
||||||
|
// dd($request->all()); |
||||||
|
$request->validate([ |
||||||
|
'name' => 'required', |
||||||
|
'code_customer' => 'required', |
||||||
|
'lot_no' => 'required', |
||||||
|
'nip' => 'required', |
||||||
|
'no_hp' => 'required', |
||||||
|
'tgl_lahir' => 'required', |
||||||
|
'jenis_kelamin' => 'required', |
||||||
|
'agama' => 'required', |
||||||
|
'address' => 'required', |
||||||
|
]); |
||||||
|
// dd($request); |
||||||
|
try { |
||||||
|
$customer = Customer::findOrFail($id); |
||||||
|
$customerData = $request->all(); |
||||||
|
|
||||||
|
// Menambahkan nama pengguna yang melakukan pembaruan |
||||||
|
$customerData['updated_by'] = Auth::user()->fullname; |
||||||
|
|
||||||
|
$customer->update($customerData); |
||||||
|
return redirect()->route('dashboard.customer.index')->with('success', 'Data customer berhasil diperbaharui'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data customer gagal diperbaharui'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Remove the specified resource from storage. |
||||||
|
*/ |
||||||
|
public function destroy($id) |
||||||
|
{ |
||||||
|
// dd("oke"); |
||||||
|
try { |
||||||
|
$customer = Customer::findOrFail($id); |
||||||
|
$customer->delete(); |
||||||
|
return redirect()->back()->with('success', 'Data customer berhasil dihapus'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data customer gagal dihapus'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,182 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\Models\Customer; |
||||||
|
use App\Models\m_warehouse; |
||||||
|
use App\Models\Peti; |
||||||
|
use App\Models\Type_peti; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
use Mockery\Matcher\Type; |
||||||
|
|
||||||
|
class PetiController extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Display a listing of the resource. |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'peti' => Peti::all(), |
||||||
|
'active' => 'menu-peti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Peti.index', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for creating a new resource. |
||||||
|
*/ |
||||||
|
public function create() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'typepeti' => Type_peti::all(), |
||||||
|
'customer' => Customer::all(), |
||||||
|
'warehouse' => m_warehouse::all(), |
||||||
|
'active' => 'menu-peti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Peti.create', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Store a newly created resource in storage. |
||||||
|
*/ |
||||||
|
public function store(Request $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(); |
||||||
|
|
||||||
|
for ($i = 0; $i < $request->jumlah; $i++) { |
||||||
|
$validatedData = $request->except('_token'); |
||||||
|
|
||||||
|
// Ambil nomor urutan otomatis untuk packing_no |
||||||
|
$latestPackingNo = Peti::max('packing_no'); |
||||||
|
$nextPackingNo = $latestPackingNo + 1; |
||||||
|
$validatedData['packing_no'] = $nextPackingNo; |
||||||
|
|
||||||
|
$code_customer = Customer::where('id', $validatedData['customer_id'])->first()->code_customer; |
||||||
|
$type = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->type; |
||||||
|
$size_peti = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->size_peti; |
||||||
|
$lot_no = Customer::where('id', $validatedData['customer_id'])->first()->lot_no; |
||||||
|
$packing_no = $validatedData['packing_no']; |
||||||
|
|
||||||
|
// Generate nilai 'fix_lot' sesuai format yang diinginkan |
||||||
|
$fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no; |
||||||
|
$validatedData['fix_lot'] = $fixLot; |
||||||
|
|
||||||
|
$validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by |
||||||
|
$validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by |
||||||
|
|
||||||
|
// Buat entri peti baru |
||||||
|
Peti::create($validatedData); |
||||||
|
} |
||||||
|
|
||||||
|
return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil ditambahkan'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data peti Gagal Ditambah.'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Display the specified resource. |
||||||
|
*/ |
||||||
|
public function show($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'peti' => Peti::findOrFail($id), |
||||||
|
'typepeti' => Type_peti::all(), |
||||||
|
'customer' => Customer::all(), |
||||||
|
'warehouse' => m_warehouse::all(), |
||||||
|
'active' => 'menu-peti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Peti.show', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for editing the specified resource. |
||||||
|
*/ |
||||||
|
public function edit($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'peti' => Peti::findOrFail($id), |
||||||
|
'typepeti' => Type_peti::all(), |
||||||
|
'customer' => Customer::all(), |
||||||
|
'warehouse' => m_warehouse::all(), |
||||||
|
'active' => 'menu-peti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Peti.edit', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update the specified resource in storage. |
||||||
|
*/ |
||||||
|
public function update(Request $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); |
||||||
|
|
||||||
|
if (!$typepeti) { |
||||||
|
return redirect()->back()->with('error', 'Data peti tidak ditemukan.'); |
||||||
|
} |
||||||
|
|
||||||
|
$validatedData = $request->except('_token', '_method'); |
||||||
|
|
||||||
|
$code_customer = Customer::where('id', $validatedData['customer_id'])->first()->code_customer; |
||||||
|
$type = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->type; |
||||||
|
$size_peti = Type_peti::where('id', $validatedData['tipe_peti_id'])->first()->size_peti; |
||||||
|
$lot_no = Customer::where('id', $validatedData['customer_id'])->first()->lot_no; |
||||||
|
$packing_no = $typepeti->packing_no; // Mengambil packing_no dari entitas yang sudah ada |
||||||
|
|
||||||
|
// Generate nilai 'fix_lot' sesuai format yang diinginkan |
||||||
|
$fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no; |
||||||
|
$validatedData['fix_lot'] = $fixLot; |
||||||
|
|
||||||
|
// Tambahkan perubahan yang diperlukan ke entitas Peti |
||||||
|
$typepeti->update($validatedData); |
||||||
|
|
||||||
|
// Menambahkan nama pengguna yang melakukan pembaruan |
||||||
|
$typepeti->update(['updated_by' => $currentuser->fullname]); |
||||||
|
|
||||||
|
return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil diperbaharui'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data peti gagal diperbaharui'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Remove the specified resource from storage. |
||||||
|
*/ |
||||||
|
public function destroy($id) |
||||||
|
{ |
||||||
|
try { |
||||||
|
$typepeti = Peti::findOrFail($id); |
||||||
|
$typepeti->delete(); |
||||||
|
return redirect()->back()->with('success', 'Data peti berhasil dihapus'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data peti gagal dihapus'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,123 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\Models\Type_peti; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
|
||||||
|
class TypePetiController extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Display a listing of the resource. |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'typepeti' => Type_peti::all(), |
||||||
|
'active' => 'menu-typepeti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.index', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for creating a new resource. |
||||||
|
*/ |
||||||
|
public function create() |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'active' => 'menu-typepeti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.create', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Store a newly created resource in storage. |
||||||
|
*/ |
||||||
|
public function store(Request $request) |
||||||
|
{ |
||||||
|
// dd($request->all()); |
||||||
|
$request->validate([ |
||||||
|
'type' => 'required', |
||||||
|
'size_peti' => 'required', |
||||||
|
'description' => 'required', |
||||||
|
]); |
||||||
|
// dd($request); |
||||||
|
try { |
||||||
|
$currenttype = Auth::user(); |
||||||
|
$validatedData = $request->except('_token'); |
||||||
|
$validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by |
||||||
|
$validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by |
||||||
|
// dd($validatedData); |
||||||
|
Type_peti::create($validatedData); |
||||||
|
return redirect()->route('dashboard.typepeti.index')->with('success', 'Data Tipe Peti berhasil ditambahkan'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
// dd($th); |
||||||
|
return redirect()->back()->with('error', 'Data Tipe Peti Gagal Ditambah.'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Display the specified resource. |
||||||
|
*/ |
||||||
|
public function show($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'typepeti' => Type_peti::findOrFail($id), // Mengambil detail data yang sesuai dengan parameter $id |
||||||
|
'active' => 'menu-typepeti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.show', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the form for editing the specified resource. |
||||||
|
*/ |
||||||
|
public function edit($id) |
||||||
|
{ |
||||||
|
$data = [ |
||||||
|
'typepeti' => Type_peti::findOrFail($id), |
||||||
|
'active' => 'menu-typepeti', |
||||||
|
]; |
||||||
|
return view('dashboard.Master_Data.Manajemen_Peti.Type_peti.edit', $data); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update the specified resource in storage. |
||||||
|
*/ |
||||||
|
public function update(Request $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(); |
||||||
|
|
||||||
|
// Menambahkan nama pengguna yang melakukan pembaruan |
||||||
|
$typepetiData['updated_by'] = Auth::user()->fullname; |
||||||
|
|
||||||
|
$typepeti->update($typepetiData); |
||||||
|
return redirect()->route('dashboard.typepeti.index')->with('success', 'Data typepeti berhasil diperbaharui'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data typepeti gagal diperbaharui'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Remove the specified resource from storage. |
||||||
|
*/ |
||||||
|
public function destroy($id) |
||||||
|
{ |
||||||
|
try { |
||||||
|
$typepeti = Type_peti::findOrFail($id); |
||||||
|
$typepeti->delete(); |
||||||
|
return redirect()->back()->with('success', 'Data tipe peti berhasil dihapus'); |
||||||
|
} catch (\Throwable $th) { |
||||||
|
return redirect()->back()->with('error', 'Data tipe peti gagal dihapus'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Models; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes; |
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||||
|
|
||||||
|
class Customer extends Model |
||||||
|
{ |
||||||
|
use HasFactory, SoftDeletes; |
||||||
|
protected $table = 'customers'; |
||||||
|
|
||||||
|
protected $fillable = [ |
||||||
|
'name', |
||||||
|
'code_customer', |
||||||
|
'lot_no', |
||||||
|
'nip', |
||||||
|
'no_hp', |
||||||
|
'tgl_lahir', |
||||||
|
'jenis_kelamin', |
||||||
|
'agama', |
||||||
|
'address', |
||||||
|
'created_by', |
||||||
|
'updated_by', |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Models; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes; |
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||||
|
|
||||||
|
class Peti extends Model |
||||||
|
{ |
||||||
|
use HasFactory, SoftDeletes; |
||||||
|
protected $table = 'petis'; |
||||||
|
|
||||||
|
protected $fillable = [ |
||||||
|
'tipe_peti_id', |
||||||
|
'warna', |
||||||
|
'customer_id', |
||||||
|
'warehouse_id', |
||||||
|
'jumlah', |
||||||
|
'date_pembuatan', |
||||||
|
'status_disposal', |
||||||
|
'packing_no', |
||||||
|
'fix_lot', |
||||||
|
'created_by', |
||||||
|
'updated_by', |
||||||
|
]; |
||||||
|
|
||||||
|
public function customer() |
||||||
|
{ |
||||||
|
return $this->belongsTo(Customer::class, 'customer_id'); |
||||||
|
} |
||||||
|
public function warehouse() |
||||||
|
{ |
||||||
|
return $this->belongsTo(m_warehouse::class, 'warehouse_id'); |
||||||
|
} |
||||||
|
public function tipe_peti() |
||||||
|
{ |
||||||
|
return $this->belongsTo(Type_peti::class, 'tipe_peti_id'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Models; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes; |
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||||
|
|
||||||
|
class Type_peti extends Model |
||||||
|
{ |
||||||
|
use HasFactory, SoftDeletes; |
||||||
|
protected $table = 'type_petis'; |
||||||
|
|
||||||
|
protected $fillable = [ |
||||||
|
'type', |
||||||
|
'size_peti', |
||||||
|
'description', |
||||||
|
'created_by', |
||||||
|
'updated_by', |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
return new class extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
*/ |
||||||
|
public function up(): void |
||||||
|
{ |
||||||
|
Schema::create('customers', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->string('name', 200); |
||||||
|
$table->string('code_customer', 50); |
||||||
|
$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->text('address')->nullable(); |
||||||
|
$table->timestamps(); |
||||||
|
$table->softDeletes(); |
||||||
|
$table->string('created_by', 200)->nullable(); |
||||||
|
$table->string('updated_by', 200)->nullable(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
*/ |
||||||
|
public function down(): void |
||||||
|
{ |
||||||
|
Schema::dropIfExists('customers'); |
||||||
|
} |
||||||
|
}; |
@ -0,0 +1,33 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
return new class extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
*/ |
||||||
|
public function up(): void |
||||||
|
{ |
||||||
|
Schema::create('type_petis', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->string('type'); |
||||||
|
$table->string('size_peti'); |
||||||
|
$table->text('description')->nullable(); |
||||||
|
$table->timestamps(); |
||||||
|
$table->softDeletes(); |
||||||
|
$table->string('created_by', 200)->nullable(); |
||||||
|
$table->string('updated_by', 200)->nullable(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
*/ |
||||||
|
public function down(): void |
||||||
|
{ |
||||||
|
Schema::dropIfExists('type_petis'); |
||||||
|
} |
||||||
|
}; |
@ -0,0 +1,42 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
return new class extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
*/ |
||||||
|
public function up(): void |
||||||
|
{ |
||||||
|
Schema::create('petis', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->unsignedBigInteger('tipe_peti_id')->nullable(); |
||||||
|
$table->foreign('tipe_peti_id')->references('id')->on('type_petis')->onDelete('set null'); |
||||||
|
$table->string('warna', 50); |
||||||
|
$table->string('fix_lot', 100); |
||||||
|
$table->integer('packing_no'); |
||||||
|
$table->unsignedBigInteger('customer_id')->nullable(); |
||||||
|
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('set null'); |
||||||
|
$table->integer('jumlah')->nullable(); |
||||||
|
$table->date('date_pembuatan', 100)->nullable(); |
||||||
|
$table->unsignedBigInteger('warehouse_id')->nullable(); |
||||||
|
$table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null'); |
||||||
|
$table->string('status_disposal')->nullable(); |
||||||
|
$table->timestamps(); |
||||||
|
$table->softDeletes(); |
||||||
|
$table->string('created_by', 200)->nullable(); |
||||||
|
$table->string('updated_by', 200)->nullable(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
*/ |
||||||
|
public function down(): void |
||||||
|
{ |
||||||
|
Schema::dropIfExists('petis'); |
||||||
|
} |
||||||
|
}; |
@ -0,0 +1,43 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace Database\Seeders; |
||||||
|
|
||||||
|
use Illuminate\Database\Seeder; |
||||||
|
use Illuminate\Support\Facades\DB; |
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
||||||
|
|
||||||
|
class Customer extends Seeder |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the database seeds. |
||||||
|
*/ |
||||||
|
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', |
||||||
|
'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', |
||||||
|
'created_by' => 'Seeder', |
||||||
|
'updated_by' => 'Seeder', |
||||||
|
]); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace Database\Seeders; |
||||||
|
|
||||||
|
use App\Models\Peti; |
||||||
|
use Illuminate\Database\Seeder; |
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
||||||
|
use Illuminate\Support\Facades\DB; |
||||||
|
|
||||||
|
class Type_Peti extends Seeder |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the database seeds. |
||||||
|
*/ |
||||||
|
public function run(): void |
||||||
|
{ |
||||||
|
DB::table('type_petis')->insert([ |
||||||
|
'type' => 'BS', |
||||||
|
'size_peti' => '2 X 2 X 2 X 2', |
||||||
|
'description' => 'Detail BS', |
||||||
|
'created_by' => 'Seeder', |
||||||
|
'updated_by' => 'Seeder', |
||||||
|
]); |
||||||
|
DB::table('type_petis')->insert([ |
||||||
|
'type' => 'BCA', |
||||||
|
'size_peti' => '3 X 3 X 3 X 3', |
||||||
|
'description' => 'Detail BCA', |
||||||
|
'created_by' => 'Seeder', |
||||||
|
'updated_by' => 'Seeder', |
||||||
|
]); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,68 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Tambah Customer</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.customer.store') }}" method="POST" enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
<div class="form-group"> |
||||||
|
<label for="name" class="col-form-label">Nama Customer:</label> |
||||||
|
<input class="form-control" name="name" type="text" id="name" value="{{ old('name') }}" |
||||||
|
placeholder="Masukan nama customer" required> |
||||||
|
|
||||||
|
<label for="code_customer" class="col-form-label">Kode Customer:</label> |
||||||
|
<input class="form-control" name="code_customer" type="text" id="code_customer" |
||||||
|
value="{{ old('code_customer') }}" placeholder="Masukan kode customer" required> |
||||||
|
|
||||||
|
<label for="lot_no" class="col-form-label">Lot Number:</label> |
||||||
|
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ old('lot_no') }}" |
||||||
|
placeholder="Masukan lot number" required> |
||||||
|
|
||||||
|
<label for="nip" class="col-form-label">NIP Customer:</label> |
||||||
|
<input class="form-control" name="nip" type="text" id="nip" value="{{ old('nip') }}" |
||||||
|
placeholder="Masukan NIP customer" required> |
||||||
|
|
||||||
|
<label for="no_hp" class="col-form-label">No. HP Customer:</label> |
||||||
|
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ old('no_hp') }}" |
||||||
|
placeholder="Masukan Nomor Handphone customer" required> |
||||||
|
|
||||||
|
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label> |
||||||
|
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir" |
||||||
|
value="{{ old('tgl_lahir') }}" required> |
||||||
|
|
||||||
|
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label> |
||||||
|
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required> |
||||||
|
<option disabled selected>Pilih Jenis Kelamin Customer</option> |
||||||
|
<option value="Laki-Laki">Laki-Laki</option> |
||||||
|
<option value="Perempuan">Perempuan</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="agama" class="col-form-label">Agama Customer:</label> |
||||||
|
<select class="form-control" name="agama" id="agama" required> |
||||||
|
<option disabled selected>Pilih Agama Customer</option> |
||||||
|
<option value="Islam">Islam</option> |
||||||
|
<option value="Kristen">Kristen</option> |
||||||
|
<option value="Katolik">Katolik</option> |
||||||
|
<option value="Hindu">Hindu</option> |
||||||
|
<option value="Buddha">Buddha</option> |
||||||
|
<option value="Konghucu">Konghucu</option> |
||||||
|
<option value="Lainnya">Lainnya</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="address" class="col-form-label">Alamat Customer:</label> |
||||||
|
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,72 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Edit Customer</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.customer.update', [$customer->id]) }}" method="POST" |
||||||
|
enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
@method('PUT') |
||||||
|
<div class="form-group"> |
||||||
|
<label for="name" class="col-form-label">Nama Customer:</label> |
||||||
|
<input class="form-control" name="name" type="text" id="name" value="{{ $customer->name }}" |
||||||
|
placeholder="Masukan nama customer" required> |
||||||
|
|
||||||
|
<label for="code_customer" class="col-form-label">Kode Customer:</label> |
||||||
|
<input class="form-control" name="code_customer" type="text" id="code_customer" |
||||||
|
value="{{ $customer->code_customer }}" placeholder="Masukan kode customer" required> |
||||||
|
|
||||||
|
<label for="lot_no" class="col-form-label">Lot Number:</label> |
||||||
|
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" |
||||||
|
placeholder="Masukan lot number" required> |
||||||
|
|
||||||
|
<label for="nip" class="col-form-label">NIP Customer:</label> |
||||||
|
<input class="form-control" name="nip" type="text" id="nip" value="{{ $customer->nip }}" |
||||||
|
placeholder="Masukan NIP customer" required> |
||||||
|
|
||||||
|
<label for="no_hp" class="col-form-label">No. HP Customer:</label> |
||||||
|
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ $customer->no_hp }}" |
||||||
|
placeholder="Masukan Nomor Handphone customer" required> |
||||||
|
|
||||||
|
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label> |
||||||
|
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir" |
||||||
|
value="{{ $customer->tgl_lahir }}" required> |
||||||
|
|
||||||
|
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label> |
||||||
|
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" required> |
||||||
|
<option disabled>Pilih Jenis Kelamin Customer</option> |
||||||
|
<option value="Laki-Laki" {{ $customer->jenis_kelamin === 'Laki-Laki' ? 'selected' : '' }}>Laki-Laki |
||||||
|
</option> |
||||||
|
<option value="Perempuan" {{ $customer->jenis_kelamin === 'Perempuan' ? 'selected' : '' }}>Perempuan |
||||||
|
</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="agama" class="col-form-label">Agama Customer:</label> |
||||||
|
<select class="form-control" name="agama" id="agama" required> |
||||||
|
<option disabled selected>Pilih Agama Customer</option> |
||||||
|
<option value="Islam" {{ $customer->agama === 'Islam' ? 'selected' : '' }}>Islam</option> |
||||||
|
<option value="Kristen" {{ $customer->agama === 'Kristen' ? 'selected' : '' }}>Kristen</option> |
||||||
|
<option value="Katolik" {{ $customer->agama === 'Katolik' ? 'selected' : '' }}>Katolik</option> |
||||||
|
<option value="Hindu" {{ $customer->agama === 'Hindu' ? 'selected' : '' }}>Hindu</option> |
||||||
|
<option value="Buddha" {{ $customer->agama === 'Buddha' ? 'selected' : '' }}>Buddha</option> |
||||||
|
<option value="Konghucu" {{ $customer->agama === 'Konghucu' ? 'selected' : '' }}>Konghucu</option> |
||||||
|
<option value="Lainnya" {{ $customer->agama === 'Lainnya' ? 'selected' : '' }}>Lainnya</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="address" class="col-form-label">Alamat Customer:</label> |
||||||
|
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,67 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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="{{ route('dashboard.customer.create') }}" class="btn btn-success btn-icon-split"> |
||||||
|
<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 class="text-center">No</th> |
||||||
|
<th>Nama</th> |
||||||
|
<th>Kode Customer</th> |
||||||
|
<th>No. HP</th> |
||||||
|
<th>Alamat</th> |
||||||
|
<th class="text-center">Action</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
@php |
||||||
|
$nocustomer = 1; |
||||||
|
@endphp |
||||||
|
@forelse ($customer as $data_customer) |
||||||
|
<tr> |
||||||
|
<td class="text-center">{{ $nocustomer++ }}</td> |
||||||
|
<td>{{ $data_customer->name }}</td> |
||||||
|
<td>{{ $data_customer->code_customer }}</td> |
||||||
|
<td>{{ $data_customer->no_hp }}</td> |
||||||
|
<td>{{ $data_customer->address }}</td> |
||||||
|
<td class="text-center"> |
||||||
|
<a href="{{ route('dashboard.customer.show', [$data_customer->id]) }}"> |
||||||
|
<i class="fa fa-eye mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<a href="{{ route('dashboard.customer.edit', [$data_customer->id]) }}"> |
||||||
|
<i class="fa fa-edit mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<form action="{{ route('dashboard.customer.destroy', $data_customer->id) }}" |
||||||
|
method="POST" style="display: inline;"> |
||||||
|
@csrf |
||||||
|
@method('DELETE') |
||||||
|
<button type="submit" |
||||||
|
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')" |
||||||
|
style="border: none; background: none; cursor: pointer;"> |
||||||
|
<i class="fa fa-trash text-danger" style="font-size: 20px"></i> |
||||||
|
</button> |
||||||
|
</form> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
@empty |
||||||
|
<p>Data Kosong</p> |
||||||
|
@endforelse |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,53 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Detail Customer</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="name" class="col-form-label">Nama Customer:</label> |
||||||
|
<input class="form-control" name="name" type="text" id="name" value="{{ $customer->name }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="code_customer" class="col-form-label">Kode Customer:</label> |
||||||
|
<input class="form-control" name="code_customer" type="text" id="code_customer" |
||||||
|
value="{{ $customer->code_customer }}" readonly> |
||||||
|
|
||||||
|
<label for="lot_no" class="col-form-label">Lot Number:</label> |
||||||
|
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="nip" class="col-form-label">NIP Customer:</label> |
||||||
|
<input class="form-control" name="nip" type="text" id="nip" value="{{ $customer->nip }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="no_hp" class="col-form-label">No. HP Customer:</label> |
||||||
|
<input class="form-control" name="no_hp" type="text" id="no_hp" value="{{ $customer->no_hp }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="tgl_lahir" class="col-form-label">Tanggal Lahir Customer:</label> |
||||||
|
<input class="form-control" name="tgl_lahir" type="date" id="tgl_lahir" |
||||||
|
value="{{ $customer->tgl_lahir }}" readonly> |
||||||
|
|
||||||
|
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin Customer:</label> |
||||||
|
<input class="form-control" name="jenis_kelamin" type="text" id="jenis_kelamin" |
||||||
|
value="{{ $customer->jenis_kelamin }}" readonly> |
||||||
|
|
||||||
|
<label for="agama" class="col-form-label">Agama Customer:</label> |
||||||
|
<input class="form-control" name="agama" type="text" id="agama" value="{{ $customer->agama }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="address" class="col-form-label">Alamat Customer:</label> |
||||||
|
<textarea class="form-control" name="address" id="address" readonly>{{ $customer->address }}</textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,63 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Tambah Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.peti.store') }}" method="POST" enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
<div class="form-group"> |
||||||
|
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label> |
||||||
|
<select class="form-control" name="tipe_peti_id" id="tipe_peti_id" required> |
||||||
|
<option disabled selected>Pilih Tipe Peti</option> |
||||||
|
@foreach ($typepeti as $data_type) |
||||||
|
<option value="{{ $data_type->id }}">{{ $data_type->type }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="warna" class="col-form-label">Warna Peti:</label> |
||||||
|
<input class="form-control" name="warna" type="text" id="warna" value="{{ old('warna') }}" |
||||||
|
placeholder="Masukan Warna Peti" required> |
||||||
|
|
||||||
|
<label for="customer_id" class="col-form-label">Customer:</label> |
||||||
|
<select class="form-control" name="customer_id" id="customer_id" required> |
||||||
|
<option disabled selected>Pilih Customer</option> |
||||||
|
@foreach ($customer as $data_customer) |
||||||
|
<option value="{{ $data_customer->id }}">{{ $data_customer->name }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="warehouse_id" class="col-form-label">Warehouse:</label> |
||||||
|
<select class="form-control" name="warehouse_id" id="warehouse_id" required> |
||||||
|
<option disabled selected>Pilih Warehouse</option> |
||||||
|
@foreach ($warehouse as $data_warehouse) |
||||||
|
<option value="{{ $data_warehouse->id }}">{{ $data_warehouse->name }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="status_disposal" class="col-form-label">Status Peti:</label> |
||||||
|
<input class="form-control" name="status_disposal" type="text" id="status_disposal" |
||||||
|
value="{{ old('status_disposal') }}" placeholder="Masukan status Peti"> |
||||||
|
|
||||||
|
<label for="jumlah" class="col-form-label">Jumlah Peti:</label> |
||||||
|
<input class="form-control" name="jumlah" type="number" id="jumlah" value="{{ old('jumlah') }}" |
||||||
|
placeholder="Masukan jumlah Peti" required> |
||||||
|
|
||||||
|
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label> |
||||||
|
<input class="form-control" name="date_pembuatan" type="date" id="date_pembuatan" |
||||||
|
value="{{ old('date_pembuatan') }}" required> |
||||||
|
|
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,69 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Edit Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.peti.update', [$peti->id]) }}" method="POST" enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
@method('PUT') |
||||||
|
<div class="form-group"> |
||||||
|
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label> |
||||||
|
<select class="form-control" name="tipe_peti_id" id="tipe_peti_id"> |
||||||
|
<option disabled selected>Pilih Warehouse</option> |
||||||
|
@foreach ($typepeti as $data_type) |
||||||
|
<option value="{{ $data_type->id }}" |
||||||
|
@if ($data_type->id == $peti->tipe_peti_id) selected |
||||||
|
@else @endif> |
||||||
|
{{ $data_type->type }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="warna" class="col-form-label">Warna Peti:</label> |
||||||
|
<input class="form-control" name="warna" type="text" id="warna" value="{{ $peti->warna }}" |
||||||
|
placeholder="Masukan Warna Peti" required> |
||||||
|
|
||||||
|
<label for="customer_id" class="col-form-label">Customer:</label> |
||||||
|
<select class="form-control" name="customer_id" id="customer_id"> |
||||||
|
<option disabled selected>Pilih Warehouse</option> |
||||||
|
@foreach ($customer as $data_customer) |
||||||
|
<option value="{{ $data_customer->id }}" |
||||||
|
@if ($data_customer->id == $peti->customer_id) selected |
||||||
|
@else @endif> |
||||||
|
{{ $data_customer->name }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="warehouse_id" class="col-form-label">Warehouse:</label> |
||||||
|
<select class="form-control" name="warehouse_id" id="warehouse_id"> |
||||||
|
<option disabled selected>Pilih Warehouse</option> |
||||||
|
@foreach ($warehouse as $data_warehouse) |
||||||
|
<option value="{{ $data_warehouse->id }}" |
||||||
|
@if ($data_warehouse->id == $peti->warehouse_id) selected |
||||||
|
@else @endif> |
||||||
|
{{ $data_warehouse->name }}</option> |
||||||
|
@endforeach |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="status_disposal" class="col-form-label">Status Peti:</label> |
||||||
|
<input class="form-control" name="status_disposal" type="text" id="status_disposal" |
||||||
|
value="{{ $peti->status_disposal }}" placeholder="Masukan status Peti"> |
||||||
|
|
||||||
|
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label> |
||||||
|
<input class="form-control" name="date_pembuatan" type="date" id="date_pembuatan" |
||||||
|
value="{{ $peti->date_pembuatan }}" required> |
||||||
|
|
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,92 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<style> |
||||||
|
.table th { |
||||||
|
white-space: nowrap; |
||||||
|
} |
||||||
|
|
||||||
|
.table td { |
||||||
|
white-space: nowrap; |
||||||
|
} |
||||||
|
</style> |
||||||
|
|
||||||
|
<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 Peti</h5> |
||||||
|
</div> |
||||||
|
<div class="col-6 text-right"> |
||||||
|
<a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split"> |
||||||
|
<span class="text">Tambah Peti</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: 10px">No</th> |
||||||
|
<th>User</th> |
||||||
|
<th>Customer</th> |
||||||
|
<th>WH</th> |
||||||
|
<th>Kode Customer</th> |
||||||
|
<th>Tipe Peti</th> |
||||||
|
<th>Ukuran Peti</th> |
||||||
|
<th>Lot No</th> |
||||||
|
<th>Status Peti</th> |
||||||
|
<th>Packing No</th> |
||||||
|
<th>QR Code</th> |
||||||
|
<th class="text-center">Action</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
@php |
||||||
|
$nopeti = 1; |
||||||
|
@endphp |
||||||
|
@forelse ($peti as $data_peti) |
||||||
|
<tr> |
||||||
|
<td class="text-center">{{ $nopeti++ }}</td> |
||||||
|
<td>{{ $data_peti->created_by }}</td> |
||||||
|
<td>{{ $data_peti->customer->name }}</td> |
||||||
|
<td>{{ $data_peti->warehouse->name }}</td> |
||||||
|
<td>{{ $data_peti->customer->code_customer }}</td> |
||||||
|
<td>{{ $data_peti->tipe_peti->type }}</td> |
||||||
|
<td>{{ $data_peti->tipe_peti->size_peti }}</td> |
||||||
|
<td>{{ $data_peti->customer->lot_no }}</td> |
||||||
|
<td>{{ $data_peti->status_disposal }}</td> |
||||||
|
<td class="text-right">{{ $data_peti->packing_no }}</td> |
||||||
|
<td>{{ $data_peti->fix_lot }}</td> |
||||||
|
{{-- <td class="text-center"> |
||||||
|
{!! QrCode::size(80)->generate(route('dashboard.peti.show', $data_peti->id)) !!} |
||||||
|
</td> --}} |
||||||
|
<td class="text-center"> |
||||||
|
<a href="{{ route('dashboard.peti.show', [$data_peti->id]) }}"> |
||||||
|
<i class="fa fa-eye mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<a href="{{ route('dashboard.peti.edit', [$data_peti->id]) }}"> |
||||||
|
<i class="fa fa-edit mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<form action="{{ route('dashboard.peti.destroy', $data_peti->id) }}" method="POST" |
||||||
|
style="display: inline;"> |
||||||
|
@csrf |
||||||
|
@method('DELETE') |
||||||
|
<button type="submit" |
||||||
|
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')" |
||||||
|
style="border: none; background: none; cursor: pointer;"> |
||||||
|
<i class="fa fa-trash text-danger" style="font-size: 20px"></i> |
||||||
|
</button> |
||||||
|
</form> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
@empty |
||||||
|
<p>Data Kosong</p> |
||||||
|
@endforelse |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,69 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Tambah Tipe Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="tipe_peti_id" class="col-form-label">Tipe Peti:</label> |
||||||
|
<input class="form-control" value="{{ $peti->tipe_peti->type }}" readonly> |
||||||
|
|
||||||
|
<label for="warna" class="col-form-label">Warna Peti:</label> |
||||||
|
<input class="form-control" value="{{ $peti->warna }}" readonly> |
||||||
|
|
||||||
|
<label for="customer_id" class="col-form-label">Customer:</label> |
||||||
|
<input class="form-control" value="{{ $peti->customer->name }}" readonly> |
||||||
|
|
||||||
|
<label for="warehouse_id" class="col-form-label">Warehouse:</label> |
||||||
|
<input class="form-control" value="{{ $peti->warehouse->name }}" readonly> |
||||||
|
|
||||||
|
<label for="status_disposal" class="col-form-label">Status Peti:</label> |
||||||
|
<input class="form-control" value="{{ $peti->status_disposal }}" readonly> |
||||||
|
|
||||||
|
<label for="jumlah" class="col-form-label">Jumlah Peti:</label> |
||||||
|
<input class="form-control" value="{{ $peti->jumlah }}" readonly> |
||||||
|
|
||||||
|
<label for="date_pembuatan" class="col-form-label">Tanggal Pembuatan Peti:</label> |
||||||
|
<input class="form-control" value="{{ \Carbon\Carbon::parse($peti->date_pembuatan)->format('d/m/Y') }}" |
||||||
|
readonly> |
||||||
|
|
||||||
|
<label for="fix_lot" class="col-form-label">QR Code:</label> |
||||||
|
<div> |
||||||
|
{!! QrCode::size(75)->generate( |
||||||
|
'Nama Customer : ' . |
||||||
|
$peti->customer->name . |
||||||
|
"\n" . |
||||||
|
'Code Customer : ' . |
||||||
|
$peti->customer->code_customer . |
||||||
|
"\n" . |
||||||
|
'Type Peti : ' . |
||||||
|
$peti->tipe_peti->type . |
||||||
|
"\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, |
||||||
|
) !!} |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,33 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Tambah Tipe Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.typepeti.store') }}" method="POST" enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
<div class="form-group"> |
||||||
|
<label for="type" class="col-form-label">Tipe Peti:</label> |
||||||
|
<input class="form-control" name="type" type="text" id="type" value="{{ old('type') }}" |
||||||
|
placeholder="Masukan Tipe Peti" required> |
||||||
|
|
||||||
|
<label for="size_peti" class="col-form-label">Ukuran Peti:</label> |
||||||
|
<input class="form-control" name="size_peti" type="text" id="size_peti" |
||||||
|
value="{{ old('size_peti') }}" placeholder="Masukan Ukuran Peti" required> |
||||||
|
|
||||||
|
<label for="description" class="col-form-label">Deskripsi Peti:</label> |
||||||
|
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Peti" required></textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,35 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Tambah Tipe Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<form action="{{ route('dashboard.typepeti.update', [$typepeti->id]) }}" method="POST" |
||||||
|
enctype="multipart/form-data"> |
||||||
|
@csrf |
||||||
|
@method('PUT') |
||||||
|
<div class="form-group"> |
||||||
|
<label for="type" class="col-form-label">Tipe Peti:</label> |
||||||
|
<input class="form-control" name="type" type="text" id="type" value="{{ $typepeti->type }}" |
||||||
|
placeholder="Masukan Tipe Peti" required> |
||||||
|
|
||||||
|
<label for="size_peti" class="col-form-label">Ukuran Peti:</label> |
||||||
|
<input class="form-control" name="size_peti" type="text" id="size_peti" |
||||||
|
value="{{ $typepeti->size_peti }}" placeholder="Masukan Ukuran Peti" required> |
||||||
|
|
||||||
|
<label for="description" class="col-form-label">Deskripsi Peti:</label> |
||||||
|
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Peti" required>{{ $typepeti->description }}</textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
<button type="submit" class="btn btn-primary">Simpan</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,65 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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 Tipe Peti</h5> |
||||||
|
</div> |
||||||
|
<div class="col-6 text-right"> |
||||||
|
<a href="{{ route('dashboard.typepeti.create') }}" class="btn btn-success btn-icon-split"> |
||||||
|
<span class="text">Tambah Tipe Peti</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: 20px">No</th> |
||||||
|
<th>Tipe Peti</th> |
||||||
|
<th>Ukuran Peti</th> |
||||||
|
<th>Deskripsi Peti</th> |
||||||
|
<th class="text-center">Action</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
@php |
||||||
|
$notype = 1; |
||||||
|
@endphp |
||||||
|
@forelse ($typepeti as $data_typepeti) |
||||||
|
<tr> |
||||||
|
<td class="text-center">{{ $notype++ }}</td> |
||||||
|
<td>{{ $data_typepeti->type }}</td> |
||||||
|
<td>{{ $data_typepeti->size_peti }}</td> |
||||||
|
<td>{{ $data_typepeti->description }}</td> |
||||||
|
<td class="text-center"> |
||||||
|
<a href="{{ route('dashboard.typepeti.show', [$data_typepeti->id]) }}"> |
||||||
|
<i class="fa fa-eye mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<a href="{{ route('dashboard.typepeti.edit', [$data_typepeti->id]) }}"> |
||||||
|
<i class="fa fa-edit mr-2" style="font-size: 20px"></i> |
||||||
|
</a> |
||||||
|
<form action="{{ route('dashboard.typepeti.destroy', $data_typepeti->id) }}" |
||||||
|
method="POST" style="display: inline;"> |
||||||
|
@csrf |
||||||
|
@method('DELETE') |
||||||
|
<button type="submit" |
||||||
|
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')" |
||||||
|
style="border: none; background: none; cursor: pointer;"> |
||||||
|
<i class="fa fa-trash text-danger" style="font-size: 20px"></i> |
||||||
|
</button> |
||||||
|
</form> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
@empty |
||||||
|
<p>Data Kosong</p> |
||||||
|
@endforelse |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
@ -0,0 +1,29 @@ |
|||||||
|
@extends('layouts.main') |
||||||
|
@section('content') |
||||||
|
<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">Detail Tipe Peti</h5> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="type" class="col-form-label">Tipe Peti:</label> |
||||||
|
<input class="form-control" name="type" type="text" id="type" |
||||||
|
value="{{ $typepeti->type }}"readonly> |
||||||
|
|
||||||
|
<label for="size_peti" class="col-form-label">Ukuran Peti:</label> |
||||||
|
<input class="form-control" name="size_peti" type="text" id="size_peti" |
||||||
|
value="{{ $typepeti->size_peti }}" readonly> |
||||||
|
|
||||||
|
<label for="description" class="col-form-label">Deskripsi Peti:</label> |
||||||
|
<textarea class="form-control" name="description" id="description" readonly>{{ $typepeti->description }}</textarea> |
||||||
|
</div> |
||||||
|
<div class="modal-footer d-flex justify-content-center"> |
||||||
|
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
@endsection |
Loading…
Reference in new issue