Skip to content

Commit

Permalink
error add_cars
Browse files Browse the repository at this point in the history
  • Loading branch information
KStarID committed Mar 30, 2024
1 parent cd18389 commit 2a0defe
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 28 deletions.
70 changes: 57 additions & 13 deletions resources/views/adminpage/add_cars.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,54 +75,100 @@ function confirmSubmission() {
<div class="col-md-6">
<div class="form-group">
{!! Form::label('merk', 'Merk:') !!}
{!! Form::text('merk', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex: Toyota']) !!}
{!! Form::text('merk', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex: Toyota',
]) !!}
</div>

<div class="form-group">
{!! Form::label('model', 'Model:') !!}
{!! Form::text('model', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex: Avanza Veloz']) !!}
{!! Form::text('model', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex: Avanza Veloz',
]) !!}
</div>

<div class="form-group">
{!! Form::label('tahun_pembuatan', 'Tahun Pembuatan:') !!}
{!! Form::number('tahun_pembuatan', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex: 2020']) !!}
{!! Form::number('tahun_pembuatan', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex: 2020',
]) !!}
</div>

<div class="form-group">
{!! Form::label('kondisi', 'Kondisi:') !!}
{!! Form::select('kondisi', ['Baru' => 'Baru', 'Bekas' => 'Bekas'], null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'Baru/Bekas']) !!}
{!! Form::select('kondisi', ['Baru' => 'Baru', 'Bekas' => 'Bekas'], null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'Baru/Bekas',
]) !!}
</div>

<div class="form-group">
{!! Form::label('bahan_bakar', 'Bahan Bakar:') !!}
{!! Form::select('bahan_bakar', ['Bensin (Gasoline)' => 'Bensin (Gasoline)', 'Solar (Diesel)' => 'Solar (Diesel)', 'Gas alam kendaraan (CNG)' => 'Gas alam kendaraan (CNG)', 'Listrik (Electricity)' => 'Listrik (Electricity)'], null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'Bensin/Solar/CNG/Listrik']) !!}
{!! Form::select(
'bahan_bakar',
[
'Bensin (Gasoline)' => 'Bensin (Gasoline)',
'Solar (Diesel)' => 'Solar (Diesel)',
'Gas alam kendaraan (CNG)' => 'Gas alam kendaraan (CNG)',
'Listrik (Electricity)' => 'Listrik (Electricity)',
],
null,
['class' => 'form-control', 'required' => 'required', 'placeholder' => 'Bensin/Solar/CNG/Listrik'],
) !!}
</div>
</div>

<div class="col-md-6">
<div class="form-group">
{!! Form::label('transmisi', 'Transmisi:') !!}
{!! Form::select('transmisi', ['Matic' => 'Matic', 'Manual' => 'Manual'], null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'Manual/Matic']) !!}
{!! Form::select('transmisi', ['Matic' => 'Matic', 'Manual' => 'Manual'], null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'Manual/Matic',
]) !!}
</div>

<div class="form-group">
{!! Form::label('warna', 'Warna:') !!}
{!! Form::text('warna', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex : Merah']) !!}
{!! Form::text('warna', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex : Merah',
]) !!}
</div>

<div class="form-group">
{!! Form::label('harga', 'Harga:') !!}
{!! Form::number('harga', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex: 50.000.000']) !!}
{!! Form::text('harga', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex: 50.000.000',
]) !!}
</div>

<div class="form-group">
{!! Form::label('deskripsi', 'Deskripsi Tambahan (Jika tidak, isi "-" saja): ') !!}
{!! Form::text('deskripsi', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex: km 10.000 dan warna sedikit luntur']) !!}
{!! Form::text('deskripsi', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex: km 10.000 dan warna sedikit luntur',
]) !!}
</div>

<div class="form-group">
{!! Form::label('kontak_penjual', 'Kontak Penjual (WA):') !!}
{!! Form::text('kontak_penjual', null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'ex : 08xxxxxxx']) !!}
{!! Form::text('kontak_penjual', null, [
'class' => 'form-control',
'required' => 'required',
'placeholder' => 'ex : 08xxxxxxx',
]) !!}
</div>
</div>
</div>
Expand All @@ -146,6 +192,4 @@ function confirmSubmission() {
});
</script>
</div>


@endsection
@endsection
16 changes: 6 additions & 10 deletions resources/views/adminpage/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ class="form-control" required>

<div class="form-group">
<label for="bahan_bakar">Bahan Bakar:</label>
<input type="text" name="bahan_bakar" value="{{ $editdata['bahan_bakar'] }}" class="form-control"
required>
<input type="text" name="bahan_bakar" value="{{ $editdata['bahan_bakar'] }}"
class="form-control" required>
</div>
</div>

<div class="col-md-6">

<div class="form-group">
<label for="transmisi">Transmisi:</label>
<input type="text" name="transmisi" value="{{ $editdata['transmisi'] }}" class="form-control"
required>
<input type="text" name="transmisi" value="{{ $editdata['transmisi'] }}"
class="form-control" required>
</div>

<div class="form-group">
Expand All @@ -127,8 +127,8 @@ class="form-control" required>

<div class="form-group">
<label for="deskripsi">Deskripsi Tambahan (Jika tidak, isi "-" saja):</label>
<input type="text" name="deskripsi" value="{{ $editdata['deskripsi'] }}" class="form-control"
required>
<input type="text" name="deskripsi" value="{{ $editdata['deskripsi'] }}"
class="form-control" required>
</div>

<div class="form-group">
Expand All @@ -143,10 +143,6 @@ class="form-control" required>
<button type="submit" class="btn btn-primary btn-lg" onclick="return confirmSubmission()">Update
Cars</button>
</div>

<div class="form-group text-center">
<button type="reset" class="btn btn-secondary btn-lg">Reset</button>
</div>
</form>

</div>
Expand Down
8 changes: 3 additions & 5 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@
Route::resource('/home/admin', App\Http\Controllers\Auth\AdminController::class)->middleware(['user', 'fireauth']);

Route::middleware(['auth', 'fireauth'])->group(function () {
Route::get('/home/dashboard', function () {
return view('adminpage.dashboard');
})->name('dashboard');

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

Route::delete('/home/cars/delete_cars/{id}', [App\Http\Controllers\Firebase\CarsController::class, 'delete_cars'])->name('delete_cars');
Expand Down

0 comments on commit 2a0defe

Please sign in to comment.