la derniere goute de pluie d'eau froide

This commit is contained in:
bourgoino 2024-12-06 08:06:44 +01:00
parent f7c08a5c98
commit a0e50bf187
6 changed files with 178 additions and 77 deletions

View File

@ -62,7 +62,7 @@ class Company
return $this; return $this;
} }
public function getAddress(): ?stringz public function getAddress(): ?string
{ {
return $this->address; return $this->address;
} }

View File

@ -1,13 +1,55 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Edit Company{% endblock %} {% block title %}Modifier l'entreprise{% endblock %}
{% block body %} {% block body %}
<h1>Edit Company</h1> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Modifier l'entreprise</h1>
{{ include('company/_form.html.twig', {'button_label': 'Update'}) }} <div class="bg-white shadow-md rounded-lg p-6">
{{ form_start(form) }}
<a href="{{ path('app_company_index') }}">back to list</a> <div class="mb-4">
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
<div class="mt-1">
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
{{ include('company/_delete_form.html.twig') }} <div class="mb-4">
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse</label>
<div class="mt-1">
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mb-4">
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Téléphone</label>
<div class="mt-1">
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mb-4">
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email</label>
<div class="mt-1">
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mt-6">
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
Mettre à jour l'entreprise
</button>
</div>
{{ form_end(form) }}
</div>
<div class="mt-6">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -1,41 +1,50 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Company index{% endblock %} {% block title %}Liste des Entreprises{% endblock %}
{% block body %} {% block body %}
<h1>Company index</h1> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Entreprises</h1>
<table class="table"> <div class="overflow-x-auto bg-white shadow-lg rounded-lg">
<thead> <table class="min-w-full table-auto">
<tr> <thead>
<th>Id</th> <tr class="bg-gray-800 text-white">
<th>Name</th> <th class="px-4 py-2 text-left">ID</th>
<th>Address</th> <th class="px-4 py-2 text-left">Nom de l'entreprise</th>
<th>Tel</th> <th class="px-4 py-2 text-left">Actions</th>
<th>Mail</th> </tr>
<th>actions</th> </thead>
</tr> <tbody>
</thead> {% for company in companies %}
<tbody> <tr class="border-b">
{% for company in companies %} <td class="px-4 py-2">{{ company.id }}</td>
<tr> <td class="px-4 py-2">{{ company.name }}</td>
<td>{{ company.id }}</td> <td class="px-4 py-2 flex items-center gap-4">
<td>{{ company.name }}</td> <a href="{{ path('app_company_show', {'id': company.id}) }}" class="text-teal-500 hover:text-teal-700">
<td>{{ company.address }}</td> <i class="fas fa-eye"></i> Voir
<td>{{ company.tel }}</td> </a>
<td>{{ company.mail }}</td> <a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
<td> <i class="fas fa-edit"></i> Modifier
<a href="{{ path('app_company_show', {'id': company.id}) }}">show</a> </a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a> <form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
</td> <input type="hidden" name="_method" value="DELETE">
</tr> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
{% else %} <button type="submit" class="text-red-500 hover:text-red-700">
<tr> <i class="fas fa-trash-alt"></i> Supprimer
<td colspan="6">no records found</td> </button>
</tr> </form>
{% endfor %} </td>
</tbody> </tr>
</table> {% endfor %}
</tbody>
</table>
</div>
<a href="{{ path('app_company_new') }}">Create new</a> <div class="mt-4">
<a href="{{ path('app_company_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
<i class="fas fa-plus-circle"></i> Ajouter une nouvelle entreprise
</a>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -1,11 +1,47 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}New Company{% endblock %} {% block title %}Nouvelle Entreprise{% endblock %}
{% block body %} {% block body %}
<h1>Create new Company</h1> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-6">Créer une nouvelle entreprise</h1>
{{ include('company/_form.html.twig') }} <div class="bg-white shadow-md rounded-lg p-6">
{{ form_start(form) }}
<a href="{{ path('app_company_index') }}">back to list</a> <div class="mb-4">
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse de l'entreprise</label>
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Numéro de téléphone</label>
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email de l'entreprise</label>
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mt-6">
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
Créer l'entreprise
</button>
</div>
{{ form_end(form) }}
</div>
<div class="mt-4">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -1,38 +1,56 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Company{% endblock %} {% block title %}Détail de l'entreprise{% endblock %}
{% block body %} {% block body %}
<h1>Company</h1> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Détail de l'entreprise</h1>
<table class="table"> <div class="bg-white shadow-md rounded-lg p-6">
<tbody> <table class="min-w-full">
<tr> <tbody>
<th>Id</th> <tr class="border-b">
<td>{{ company.id }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.id }}</td>
<tr> </tr>
<th>Name</th> <tr class="border-b">
<td>{{ company.name }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Nom</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.name }}</td>
<tr> </tr>
<th>Address</th> <tr class="border-b">
<td>{{ company.address }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Adresse</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.address }}</td>
<tr> </tr>
<th>Tel</th> <tr class="border-b">
<td>{{ company.tel }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Téléphone</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.tel }}</td>
<tr> </tr>
<th>Mail</th> <tr class="border-b">
<td>{{ company.mail }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Email</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.mail }}</td>
</tbody> </tr>
</table> </tbody>
</table>
</div>
<a href="{{ path('app_company_index') }}">back to list</a> <div class="mt-6 flex justify-between">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a> <a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
<i class="fas fa-edit"></i> Modifier cette entreprise
</a>
</div>
{{ include('company/_delete_form.html.twig') }} <div class="mt-6">
<form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
<button type="submit" class="text-red-500 hover:text-red-700">
<i class="fas fa-trash-alt"></i> Supprimer cette entreprise
</button>
</form>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -6,7 +6,6 @@
<div class="container mx-auto p-6"> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Diplômes</h1> <h1 class="text-3xl font-bold mb-4">Liste des Diplômes</h1>
<!-- Tableau des diplômes -->
<div class="overflow-x-auto bg-white shadow-lg rounded-lg"> <div class="overflow-x-auto bg-white shadow-lg rounded-lg">
<table class="min-w-full table-auto"> <table class="min-w-full table-auto">
<thead> <thead>
@ -27,12 +26,10 @@
<i class="fas fa-eye"></i> Voir <i class="fas fa-eye"></i> Voir
</a> </a>
<!-- Modifier le diplôme -->
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3"> <a href="{{ path('app_degree_edit', {'id': degree.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
<i class="fas fa-edit"></i> Modifier <i class="fas fa-edit"></i> Modifier
</a> </a>
<!-- Formulaire pour supprimer le diplôme -->
<form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" style="display:inline;"> <form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" style="display:inline;">
<input type="hidden" name="_method" value="DELETE"> <input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}">
@ -47,7 +44,6 @@
</table> </table>
</div> </div>
<!-- Lien pour ajouter un nouveau diplôme -->
<div class="mt-4"> <div class="mt-4">
<a href="{{ path('app_degree_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"> <a href="{{ path('app_degree_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
<i class="fas fa-plus-circle"></i> Ajouter un nouveau diplôme <i class="fas fa-plus-circle"></i> Ajouter un nouveau diplôme