Lavorazioni su Automobili (inserimento e visualizzazione
This commit is contained in:
parent
6b71f88ccf
commit
b495bc2316
@ -2,13 +2,64 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
||||||
class AutoController extends Controller
|
class AutoController extends Controller
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
public function index()
|
public static function index()
|
||||||
{
|
{
|
||||||
// lista le auto inserite nel gestionale
|
// lista le auto inserite nel gestionale
|
||||||
|
$lista=DB::table('autos')->select(['targa','marca','modello','id'])->get();
|
||||||
|
// dd($lista); // debug
|
||||||
|
return view('auto.list',['title'=>'Automobile', 'automobili'=>$lista]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newAuto()
|
||||||
|
{
|
||||||
|
// mostra il form di inserimento di una nuova Auto
|
||||||
|
return view('auto.form',['title'=>'Form Automobile']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveAuto(Request $request)
|
||||||
|
{
|
||||||
|
// inserisce l'auto nel database e torna alla lista
|
||||||
|
// dd($request);
|
||||||
|
|
||||||
|
DB::table('autos')->insert([
|
||||||
|
'targa'=>$request['targa'],
|
||||||
|
'marca'=>$request['marca'],
|
||||||
|
'modello'=>$request['modello'],
|
||||||
|
'cilindrata'=>$request['cilindrata'],
|
||||||
|
'cvfiscali'=>$request['cvfiscali'],
|
||||||
|
'alimentazione'=>$request['alimentazione'],
|
||||||
|
'ntelaio'=>$request['ntelaio'],
|
||||||
|
'nmotore'=>$request['nmotore'],
|
||||||
|
'data_acquisto'=>$request['data_acquisto'],
|
||||||
|
'note'=>$request['note'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($request['another']=='on')
|
||||||
|
{
|
||||||
|
route('auto_new');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
route('auto_list');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAutoDetails(request $id)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Ritorna i dettagli dell'auto
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTCOAuto(request $id)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
37
composer.lock
generated
37
composer.lock
generated
@ -1861,16 +1861,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
"version": "2.3.9",
|
"version": "2.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/commonmark.git",
|
"url": "https://github.com/thephpleague/commonmark.git",
|
||||||
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5"
|
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c1e114f74e518daca2729ea8c4bf1167038fa4b5",
|
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
|
||||||
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5",
|
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1906,7 +1906,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "2.4-dev"
|
"dev-main": "2.5-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1963,7 +1963,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-02-15T14:07:24+00:00"
|
"time": "2023-03-24T15:16:10+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/config",
|
"name": "league/config",
|
||||||
@ -3197,16 +3197,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psy/psysh",
|
"name": "psy/psysh",
|
||||||
"version": "v0.11.12",
|
"version": "v0.11.14",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/bobthecow/psysh.git",
|
"url": "https://github.com/bobthecow/psysh.git",
|
||||||
"reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7"
|
"reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/52cb7c47d403c31c0adc9bf7710fc355f93c20f7",
|
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/8c2e264def7a8263a68ef6f0b55ce90b77d41e17",
|
||||||
"reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7",
|
"reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -3267,9 +3267,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/bobthecow/psysh/issues",
|
"issues": "https://github.com/bobthecow/psysh/issues",
|
||||||
"source": "https://github.com/bobthecow/psysh/tree/v0.11.12"
|
"source": "https://github.com/bobthecow/psysh/tree/v0.11.14"
|
||||||
},
|
},
|
||||||
"time": "2023-01-29T21:24:40+00:00"
|
"time": "2023-03-28T03:41:01+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ralouphie/getallheaders",
|
"name": "ralouphie/getallheaders",
|
||||||
@ -7546,16 +7546,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "9.6.5",
|
"version": "9.6.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5"
|
"reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b65d59a059d3004a040c16a82e07bbdf6cfdd115",
|
||||||
"reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5",
|
"reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -7628,7 +7628,8 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5"
|
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||||
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.6"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -7644,7 +7645,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-09T06:34:10+00:00"
|
"time": "2023-03-27T11:43:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
|
1
public/css/app.css
vendored
1
public/css/app.css
vendored
@ -1,4 +1,5 @@
|
|||||||
@import url(https://fonts.googleapis.com/css?family=Nunito);
|
@import url(https://fonts.googleapis.com/css?family=Nunito);
|
||||||
|
|
||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap v5.1.3 (https://getbootstrap.com/)
|
* Bootstrap v5.1.3 (https://getbootstrap.com/)
|
||||||
|
1
public/css/startmin.css
vendored
1
public/css/startmin.css
vendored
@ -4,6 +4,7 @@
|
|||||||
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
|
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
2
public/pages/note.txt
Normal file
2
public/pages/note.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;600&display=swap');
|
||||||
|
font-family: 'Titillium Web', sans-serif;
|
63
resources/views/auto/form.blade.php
Normal file
63
resources/views/auto/form.blade.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
@extends('admin')
|
||||||
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">Inserisci Automobile</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
Lista delle automobili
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<!-- Form -->
|
||||||
|
<form action="" method="POST">
|
||||||
|
@csrf
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="marca" class="form-label">Marca</label>
|
||||||
|
<input type="text" class="form-control" id="marca" name="marca">
|
||||||
|
<label for="modello" class="form-label">Modello</label>
|
||||||
|
<input type="text" class="form-control" id="modello" name="modello">
|
||||||
|
<label for="targa" class="form-label">Targa</label>
|
||||||
|
<input type="text" class="form-control" id="targa" name="targa">
|
||||||
|
<label for="alimentazione" class="form-label">Alimentazione</label>
|
||||||
|
<input type="text" class="form-control" id="alimentazione" name="alimentazione">
|
||||||
|
<label for="cilindrata" class="form-label">Cilindrata</label>
|
||||||
|
<input type="text" class="form-control" id="cilindrata" name="cilindrata">
|
||||||
|
<label for="cvfiscali" class="form-label">Cavalli Fiscali</label>
|
||||||
|
<input type="text" class="form-control" id="cvfiscali" name="cvfiscali">
|
||||||
|
<label for="ntelaio" class="form-label">Num. Telaio</label>
|
||||||
|
<input type="text" class="form-control" id="ntelaio" name="ntelaio">
|
||||||
|
<label for="nmotore" class="form-label">Num. Motore</label>
|
||||||
|
<input type="text" class="form-control" id="nmotore" name="nmotore">
|
||||||
|
<label for="data_acquisto" class="form-label">Data di Acquisto</label>
|
||||||
|
<input type="text" class="form-control" id="data_acquisto" name="data_acquisto">
|
||||||
|
<label for="note" class="form-label">Note</label>
|
||||||
|
<input type="text" class="form-control" id="note" name="note">
|
||||||
|
<label for="another" class="form-label">Inserisci un altro</label>
|
||||||
|
<input type="checkbox" class="form-control" id="another" name="another">
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</form>
|
||||||
|
<!-- /Form -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- /.col-lg-12 -->
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('script')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#automobili').DataTable({
|
||||||
|
responsive: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
61
resources/views/auto/list.blade.php
Normal file
61
resources/views/auto/list.blade.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
@extends('admin')
|
||||||
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">Lista 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">
|
||||||
|
Lista delle automobili
|
||||||
|
</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>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($automobili ?? '' as $automobile)
|
||||||
|
<tr>
|
||||||
|
<td><a href="auto/detail?id={{ $automobile->id }}">{{ $automobile->marca; }}</a></td>
|
||||||
|
<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>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- /.col-lg-12 -->
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('script')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#automobili').DataTable({
|
||||||
|
responsive: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
37
resources/views/tmp/form.blade.php
Normal file
37
resources/views/tmp/form.blade.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
@extends('admin')
|
||||||
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">{{ $title }}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<!-- Content here -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
Segnaposto temporaneo per view {{ $title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<form action="" method="POST">
|
||||||
|
@csrf
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<label for="categoria" class="form-label">{{ $title }}</label>
|
||||||
|
<input type="text" class="form-control" id="categoria" name="cat_name">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
16
resources/views/tmp/test.blade.php
Normal file
16
resources/views/tmp/test.blade.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
@extends('admin')
|
||||||
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">{{ $title }}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<!-- Content here -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
Segnaposto temporaneo per view {{ $title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -9,7 +9,7 @@ use App\Http\Controllers\DocumentiController;
|
|||||||
use App\Http\Controllers\MovimentiController;
|
use App\Http\Controllers\MovimentiController;
|
||||||
use App\Http\Controllers\TagController;
|
use App\Http\Controllers\TagController;
|
||||||
use App\Http\Controllers\FullCalenderController;
|
use App\Http\Controllers\FullCalenderController;
|
||||||
|
use App\Http\Controllers\AutoController;
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Web Routes
|
| Web Routes
|
||||||
@ -65,6 +65,8 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
|||||||
|
|
||||||
# Automobili
|
# Automobili
|
||||||
Route::get('auto', [AutoController::class, 'index'])->name('auto_list');
|
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');
|
||||||
|
|
||||||
/// TEST routes
|
/// TEST routes
|
||||||
Route::get('fullcalender', [FullCalenderController::class, 'index']);
|
Route::get('fullcalender', [FullCalenderController::class, 'index']);
|
||||||
|
Loading…
Reference in New Issue
Block a user