Maj de la table : Tables

Changement CSS
This commit is contained in:
Joshua 2024-11-14 17:48:57 +01:00
parent eaeabed512
commit b51a75285a
9 changed files with 126 additions and 150 deletions

View File

@ -0,0 +1,65 @@
#container_gestion_user {
background-color: white;
margin-left: 20%; /* Centrage vertical */
margin-top: 5%;
padding: 20px;
border: 1px solid black;
width: 75%; /* Largeur du contenu de la modal */
height: 100%; /* Hauteur du contenu de la modal */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
display: none;
}
body {
width: 100%;
height: 100%;
}
/* Style pour chaque élément d'information de l'utilisateur */
.user-info-item {
display: flex;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
}
/* Dernier élément sans bordure */
.user-info-item:last-child {
border-bottom: none;
}
/* Style pour le label de chaque information (Nom, Prénom, etc.) */
.user-info-label {
font-weight: bold;
color: #333;
width: 7%;
}
/* Style pour la valeur de chaque information (la donnée de l'utilisateur) */
.user-info-value {
color: #555;
text-align: right;
width: 65%;
word-wrap: break-word; /* Gère les débordements */
}
.btn-update {
margin-top: 1%;
}
/* Ajout d'un style pour rendre responsive */
@media (max-width: 600px) {
#InformationUser {
padding: 15px;
}
.user-info-item {
flex-direction: column;
padding: 8px 0;
}
.user-info-label, .user-info-value {
width: 100%;
}
}

View File

@ -30,8 +30,8 @@ class Clients
/**
* @var Collection<int, Tables>
*/
#[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Client')]
private Collection $table;
#[ORM\ManyToMany(targetEntity: Tables::class, mappedBy: 'Clients')]
private Collection $tables;
/**
* @var Collection<int, Commandes>
@ -41,7 +41,7 @@ class Clients
public function __construct()
{
$this->table = new ArrayCollection();
$this->tables = new ArrayCollection();
$this->commandes = new ArrayCollection();
}
@ -101,23 +101,23 @@ class Clients
/**
* @return Collection<int, Tables>
*/
public function getTable(): Collection
public function getTables(): Collection
{
return $this->table;
return $this->tables;
}
public function addTable(Tables $table): static
public function addTable(Tables $tables): static
{
if (!$this->table->contains($table)) {
$this->table->add($table);
if (!$this->tables->contains($tables)) {
$this->tables->add($tables);
}
return $this;
}
public function removeTable(Tables $table): static
public function removeTable(Tables $tables): static
{
$this->table->removeElement($table);
$this->tables->removeElement($tables);
return $this;
}

View File

@ -23,7 +23,7 @@ class Reservations
private ?int $Nb_de_prsn = null;
#[ORM\ManyToOne(inversedBy: 'reservations')]
private ?Tables $Table = null;
private ?Tables $tables = null;
/**
* @var Collection<int, Utilisateurs>
@ -65,14 +65,14 @@ class Reservations
return $this;
}
public function getTable(): ?Tables
public function getTables(): ?Tables
{
return $this->Table;
return $this->tables;
}
public function setTable(?Tables $Table): static
public function setTable(?Tables $tables): static
{
$this->Table = $Table;
$this->tables = $tables;
return $this;
}

View File

@ -17,7 +17,7 @@ class StatutTables
private ?string $Libellé = null;
#[ORM\ManyToOne(inversedBy: 'statutTables')]
private ?Tables $Table = null;
private ?Tables $tables = null;
public function getId(): ?int
{
@ -36,14 +36,14 @@ class StatutTables
return $this;
}
public function getTable(): ?Tables
public function getTables(): ?Tables
{
return $this->Table;
return $this->tables;
}
public function setTable(?Tables $Table): static
public function setTable(?Tables $tables): static
{
$this->Table = $Table;
$this->tables = $tables;
return $this;
}

View File

@ -18,25 +18,25 @@ class Tables
/**
* @var Collection<int, Clients>
*/
#[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'table')]
#[ORM\ManyToMany(targetEntity: Clients::class, inversedBy: 'tables')]
private Collection $Clients;
/**
* @var Collection<int, Reservations>
*/
#[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Table')]
#[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')]
private Collection $reservations;
/**
* @var Collection<int, StatutTables>
*/
#[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Table')]
#[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')]
private Collection $statutTables;
/**
* @var Collection<int, Utilisateurs>
*/
#[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'table')]
#[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tables')]
private Collection $utilisateurs;
public function __construct()
@ -55,7 +55,7 @@ class Tables
/**
* @return Collection<int, Clients>
*/
public function getClient(): Collection
public function getClients(): Collection
{
return $this->Clients;
}
@ -101,7 +101,7 @@ class Tables
{
if ($this->reservations->removeElement($reservation)) {
// set the owning side to null (unless already changed)
if ($reservation->getTable() === $this) {
if ($reservation->getTables() === $this) {
$reservation->setTable(null);
}
}
@ -131,7 +131,7 @@ class Tables
{
if ($this->statutTables->removeElement($statutTable)) {
// set the owning side to null (unless already changed)
if ($statutTable->getTable() === $this) {
if ($statutTable->getTables() === $this) {
$statutTable->setTable(null);
}
}

View File

@ -42,12 +42,12 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface
* @var Collection<int, Tables>
*/
#[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')]
private Collection $table;
private Collection $tables;
public function __construct()
{
$this->Reservation = new ArrayCollection();
$this->table = new ArrayCollection();
$this->tables = new ArrayCollection();
}
public function getId(): ?int
@ -157,23 +157,23 @@ class Utilisateurs implements UserInterface, PasswordAuthenticatedUserInterface
/**
* @return Collection<int, Tables>
*/
public function getTable(): Collection
public function getTables(): Collection
{
return $this->table;
return $this->tables;
}
public function addTable(Tables $table): static
public function addTable(Tables $tables): static
{
if (!$this->table->contains($table)) {
$this->table->add($table);
if (!$this->tables->contains($tables)) {
$this->tables->add($tables);
}
return $this;
}
public function removeTable(Tables $table): static
public function removeTable(Tables $tables): static
{
$this->table->removeElement($table);
$this->tables->removeElement($tables);
return $this;
}

View File

@ -4,110 +4,31 @@
{% block body %}
<style>
body {
width: 100%;
height: 100%;
}
/* Style pour chaque élément d'information de l'utilisateur */
.user-info-item {
display: flex;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
}
/* Dernier élément sans bordure */
.user-info-item:last-child {
border-bottom: none;
}
/* Style pour le label de chaque information (Nom, Prénom, etc.) */
.user-info-label {
font-weight: bold;
color: #333;
width: 7%;
}
/* Style pour la valeur de chaque information (la donnée de l'utilisateur) */
.user-info-value {
color: #555;
text-align: left;
width: 65%;
word-wrap: break-word; /* Gère les débordements */
}
.password {
display: flex;
flex-direction: column;
width: 100%;
text-align: left;
}
/* Ajout d'un style pour rendre responsive */
@media (max-width: 600px) {
#InformationUser {
padding: 15px;
}
.user-info-item {
flex-direction: column;
padding: 8px 0;
}
.user-info-label, .user-info-value {
width: 100%;
}
}
</style>
<form id="UpdateUser" action="{{ path('update-user', { 'id': app.user.id }) }}" method="post">
<div id="InformationUser">
<div class="user-info-item">
<span class="user-info-label">Nom :</span>
<span class="user-info-value">{{ app.user.nom }}</span>
</div>
<div class="user-info-item">
<span class="user-info-label">Prénom :</span>
<span class="user-info-value">{{ app.user.prenom }}</span>
</div>
<div class="user-info-item">
<span class="user-info-label">Email :</span>
<span class="user-info-value">{{ app.user.userIdentifier }}</span>
</div>
<div class="user-info-item">
<span class="user-info-label">Roles :</span>
<span class="user-info-value">{{ app.user.getRolesAsString() }}</span>
</div>
<p>Test</p>
{# {{ form_start(form) }}#}
{# <div> #}
{# {{ form_row(form.UserIdentifier) }}#}
{# {{ form_row(form.Password) }}#}
{# {{ form_row(form.Nom) }}#}
{# {{ form_row(form.Prenom) }}#}
{# {{ form_row(form.Roles) }}#}
{# </div>#}
{# {{ form_end(form) }}#}
{# <form id="UpdateUser" action="{{ path('update-user', { 'id': app.user.id }) }}" method="post">#}
{# <div id="InformationUser">#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Nom :</span>#}
{# <span class="user-info-value">{{ app.user.nom }}</span>#}
{# <input type="text" id="nom" name="nom" value="{{ app.user.nom }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Prénom :</span>#}
{# <span class="user-info-value">{{ app.user.prenom }}</span>#}
{# <input type="text" id="prenom" name="prenom" value="{{ app.user.prenom }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Email :</span>#}
{# <span class="user-info-value">{{ app.user.userIdentifier }}</span>#}
{# <input type="text" id="email" name="email" value="{{ app.user.userIdentifier }}" class="user-info-input">#}
{# </div>#}
{# <div class="user-info-item">#}
{# <div id="passwordConfirmDiv" class="password-confirm-div">#}
{# <label for="confirm_password" class="user-info-label">Confirmer ou modifier le mot de passe :</label>#}
{# <input type="password" id="confirm_password" name="confirm_password" class="user-info-input" placeholder="Mot de passe">#}
{# </div>#}
{# </div>#}
{# <div class="user-info-item">#}
{# <span class="user-info-label">Roles :</span>#}
{# <span class="user-info-value">{{ app.user.getRolesAsString() }}</span>#}
{# <input type="checkbox" id="roles" name="roles" value="{{ app.user.getRolesAsString() }}" class="user-info-input" readonly>#}
{# </div>#}
{# <div class="btn">#}
{# <button type="submit" class="submit-button">Mettre à jour</button>#}
{# </div>#}
{# </div>#}
{# </form>#}
<div class="btn-update">
<button>Modifier</button>
</div>
</div>
</form>
{% endblock %}

View File

@ -10,22 +10,12 @@
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/modal.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/Index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/GestionUser.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block body %}
<style>
#container_gestion_user {
background-color: white;
margin-left: 20%; /* Centrage vertical */
margin-top: 5%;
padding: 20px;
border: 1px solid black;
width: 75%; /* Largeur du contenu de la modal */
height: 100%; /* Hauteur du contenu de la modal */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
display: none;
}
</style>
<!-- Top Bar -->