Gunawan19621
1 year ago
11 changed files with 541 additions and 23 deletions
@ -0,0 +1,16 @@
|
||||
<?php |
||||
|
||||
namespace App\Http\Controllers; |
||||
|
||||
use Illuminate\Http\Request; |
||||
|
||||
class KondisiPetiController extends Controller |
||||
{ |
||||
public function index() |
||||
{ |
||||
$data = [ |
||||
'active' => 'menu-kondisipeti' |
||||
]; |
||||
return view('dashboard.Master_Data.Manajemen_Peti.Kondisi_Peti.index', $data); |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Kondisi_Peti extends Model |
||||
{ |
||||
use HasFactory; |
||||
} |
@ -0,0 +1,27 @@
|
||||
<?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('kondisi__petis', function (Blueprint $table) { |
||||
$table->id(); |
||||
$table->timestamps(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
*/ |
||||
public function down(): void |
||||
{ |
||||
Schema::dropIfExists('kondisi__petis'); |
||||
} |
||||
}; |
@ -0,0 +1,152 @@
|
||||
@extends('layouts.main') |
||||
@section('content') |
||||
@include('layouts.components.alert-prompt') |
||||
<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 Kondisi Peti</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 Kondisi 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>Kondisi Peti</th> |
||||
<th>Deskripsi</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> |
||||
|
||||
<!-- Tambah Data Modal--> |
||||
<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 Kondisi Peti</h5> |
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
||||
<span aria-hidden="true">×</span> |
||||
</button> |
||||
</div> |
||||
<div class="modal-body"> |
||||
<form action="{{ route('dashboard.kondisipeti.store') }}" method="POST" enctype="multipart/form-data" |
||||
id="inputanForm"> |
||||
@csrf |
||||
<div class="form-group"> |
||||
<div class="form-group"> |
||||
<label for="name" class="col-form-label">Kondisi Peti : <span |
||||
class="text-danger">*</span></label> |
||||
<input class="form-control" name="name" type="text" id="name" |
||||
value="{{ old('name') }}" placeholder="Masukan Kondisi Peti" pattern="[^0-9]+" |
||||
oninput="this.value=this.value.replace(/[0-9]/g,'');" |
||||
title="Hanya karakter selain huruf yang diperbolehkan" required> |
||||
|
||||
<label for="description" class="col-form-label">Deskripsi: <span |
||||
class="text-danger">*</span></label> |
||||
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Kondisi Peti" |
||||
required>{{ old('description') }}</textarea> |
||||
</div> |
||||
</div> |
||||
<div class="modal-footer"> |
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> |
||||
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Edit data Modal --> |
||||
{{-- @foreach ($role as $data) |
||||
<div class="modal fade" id="editDataModal{{ $data['id'] }}" 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">Edit Role</h5> |
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
||||
<span aria-hidden="true">×</span> |
||||
</button> |
||||
</div> |
||||
<div class="modal-body"> |
||||
<form action="{{ route('dashboard.role.update', $data->id) }}" method="POST" |
||||
enctype="multipart/form-data" id="inputanForm"> |
||||
@csrf |
||||
@method('PUT') |
||||
<div class="form-group"> |
||||
<label for="name" class="col-form-label">Nama Hak Akses: <span |
||||
class="text-danger">*</span></label> |
||||
<input class="form-control" name="name" type="text" id="name" |
||||
value="{{ $data->name }}" placeholder="Masukan Nama Hak Akses" pattern="[^0-9]+" |
||||
oninput="this.value=this.value.replace(/[0-9]/g,'');" |
||||
title="Hanya karakter selain huruf yang diperbolehkan" required> |
||||
|
||||
<label for="description" class="col-form-label">Deskripsi Hak Akses: <span |
||||
class="text-danger">*</span></label> |
||||
<textarea class="form-control" name="description" id="description" placeholder="Masukkan Deskripsi Hak Akses" |
||||
required>{{ $data->description }}</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" id="submitButton">Simpan</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
@endforeach --}} |
||||
|
||||
<script> |
||||
document.getElementById('inputanForm').addEventListener('submit', function() { |
||||
document.getElementById('submitButton').setAttribute('disabled', 'true'); |
||||
}); |
||||
</script> |
||||
@endsection |
Loading…
Reference in new issue