Auto: Agginto view dettagli auto
This commit is contained in:
parent
ccf83e439e
commit
b3426ca311
@ -52,10 +52,19 @@ class AutoController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function delAuto(Request $id)
|
||||
{
|
||||
DB::table('autos')->delete($id['id']);
|
||||
return redirect(route('auto_list'));
|
||||
}
|
||||
|
||||
public function getAutoDetails(request $id)
|
||||
{
|
||||
|
||||
// Ritorna i dettagli dell'auto
|
||||
$dettagli=DB::table('autos')->find($id['id']);
|
||||
return view('auto.detail',[
|
||||
'dettagli' => $dettagli,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getTCOAuto(request $id)
|
||||
|
71
resources/views/auto/detail.blade.php
Normal file
71
resources/views/auto/detail.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
@extends('admin')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">Dettaglio Automobili</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<!-- Content here -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Dettaglio auto {{ $dettagli->targa }}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered table-hover" id="automobili">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Marca</th>
|
||||
<th>Modello</th>
|
||||
<th>Targa</th>
|
||||
<th>Alimentazione</th>
|
||||
<th>Cilindrata</th>
|
||||
<th>Cavalli Fisc.</th>
|
||||
<th>Num.Telaio</th>
|
||||
<th>Num. Motore</th>
|
||||
<th>Data acquisto</th>
|
||||
<th>Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>{{ $dettagli->marca; }}</td>
|
||||
<td>{{ $dettagli->modello; }}</td>
|
||||
<td>{{ $dettagli->targa; }}</td>
|
||||
<td>{{ $dettagli->alimentazione; }}</td>
|
||||
<td>{{ $dettagli->cilindrata; }}</td>
|
||||
<td>{{ $dettagli->cvfiscali; }}</td>
|
||||
<td>{{ $dettagli->ntelaio; }}</td>
|
||||
<td>{{ $dettagli->nmotore; }}</td>
|
||||
<td>{{ $dettagli->data_acquisto; }}</td>
|
||||
<td>{{ $dettagli->note; }}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.col-lg-12 -->
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#automobili').DataTable({
|
||||
responsive: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
@ -32,8 +32,8 @@
|
||||
<td>{{ $automobile->modello; }}</td>
|
||||
<td>{{ $automobile->targa; }}</td>
|
||||
<td>
|
||||
<a class="btn btn-primary" href="/auto/modify?id={{ $automobile->id; }}"><i class="fa fa-pencil-square-o fw"></i></a>
|
||||
<a class="btn btn-danger" href="/auto/delete?id={{ $automobile->id; }}"><i class="fa fa-trash-o fa-fw"></i></a>
|
||||
<a class="btn btn-primary" href="auto/modify?id={{ $automobile->id; }}"><i class="fa fa-pencil-square-o fw"></i></a>
|
||||
<a class="btn btn-danger" href="auto/delete?id={{ $automobile->id; }}"><i class="fa fa-trash-o fa-fw"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
@ -67,6 +67,8 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
Route::get('auto', [AutoController::class, 'index'])->name('auto_list');
|
||||
Route::get('auto/new', [AutoController::class, 'newAuto'])->name('auto_new');
|
||||
Route::post('auto/new', [AutoController::class, 'saveAuto'])->name('auto_save');
|
||||
Route::get('auto/delete', [AutoController::class, 'delAuto']);
|
||||
Route::get('auto/detail', [AutoController::class, 'getAutoDetails']);
|
||||
|
||||
/// TEST routes
|
||||
Route::get('fullcalender', [FullCalenderController::class, 'index']);
|
||||
|
Loading…
Reference in New Issue
Block a user