Skip to content

Commit

Permalink
tampilan home
Browse files Browse the repository at this point in the history
  • Loading branch information
KStarID committed Mar 29, 2024
1 parent cfd8d62 commit cd18389
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(Database $database)
{
$this->middleware('auth');
$this->database = $database;
$this->tablename = 'data';
$this->tablename = 'cars';
}

/**
Expand Down
8 changes: 5 additions & 3 deletions resources/views/adminpage/cars.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</tr>
</thead>
<tbody>
@if($reference)
@if ($reference)
@forelse($reference as $key => $item)
<tr>
@if ($item['email_penjual'] == $email_penjual)
Expand All @@ -134,10 +134,12 @@
<td>{{ $item['deskripsi'] }}</td>
<td>{{ $item['kontak_penjual'] }}</td>
<td>
<a href="{{ url('/home/cars/edit_cars/' . $key) }}" class="btn btn-sm btn-success">Edit</a>
<a href="{{ url('/home/cars/edit_cars/' . $key) }}"
class="btn btn-sm btn-success">Edit</a>
</td>
<td>
<form action="{{ route('delete_cars', ['id' => $key]) }}" method="post"
<form action="{{ route('delete_cars', ['id' => $key]) }}"
method="post"
onsubmit="return confirm('Apakah Anda yakin ingin menghapus data ini?')">
@csrf
@method('delete')
Expand Down
32 changes: 21 additions & 11 deletions resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,35 @@
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Category</th>
<th>Description</th>
<th>Author</th>
<th>Merk</th>
<th>Model</th>
<th>Tahun Pembuatan</th>
<th>Kondisi</th>
<th>Bahan Bakar</th>
<th>Warna</th>
<th>Harga</th>
<th>Deskripsi</th>
<th>Kontak Penjual</th>
<th>Email Penjual</th>
</tr>
</thead>
<tbody>
@forelse($reference as $key => $item)
<tr>
<td> {{ $key }} </td>
<td> {{ $item['title'] }} </td>
<td> {{ $item['category'] }} </td>
<td> {{ $item['description'] }} </td>
<td> {{ $item['author'] }} </td>
<td>{{ $item['merk'] }}</td>
<td>{{ $item['model'] }}</td>
<td>{{ $item['tahun_pembuatan'] }}</td>
<td>{{ $item['kondisi'] }}</td>
<td>{{ $item['bahan_bakar'] }}</td>
<td>{{ $item['warna'] }}</td>
<td>{{ $item['harga'] }}</td>
<td>{{ $item['deskripsi'] }}</td>
<td>{{ $item['kontak_penjual'] }}</td>
<td> {{ $item['email_penjual'] }} </td>
</tr>
@empty
<tr>
<td colspan="7">No Record Found</td>
<td colspan="10">No Record Found</td>
</tr>
@endforelse
</tbody>
Expand Down
5 changes: 0 additions & 5 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
})->name('dashboard');

Route::get('/home/cars', [App\Http\Controllers\Firebase\CarsController::class, 'index'])->name('cars');

Route::get('/home/cars/add_cars', function () {
return view('adminpage\add_cars');
})->name('add_cars');

Route::get('/home/cars/view_cars', [App\Http\Controllers\Firebase\CarsController::class, 'index'])->name('view_cars');
Route::post('/home/cars/add_cars', [App\Http\Controllers\Firebase\CarsController::class, 'store'])->name('add_cars');

Expand Down

0 comments on commit cd18389

Please sign in to comment.