Skip to content

Commit

Permalink
Finitiion du CRUD medicaments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tendry-Rkt56 committed Jul 18, 2024
1 parent 0bcdf58 commit ad96ea5
Show file tree
Hide file tree
Showing 15 changed files with 885 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ APP_SECRET=392440859b1c9e2ffbc369b960eee52b
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
DATABASE_URL="mysql://root:[email protected]:3306/commerces?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="mysql://root:[email protected]:3306/gestionPharm?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
# DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###

Expand Down
18 changes: 18 additions & 0 deletions assets/script/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const sidebar = document.querySelector(".sidebar");
const sidebarBtn = document.querySelector(".sidebarBtn");
sidebarBtn.onclick = function () {
sidebar.classList.toggle("active");
if (sidebar.classList.contains("active")) {
sidebarBtn.classList.replace("bx-menu", "bx-menu-alt-right");
}
else sidebarBtn.classList.replace("bx-menu-alt-right", "bx-menu");
}

const select = document.getElementById('select')

if (select) {
select.addEventListener('change', (e) => {
if (e.target.value == "admin") window.location.href = "/"
else window.location.href = "/users"
})
}
3 changes: 0 additions & 3 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
body {
background-color: skyblue;
}
6 changes: 6 additions & 0 deletions assets/styles/bootstrap.min.css

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions assets/styles/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
.home-section{
padding:10px;
display:flex;
align-items:center;
justify-content: space-between;
flex-direction:row;
position: fixed;
top:0;
left:0;
background: #ffff;
width: 100%;
transition: all 0.5s ease;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
z-index:1;
}

.home-section .sidebar-button{
display: flex;
align-items: center;
font-size: 24px;
font-weight: 500;
}

.home-section .sidebar-button i{
font-size: 35px;
margin-right: 10px;
}

.dashboard {
color:rgb(9, 181, 9);
}

.sidebar-button h3 {
letter-spacing:3px;
}

.admins .liens {
text-decoration:none;
color:#262626;
font-size:14px;
}

.admins .liens:hover {
color:#1cc88a;
}

.admins .liens.active {
color:green;
}

.home-section .profile-details{
display: flex;
align-items: center;
background: #F5F6FA;
border: 2px solid #EFEEF1;
border-radius: 6px;
height: 50px;
min-width: 190px;
padding: 0 15px 0 2px;
}
.profile-details img{
height: 40px;
width: 40px;
border-radius: 50%;
object-fit: cover;
}
.profile-details .admin_name{
font-size: 15px;
font-weight: 500;
color: #333;
margin: 0 10px;
white-space: nowrap;
}
.profile-details i{
font-size: 25px;
color: #333;
}

.dashboards {
position: absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
width:80%;
}

.cards {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin: 20px 0;
}

.card {
flex: 1;
margin: 10px;
padding: 20px;
border-radius: 10px;
color: #fff;
text-align: center;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card.blue {
background-color: #4e73df;
}

.card.light-blue {
background-color: #36b9cc;
}

.card.purple {
background-color: #6f42c1;
}

.card.green {
background-color: #1cc88a;
}

.card h3 {
color: #fff;
margin-top: 0;
font-size: 1.2em;
}

.card p {
color: #fff;
font-size: 2em;
margin: 10px 0;
}

.card span {
color: #fff;
font-size: 0.9em;
}

165 changes: 165 additions & 0 deletions assets/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
* {
margin: 0;
padding: 0;
box-sizing:border-box;
}

body {
background-color:white;
}

html {
scroll-behavior: smooth;
}

header {
padding:10px 0;
position:fixed;
top:0;
left:0;
z-index:1;
background:white;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
display: flex;
align-items:center;
justify-content:space-between;
width:100%;
}

header .logo {
margin-left:20px;
width:20%;
}

header .logo h3 {
letter-spacing:3px;
color:#262626;
font-size:20px;
font-family: monospace;
}

header .logo h3 span {
color:rgb(70, 70, 231);
}

header nav {
width: 70%;
}


header nav ul {
display: flex;
align-items:center;
justify-content:center;
}

header nav ul li {
margin:0 10px;
list-style:none;
}

header nav ul li a {
text-decoration: none;
color:#262626;
font-size:17px;
}

header nav ul li a:hover {
text-decoration:none;
}

header .auth {
width:10%;
}

.users-container {
position:absolute;
top:20%;
left:7%;
}

.containers {
position: absolute;
top:15%;
min-height: 100vh;
left: 3%;
transition: all 0.5s ease;
}
/*
.home-section{
position: relative;
background: #f5f5f5;
min-height: 100vh;
width: calc(100% - 240px);
left: 240px;
transition: all 0.5s ease;
} */

.ordonnance {
opacity:0.9;
border-radius: 5px;
font-size:13px;
font-weight:bolder;
text-align:center;
}

.requireds {
color:rgb(136, 37, 230);
background-color:rgb(221, 189, 251);
}

/* .required {
color: #f02525;
background-color:rgb(250, 193, 193);
} */

.no-required {
color:#008000;
background-color:rgb(218, 249, 218);
}

.forms {
width:500Px;
position:fixed;
top:50%;
left:50%;
transform: translate(-50%,-50%);
border-radius:4px;
box-shadow:0 0 4px rgba(0,0,0,0.2);
padding:10px 20px;
height:300px;
}

.forms-update {
width:400Px;
position:fixed;
top:50%;
left:50%;
transform:translate(-50%,-50%);
box-shadow:0 0 4px rgba(0,0,0,0.2);
padding: 20px 30px;
}

.forms-create {
width:700Px;
position:fixed;
top:50%;
left:50%;
transform: translate(-50%,-50%);
border-radius:4px;
box-shadow:0 0 4px rgba(0,0,0,0.2);
padding:10px 20px;
height:400px;
}

.forms h3 {
letter-spacing:3px;
color:#262626;
font-size:25px;
font-family: monospace;
}

.forms h3 span {
border-bottom:2px solid rgb(70, 70, 231);
}

33 changes: 33 additions & 0 deletions migrations/Version20240718021820.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240718021820 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE medicament (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(100) NOT NULL, prix DOUBLE PRECISION NOT NULL, nombre INT NOT NULL, ordonnance TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE medicament');
$this->addSql('DROP TABLE messenger_messages');
}
}
Loading

0 comments on commit ad96ea5

Please sign in to comment.