TP6 et avant

This commit is contained in:
2026-10-07 16:34:12 +02:00
parent bb4ee689a1
commit e00d488df7
89 changed files with 11733 additions and 0 deletions
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Tableau des clients</title>
</head>
<body>
<h1>Tableau des clients</h1>
<table border="1" >
<thead>
<tr>
<th>Nom</th>
<th>Mail</th>
<th>Ville</th>
</tr>
</thead>
<tbody>
@foreach($clients as $clients)
<tr>
<td>{{$clients['name'] }}</td>
<td>{{ $clients['email'] }}</td>
<td>{{ $clients['city'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>
@@ -0,0 +1,26 @@
@extends('layouts.app')
@section('content')
<h2>Ajouter un client</h2>
<form method="POST" action="{{ route('clients.store') }}">
@csrf
<label>Nom</label>
<input type="text" name="name" value="{{ old('name') }}">
@error('name')
<div>{{ $message }}</div>
@enderror
<label>Email</label>
<input type="email" name="email" value="{{ old('email') }}">
@error('email')
<div>{{ $message }}</div>
@enderror
<label>Ville</label>
<input type="text" name="city" value="{{ old('city') }}">
@error('city')
<div>{{ $message }}</div>
@enderror
<button type="submit">
Enregistrer
</button>
</form>
@endsection
@@ -0,0 +1,26 @@
@extends('layouts.app')
@section('content')
<h2>Modifier un client</h2>
<form method="POST" action="{{ route('clients.update', $client) }}">
@csrf
@method('PUT')
<label>Nom</label>
<input type="text" name="name" value="{{ $client->name }}">
@error('name')
<div>{{ $message }}</div>
@enderror
<label>Email</label>
<input type="email" name="email" value="{{ $client->email }}">
@error('email')
<div>{{ $message }}</div>
@enderror
<label>Ville</label>
<input type="text" name="city" value="{{ $client->city }}">
@error('city')
<div>{{ $message }}</div>
@enderror
<button type="submit">
Enregistrer
</button>
</form>
@endsection
@@ -0,0 +1,41 @@
@extends('layouts.app')
@section('content')
<h2>Liste des clients</h2>
<a href="{{ route('clients.create') }}">
Ajouter un client
</a> <form method="GET" action="{{ route('clients.index') }}">
<input
type="text"
name="search"
placeholder="Rechercher un client"
value="{{ $search }}"
>
<button type="submit">
Rechercher
</button>
</form>
<p>Nombre de clients : {{$clients->count()}}</p>
@foreach($clients as $client)
<p>
{{ $client->name }}
-
{{ $client->email }}
-
{{ $client->city }} <a href="{{ route('clients.show', $client) }}">
Voir
</a>
| <a href="{{ route('clients.edit', $client) }}">Modifier</a>
| <form method="POST"
action="{{ route('clients.destroy', $client) }}">
@csrf
@method('DELETE')
<button type="submit">
Supprimer
</button>
</form>
<p>Client créé le : {{$client->created_at}}</p>
</p>
@endforeach
{{ $clients->links() }}
@endsection
@@ -0,0 +1,9 @@
@extends('layouts.app')
@section('content')
<h2>{{ $client->name }}</h2>
<p>Email : {{ $client->email }}</p>
<p>Ville : {{ $client->city }}</p>
<a href="{{ route('clients.index') }}">
Retour
</a>
@endsection
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Mini-CRM</title>
</head>
<body>
@extends('layouts.app')
@section('content')
<h1>Contact</h1>
<p>Email : {{ $email }}</p>
<p>Téléphone : {{ $phone}}</p>
@endsection
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Mini-CRM</title>
</head>
<body>
<h1>Bienvenue dans votre espace de gestion.</h1>
<p>Notre application permet de gérer
les clients, les produits et les commandes.</p>
<p>{{ $company }}</p>
<p>Commandes = {{ $orders }}</p>
<h1>Bonjour {{ $name }}</h1>
<h1> {{ $city }}</h1>
<h1>{{ $company }}</h1>
@if($stock < 5)
<p>Stock faible.</p>
@else
<p>Stock disponible.</p>
@endif
@foreach($clients as $client)
<p>{{ $client }}</p>
@endforeach
<ul>
@foreach($products as $products)
<li>{{ $products }}</li>
@endforeach
</ul>
@extends('layouts.app')
@section('content')
<h2>Tableau de bord</h2>
<p>Bienvenue dans votre espace de gestion.</p>
@endsection
</body>
</html>
+35
View File
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Mini-CRM</title>
</head>
<body>
@extends('layouts.app')
@section('content')
<table border="1" >
<thead>
<tr>
<th>Produit</th>
<th>Prix</th>
<th>Stock</th>
</tr>
</thead>
<tbody>
@foreach($products as $products)
<tr>
<td>{{$products['name'] }}</td>
<td>{{$products['price'] }}</td>
@if( $products['stock'] < 5)
<td>Stock faible.</td>
@else
<td>Disponible.</td>
@endif
</tr>
@endforeach
</tbody>
</table>
@endsection
</body>
</html>
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Mini-CRM</title>
</head>
<body>
<header>
<h1>Mini-CRM</h1>
<nav>
<a href="/">Accueil</a>
<a href="/clients">Clients</a>
<a href="/products">Produits</a>
<a href="/contact">Contact</a>
</nav>
</header>
<main>
@yield('content')
</main>
<footer>
Mini-CRM
</footer>
</body>
</html>
@@ -0,0 +1,25 @@
@extends('layouts.app')
@section('content')
<h2>Ajouter un produit</h2>
<form method="POST" action="{{ route('products.store') }}">
@csrf
<label>Nom</label>
<input type="text" name="name" value="{{ old('name') }}">
@error('name')
<div>{{ $message }}</div>
@enderror
<label>Prix</label>
<input type="number" name="price" value="{{ old('price') }}">
@error('price')
<div>{{ $message }}</div>
@enderror
<label>Stock</label>
<input type="number" name="stock" value="{{ old('price') }}">
@error('stock')
<div>{{ $message }}</div>
@enderror
<button type="submit">
Enregistrer
</button>
</form>
@endsection
@@ -0,0 +1,26 @@
@extends('layouts.app')
@section('content')
<h2>Modifier un produit</h2>
<form method="POST" action="{{ route('products.update', $product) }}">
@csrf
@method('PUT')
<label>Nom</label>
<input type="text" name="name" value="{{ $product->name }}">
@error('name')
<div>{{ $message }}</div>
@enderror
<label>Prix</label>
<input type="number" name="price" value="{{ $product->price }}">
@error('price')
<div>{{ $message }}</div>
@enderror
<label>Stock</label>
<input type="number" name="stock" value="{{ $product->stock }}">
@error('stock')
<div>{{ $message }}</div>
@enderror
<button type="submit">
Enregistrer
</button>
</form>
@endsection
@@ -0,0 +1,41 @@
@extends('layouts.app')
@section('content')
<h2>Liste des products</h2>
<a href="{{ route('products.create') }}">
Ajouter un produit
</a><form method="GET" action="{{ route('products.index') }}">
<input
type="text"
name="search"
placeholder="Rechercher un produit"
value="{{ $search }}"
>
<button type="submit">
Rechercher
</button>
</form>
<p>Nombre de produit: {{$products->count()}}</p>
@foreach($products as $product)
<p>
{{ $product->name }}
-
{{ $product->price }} $
-
{{ $product->stock }}
<a href="{{ route('products.show', $product) }}">
Voir
</a>
| <a href="{{ route('products.edit', $product) }}">Modifier</a>
| <form method="POST"
action="{{ route('products.destroy', $product) }}">
@csrf
@method('DELETE')
<button type="submit">
Supprimer
</button>
</form>
</p>
</p>
@endforeach
@endsection
@@ -0,0 +1,9 @@
@extends('layouts.app')
@section('content')
<h2>{{ $product->name }}</h2>
<p>Prix : {{ $product->price }}</p>
<p>Stock : {{ $product->stock }}</p>
<a href="{{ route('products.index') }}">
Retour
</a>
@endsection
File diff suppressed because one or more lines are too long