Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39e5ae87ff | |||
| 3a5e8a70e2 | |||
| 4df8cf495a | |||
| 18102d1627 | |||
| e55772986b | |||
| 8793bb09d7 | |||
| 75de2a46f1 | |||
| 9fc641f93b | |||
| c252d648b8 | |||
| 9865c17ac8 | |||
| 26c5f06f98 |
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"yaml.schemas": {
|
||||||
|
"file:///home/jfgiraud/.vscode-server/extensions/continue.continue-2.0.0-linux-x64/config-yaml-schema.json": [
|
||||||
|
".continue/**/*.yaml",
|
||||||
|
"file:///home/jfgiraud/.continue/config.yaml"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"json.schemas": []
|
||||||
|
}
|
||||||
+410
@@ -0,0 +1,410 @@
|
|||||||
|
:root {
|
||||||
|
--ordregf-bg: #13161f;
|
||||||
|
--ordregf-card: #1c2030;
|
||||||
|
--ordregf-border: rgba(255, 255, 255, 0.08);
|
||||||
|
--ordregf-text: #f0f2fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Force le plein écran */
|
||||||
|
.ordregf-page {
|
||||||
|
background-color: var(--ordregf-bg);
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-shell {
|
||||||
|
width: 100%;
|
||||||
|
max-width: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-card {
|
||||||
|
background: var(--ordregf-card);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tables en pleine largeur */
|
||||||
|
.ordregf-table,
|
||||||
|
.ordregf-detail-table {
|
||||||
|
width: 100% !important;
|
||||||
|
border-collapse: collapse;
|
||||||
|
table-layout: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alignements entêtes */
|
||||||
|
.ordregf-table th,
|
||||||
|
.ordregf-detail-table th {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
padding: 12px;
|
||||||
|
text-align: left;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-detail-table th {
|
||||||
|
text-align: center !important;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-detail-table td {
|
||||||
|
padding: 8px;
|
||||||
|
border-bottom: 1px solid var(--ordregf-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles boutons */
|
||||||
|
.ordregf-edit-button {
|
||||||
|
padding: 4px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Boutons principaux (Créer et Retour) */
|
||||||
|
.ordregf-btn-menu,
|
||||||
|
.ordregf-btn-creer {
|
||||||
|
padding: 10px 24px !important;
|
||||||
|
border-radius: 50px !important;
|
||||||
|
border: none !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
display: inline-flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
transition: background 0.3s ease !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bouton Menu (Bleu) */
|
||||||
|
.ordregf-btn-menu {
|
||||||
|
background-color: #1a237e !important;
|
||||||
|
}
|
||||||
|
.ordregf-btn-menu:hover {
|
||||||
|
background-color: #283593 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bouton Créer (Vert) */
|
||||||
|
.ordregf-btn-creer {
|
||||||
|
background-color: #28a745 !important;
|
||||||
|
}
|
||||||
|
.ordregf-btn-creer:hover {
|
||||||
|
background-color: #218838 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles lignes */
|
||||||
|
.ordregf-header-style {
|
||||||
|
background: rgba(255, 255, 255, 0.05) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-header-style td {
|
||||||
|
color: #fff !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
padding: 12px !important;
|
||||||
|
border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-detail-row td {
|
||||||
|
padding: 10px 5px !important;
|
||||||
|
border-bottom: 1px solid var(--ordregf-border);
|
||||||
|
color: #e0e0e0;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-detail-row:hover {
|
||||||
|
background-color: rgba(255, 255, 255, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alignement colonnes numériques */
|
||||||
|
.ordregf-detail-table .text-right {
|
||||||
|
text-align: right !important;
|
||||||
|
padding-right: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Classe commune : force la taille et l'alignement */
|
||||||
|
.ordregf-btn-petit {
|
||||||
|
width: 90px; /* Largeur fixe pour tous les petits boutons */
|
||||||
|
height: 30px; /* Hauteur fixe pour un alignement vertical parfait */
|
||||||
|
padding: 0 10px; /* Padding horizontal */
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex; /* Utilise Flexbox pour centrer le texte */
|
||||||
|
align-items: center; /* Centre verticalement */
|
||||||
|
justify-content: center; /* Centre horizontalement */
|
||||||
|
box-sizing: border-box; /* Important : inclut padding/border dans la largeur */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Couleurs spécifiques */
|
||||||
|
.ordregf-btn-creer-petit {
|
||||||
|
background-color: #28a745;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.ordregf-btn-creer-petit:hover {
|
||||||
|
background-color: #218838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-btn-modifier-petit {
|
||||||
|
background-color: #1a237e;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.ordregf-btn-modifier-petit:hover {
|
||||||
|
background-color: #283593;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-master-row {
|
||||||
|
background: linear-gradient(90deg, #001f3f, #004cff) !important;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
|
||||||
|
box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************/
|
||||||
|
|
||||||
|
/* 1. On nettoie le body */
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden; /* Empêche le scroll de la page entière */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2. On positionne le shell en absolu pour qu'il s'insère entre le header et le footer */
|
||||||
|
.ordregf-shell {
|
||||||
|
position: absolute;
|
||||||
|
top: 80px; /* Hauteur exacte de votre header */
|
||||||
|
bottom: 50px; /* Hauteur exacte de votre footer */
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px; /* Un léger espace intérieur pour l'esthétique */
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 3. La carte occupe l'espace restant */
|
||||||
|
.ordregf-card {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden; /* Important pour que le scroll ne sorte pas de la carte */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 4. C'est ici que le scroll se passe */
|
||||||
|
.ordregf-table-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto; /* Active le scroll uniquement ici */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Important : reset des marges du tableau qui pourraient le pousser */
|
||||||
|
.ordregf-table {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-btn-petit {
|
||||||
|
width: 90px;
|
||||||
|
height: 30px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===========================
|
||||||
|
MODALES
|
||||||
|
=========================== */
|
||||||
|
|
||||||
|
.ordregf-modal {
|
||||||
|
width: 520px;
|
||||||
|
max-width: 92vw;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-radius: 18px;
|
||||||
|
|
||||||
|
background: #20263a;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
padding: 30px;
|
||||||
|
|
||||||
|
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
|
||||||
|
animation: popup 0.18s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-modal::backdrop {
|
||||||
|
background: rgba(0, 0, 0, 0.65);
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes popup {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-20px) scale(0.95);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-modal h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group label {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #cfd8ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-modal input,
|
||||||
|
.ordregf-modal select {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
padding: 12px 14px;
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid #3b4668;
|
||||||
|
|
||||||
|
background: #151b2d;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
font-size: 15px;
|
||||||
|
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
transition: 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordregf-modal input:focus,
|
||||||
|
.ordregf-modal select:focus {
|
||||||
|
border-color: #4d84ff;
|
||||||
|
box-shadow: 0 0 0 3px rgba(77, 132, 255, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
|
margin-top: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button {
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
padding: 11px 22px;
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
transition: 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:first-child {
|
||||||
|
background: #444b63;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:first-child:hover {
|
||||||
|
background: #59617c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:last-child {
|
||||||
|
background: #2dbf5a;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:last-child:hover {
|
||||||
|
background: #27a84f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group .triple {
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnRechercher {
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
padding: 12px;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
|
background: #2962ff;
|
||||||
|
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnRechercher:hover {
|
||||||
|
background: #1d4ed8;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.ordregf-modal {
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
width: 520px;
|
||||||
|
max-width: 90vw;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-radius: 18px;
|
||||||
|
|
||||||
|
padding: 30px;
|
||||||
|
|
||||||
|
background: #20263a;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.ordregf-modal::backdrop {
|
||||||
|
background: rgba(0, 0, 0, 0.65);
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
@@ -0,0 +1,358 @@
|
|||||||
|
:root {
|
||||||
|
--ordrejfg-bg: #13161f;
|
||||||
|
--ordrejfg-card: #1c2030;
|
||||||
|
--ordrejfg-border: rgba(255, 255, 255, 0.08);
|
||||||
|
--ordrejfg-text: #f0f2fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Force le plein écran */
|
||||||
|
.ordrejfg-page {
|
||||||
|
background-color: var(--ordrejfg-bg);
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-shell {
|
||||||
|
width: 100%;
|
||||||
|
max-width: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-card {
|
||||||
|
background: var(--ordrejfg-card);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tables en pleine largeur */
|
||||||
|
.ordrejfg-table,
|
||||||
|
.ordrejfg-detail-table {
|
||||||
|
width: 100% !important;
|
||||||
|
border-collapse: collapse;
|
||||||
|
table-layout: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alignements entêtes */
|
||||||
|
.ordrejfg-table th,
|
||||||
|
.ordrejfg-detail-table th {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
padding: 12px;
|
||||||
|
text-align: left;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-detail-table th {
|
||||||
|
text-align: center !important;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-detail-table td {
|
||||||
|
padding: 8px;
|
||||||
|
border-bottom: 1px solid var(--ordrejfg-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles boutons */
|
||||||
|
.ordrejfg-edit-button {
|
||||||
|
padding: 4px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Boutons principaux (Créer et Retour) */
|
||||||
|
.ordrejfg-btn-menu,
|
||||||
|
.ordrejfg-btn-creer {
|
||||||
|
padding: 10px 24px !important;
|
||||||
|
border-radius: 50px !important;
|
||||||
|
border: none !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
display: inline-flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
transition: background 0.3s ease !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bouton Menu (Bleu) */
|
||||||
|
.ordrejfg-btn-menu {
|
||||||
|
background-color: #1a237e !important;
|
||||||
|
}
|
||||||
|
.ordrejfg-btn-menu:hover {
|
||||||
|
background-color: #283593 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bouton Créer (Vert) */
|
||||||
|
.ordrejfg-btn-creer {
|
||||||
|
background-color: #28a745 !important;
|
||||||
|
}
|
||||||
|
.ordrejfg-btn-creer:hover {
|
||||||
|
background-color: #218838 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles lignes */
|
||||||
|
.ordrejfg-header-style {
|
||||||
|
background: rgba(255, 255, 255, 0.05) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-header-style td {
|
||||||
|
color: #fff !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
padding: 12px !important;
|
||||||
|
border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-detail-row td {
|
||||||
|
padding: 10px 5px !important;
|
||||||
|
border-bottom: 1px solid var(--ordrejfg-border);
|
||||||
|
color: #e0e0e0;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-detail-row:hover {
|
||||||
|
background-color: rgba(255, 255, 255, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alignement colonnes numériques */
|
||||||
|
.ordrejfg-detail-table .text-right {
|
||||||
|
text-align: right !important;
|
||||||
|
padding-right: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Classe commune : force la taille et l'alignement */
|
||||||
|
.ordrejfg-btn-petit {
|
||||||
|
width: 90px;
|
||||||
|
height: 30px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Couleurs spécifiques */
|
||||||
|
.ordrejfg-btn-creer-petit {
|
||||||
|
background-color: #28a745;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.ordrejfg-btn-creer-petit:hover {
|
||||||
|
background-color: #218838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-btn-modifier-petit {
|
||||||
|
background-color: #1a237e;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.ordrejfg-btn-modifier-petit:hover {
|
||||||
|
background-color: #283593;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-master-row {
|
||||||
|
background: linear-gradient(90deg, #001f3f, #004cff) !important;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
|
||||||
|
box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************/
|
||||||
|
|
||||||
|
/* 1. On nettoie le body */
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2. On positionne le shell en absolu pour qu'il s'insère entre le header et le footer */
|
||||||
|
.ordrejfg-shell {
|
||||||
|
position: absolute;
|
||||||
|
top: 80px;
|
||||||
|
bottom: 50px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 3. La carte occupe l'espace restant */
|
||||||
|
.ordrejfg-card {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 4. C'est ici que le scroll se passe */
|
||||||
|
.ordrejfg-table-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-table {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===========================
|
||||||
|
MODALES
|
||||||
|
=========================== */
|
||||||
|
|
||||||
|
.ordrejfg-modal {
|
||||||
|
width: 520px;
|
||||||
|
max-width: 92vw;
|
||||||
|
border: none;
|
||||||
|
border-radius: 18px;
|
||||||
|
background: #20263a;
|
||||||
|
color: white;
|
||||||
|
padding: 30px;
|
||||||
|
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
animation: popup 0.18s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-modal::backdrop {
|
||||||
|
background: rgba(0, 0, 0, 0.65);
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes popup {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-20px) scale(0.95);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-modal h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group label {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #cfd8ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-modal input,
|
||||||
|
.ordrejfg-modal select {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid #3b4668;
|
||||||
|
background: #151b2d;
|
||||||
|
color: white;
|
||||||
|
font-size: 15px;
|
||||||
|
outline: none;
|
||||||
|
transition: 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ordrejfg-modal input:focus,
|
||||||
|
.ordrejfg-modal select:focus {
|
||||||
|
border-color: #4d84ff;
|
||||||
|
box-shadow: 0 0 0 3px rgba(77, 132, 255, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button {
|
||||||
|
border: none;
|
||||||
|
padding: 11px 22px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:first-child {
|
||||||
|
background: #444b63;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:first-child:hover {
|
||||||
|
background: #59617c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:last-child {
|
||||||
|
background: #2dbf5a;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-actions button:last-child:hover {
|
||||||
|
background: #27a84f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group .triple {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnRechercher {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #2962ff;
|
||||||
|
color: white;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnRechercher:hover {
|
||||||
|
background: #1d4ed8;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.ordrejfg-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
margin: 0;
|
||||||
|
width: 520px;
|
||||||
|
max-width: 90vw;
|
||||||
|
border: none;
|
||||||
|
border-radius: 18px;
|
||||||
|
padding: 30px;
|
||||||
|
background: #20263a;
|
||||||
|
color: white;
|
||||||
|
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.ordrejfg-modal::backdrop {
|
||||||
|
background: rgba(0, 0, 0, 0.65);
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
+238
@@ -0,0 +1,238 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
// =====================================================
|
||||||
|
// OUTILS MODALES
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
function openModal(modal) {
|
||||||
|
if (!modal) return;
|
||||||
|
|
||||||
|
modal.showModal();
|
||||||
|
|
||||||
|
// Force le centrage avec le CSS dialog
|
||||||
|
modal.style.transform = "translate(-50%, -50%)";
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeModal(modal) {
|
||||||
|
if (!modal) return;
|
||||||
|
modal.close();
|
||||||
|
modal.style.transform = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fermeture par clic en dehors de la fenêtre
|
||||||
|
document.querySelectorAll("dialog").forEach((dialog) => {
|
||||||
|
dialog.addEventListener("click", (e) => {
|
||||||
|
const rect = dialog.getBoundingClientRect();
|
||||||
|
|
||||||
|
const inside =
|
||||||
|
e.clientX >= rect.left &&
|
||||||
|
e.clientX <= rect.right &&
|
||||||
|
e.clientY >= rect.top &&
|
||||||
|
e.clientY <= rect.bottom;
|
||||||
|
|
||||||
|
if (!inside) {
|
||||||
|
closeModal(dialog);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// MODAL CREATION ORDRE
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
const modalCreerOrdre = document.getElementById("modalCreerOrdre");
|
||||||
|
|
||||||
|
const btnCreer = document.querySelector(".ordregf-btn-creer");
|
||||||
|
|
||||||
|
if (modalCreerOrdre && btnCreer) {
|
||||||
|
btnCreer.addEventListener("click", () => {
|
||||||
|
openModal(modalCreerOrdre);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("btnAnnuler")?.addEventListener("click", () => {
|
||||||
|
document.getElementById("formCreerOrdre")?.reset();
|
||||||
|
|
||||||
|
closeModal(modalCreerOrdre);
|
||||||
|
|
||||||
|
const btnValider = document.getElementById("btnValider");
|
||||||
|
|
||||||
|
if (btnValider) {
|
||||||
|
btnValider.disabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// RECHERCHE ACTION
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
const btnRechercher = document.getElementById("btnRechercher");
|
||||||
|
|
||||||
|
btnRechercher?.addEventListener("click", async () => {
|
||||||
|
const isin = document.getElementById("isinRecherche").value;
|
||||||
|
|
||||||
|
if (!isin) {
|
||||||
|
alert("Veuillez entrer un code ISIN");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(
|
||||||
|
`/php/api_rechercher_action.php?isin=${encodeURIComponent(isin)}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (data.success) {
|
||||||
|
document.getElementById("Nom").value = data.company_name;
|
||||||
|
|
||||||
|
document.getElementById("ticker").value = data.ticker;
|
||||||
|
|
||||||
|
document.getElementById("code_yahoo").value = data.yahoo_code;
|
||||||
|
|
||||||
|
document.getElementById("btnValider").disabled = false;
|
||||||
|
} else {
|
||||||
|
alert("Action non trouvée");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT ORDRE
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formCreerOrdre")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const formData = new FormData(e.target);
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_enregistrer_ordre.php", {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert(
|
||||||
|
"Erreur lors de l'enregistrement : " +
|
||||||
|
(result.message || "Erreur inconnue"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT DETAIL
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formCreerDetail")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_enregistrer_detail.php", {
|
||||||
|
method: "POST",
|
||||||
|
body: new FormData(e.target),
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert(
|
||||||
|
"Erreur lors de l'enregistrement du détail : " +
|
||||||
|
(result.message || ""),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// MODIFICATION DETAIL
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document.addEventListener("click", (e) => {
|
||||||
|
const button = e.target.closest(".ordregf-btn-modifier-petit");
|
||||||
|
|
||||||
|
if (!button) return;
|
||||||
|
|
||||||
|
const detail = JSON.parse(button.getAttribute("data-detail"));
|
||||||
|
|
||||||
|
const modal = document.getElementById("modalModifierDetail");
|
||||||
|
|
||||||
|
if (!modal) return;
|
||||||
|
|
||||||
|
document.getElementById("edit_id").value = detail.Id;
|
||||||
|
|
||||||
|
document.getElementById("edit_Id_entete").value = detail.Id_entete;
|
||||||
|
|
||||||
|
document.getElementById("edit_date").value = detail.Date_op;
|
||||||
|
|
||||||
|
document.getElementById("edit_quantite").value = detail.Quantite;
|
||||||
|
|
||||||
|
document.getElementById("edit_prix").value = detail.Prix_brut;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_broker").value =
|
||||||
|
detail.Frais_brocker || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_etat").value = detail.Frais_etat || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_autre").value = detail.Frais_autre || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_type").value = (
|
||||||
|
detail.Type || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
document.getElementById("edit_etat").value = (
|
||||||
|
detail.Etat || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
document.getElementById("edit_ordre").value = (
|
||||||
|
detail.Ordre || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
openModal(modal);
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT MODIFICATION
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formModifierDetail")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_modifier_detail.php", {
|
||||||
|
method: "POST",
|
||||||
|
|
||||||
|
body: new FormData(e.target),
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert("Erreur : " + result.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//fermer la popup en cliquant à côté
|
||||||
|
document.querySelectorAll("dialog").forEach((dialog) => {
|
||||||
|
dialog.addEventListener("click", (e) => {
|
||||||
|
const rect = dialog.getBoundingClientRect();
|
||||||
|
|
||||||
|
const inside =
|
||||||
|
e.clientX >= rect.left &&
|
||||||
|
e.clientX <= rect.right &&
|
||||||
|
e.clientY >= rect.top &&
|
||||||
|
e.clientY <= rect.bottom;
|
||||||
|
|
||||||
|
if (!inside) {
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
+220
@@ -0,0 +1,220 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
// =====================================================
|
||||||
|
// OUTILS MODALES
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
function openModal(modal) {
|
||||||
|
if (!modal) return;
|
||||||
|
|
||||||
|
modal.showModal();
|
||||||
|
|
||||||
|
// Force le centrage avec le CSS dialog
|
||||||
|
modal.style.transform = "translate(-50%, -50%)";
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeModal(modal) {
|
||||||
|
if (!modal) return;
|
||||||
|
modal.close();
|
||||||
|
modal.style.transform = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fermeture par clic en dehors de la fenêtre
|
||||||
|
document.querySelectorAll("dialog").forEach((dialog) => {
|
||||||
|
dialog.addEventListener("click", (e) => {
|
||||||
|
const rect = dialog.getBoundingClientRect();
|
||||||
|
|
||||||
|
const inside =
|
||||||
|
e.clientX >= rect.left &&
|
||||||
|
e.clientX <= rect.right &&
|
||||||
|
e.clientY >= rect.top &&
|
||||||
|
e.clientY <= rect.bottom;
|
||||||
|
|
||||||
|
if (!inside) {
|
||||||
|
closeModal(dialog);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// MODAL CREATION ORDRE
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
const modalCreerOrdre = document.getElementById("modalCreerOrdre");
|
||||||
|
|
||||||
|
const btnCreer = document.querySelector(".ordrejfg-btn-creer");
|
||||||
|
|
||||||
|
if (modalCreerOrdre && btnCreer) {
|
||||||
|
btnCreer.addEventListener("click", () => {
|
||||||
|
openModal(modalCreerOrdre);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("btnAnnuler")?.addEventListener("click", () => {
|
||||||
|
document.getElementById("formCreerOrdre")?.reset();
|
||||||
|
|
||||||
|
closeModal(modalCreerOrdre);
|
||||||
|
|
||||||
|
const btnValider = document.getElementById("btnValider");
|
||||||
|
|
||||||
|
if (btnValider) {
|
||||||
|
btnValider.disabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// RECHERCHE ACTION
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
const btnRechercher = document.getElementById("btnRechercher");
|
||||||
|
|
||||||
|
btnRechercher?.addEventListener("click", async () => {
|
||||||
|
const isin = document.getElementById("isinRecherche").value;
|
||||||
|
|
||||||
|
if (!isin) {
|
||||||
|
alert("Veuillez entrer un code ISIN");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(
|
||||||
|
`/php/api_rechercher_action_jfg.php?isin=${encodeURIComponent(isin)}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (data.success) {
|
||||||
|
document.getElementById("Nom").value = data.company_name;
|
||||||
|
|
||||||
|
document.getElementById("ticker").value = data.ticker;
|
||||||
|
|
||||||
|
document.getElementById("code_yahoo").value = data.yahoo_code;
|
||||||
|
|
||||||
|
document.getElementById("btnValider").disabled = false;
|
||||||
|
} else {
|
||||||
|
alert("Action non trouvée");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT ORDRE
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formCreerOrdre")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const formData = new FormData(e.target);
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_enregistrer_ordre_jfg.php", {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert(
|
||||||
|
"Erreur lors de l'enregistrement : " +
|
||||||
|
(result.message || "Erreur inconnue"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT DETAIL
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formCreerDetail")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_enregistrer_detail_jfg.php", {
|
||||||
|
method: "POST",
|
||||||
|
body: new FormData(e.target),
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert(
|
||||||
|
"Erreur lors de l'enregistrement du détail : " +
|
||||||
|
(result.message || ""),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// MODIFICATION DETAIL
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document.addEventListener("click", (e) => {
|
||||||
|
const button = e.target.closest(".ordrejfg-btn-modifier-petit");
|
||||||
|
|
||||||
|
if (!button) return;
|
||||||
|
|
||||||
|
const detail = JSON.parse(button.getAttribute("data-detail"));
|
||||||
|
|
||||||
|
const modal = document.getElementById("modalModifierDetail");
|
||||||
|
|
||||||
|
if (!modal) return;
|
||||||
|
|
||||||
|
document.getElementById("edit_id").value = detail.Id;
|
||||||
|
|
||||||
|
document.getElementById("edit_Id_entete").value = detail.Id_entete;
|
||||||
|
|
||||||
|
document.getElementById("edit_date").value = detail.Date_op;
|
||||||
|
|
||||||
|
document.getElementById("edit_quantite").value = detail.Quantite;
|
||||||
|
|
||||||
|
document.getElementById("edit_prix").value = detail.Prix_brut;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_broker").value =
|
||||||
|
detail.Frais_brocker || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_etat").value = detail.Frais_etat || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_frais_autre").value = detail.Frais_autre || 0;
|
||||||
|
|
||||||
|
document.getElementById("edit_type").value = (
|
||||||
|
detail.Type || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
document.getElementById("edit_etat").value = (
|
||||||
|
detail.Etat || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
document.getElementById("edit_ordre").value = (
|
||||||
|
detail.Ordre || ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
|
openModal(modal);
|
||||||
|
});
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// ENREGISTREMENT MODIFICATION
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById("formModifierDetail")
|
||||||
|
?.addEventListener("submit", async (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const response = await fetch("/php/api_modifier_detail_jfg.php", {
|
||||||
|
method: "POST",
|
||||||
|
body: new FormData(e.target),
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
alert("Erreur : " + result.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
$stmt = $db->prepare("INSERT INTO ordreGF_pied
|
||||||
|
(Id_entete, Date_op, Quantite, Prix_brut, Frais_brocker, Frais_etat, Frais_autre, Ordre, Type, Etat)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
|
||||||
|
$success = $stmt->execute([
|
||||||
|
$_POST['Id_entete'],
|
||||||
|
$_POST['Date_op'],
|
||||||
|
$_POST['Quantite'],
|
||||||
|
$_POST['Prix_brut'],
|
||||||
|
$_POST['Frais_brocker'],
|
||||||
|
$_POST['Frais_etat'],
|
||||||
|
$_POST['Frais_autre'],
|
||||||
|
$_POST['Ordre'],
|
||||||
|
$_POST['Type'],
|
||||||
|
$_POST['Etat']
|
||||||
|
]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => $success]);
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Insertion dans la table ordreJFG_pied
|
||||||
|
$sql = "INSERT INTO ordreJFG_pied (Id_entete, Date_op, Quantite, Prix_brut, Frais_brocker, Frais_etat, Frais_autre, Ordre, Type, Etat)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||||
|
|
||||||
|
$stmt = $db->prepare($sql);
|
||||||
|
|
||||||
|
$success = $stmt->execute([
|
||||||
|
$_POST['Id_entete'],
|
||||||
|
$_POST['Date_op'],
|
||||||
|
$_POST['Quantite'],
|
||||||
|
$_POST['Prix_brut'],
|
||||||
|
$_POST['Frais_brocker'],
|
||||||
|
$_POST['Frais_etat'],
|
||||||
|
$_POST['Frais_autre'],
|
||||||
|
$_POST['Ordre'],
|
||||||
|
$_POST['Type'],
|
||||||
|
$_POST['Etat']
|
||||||
|
]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => $success]);
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
$stmt = $db->prepare("INSERT INTO ordreGF (isin, Nom, ticker, code_yahoo) VALUES (?, ?, ?, ?)");
|
||||||
|
$success = $stmt->execute([$_POST['isin'], $_POST['Nom'], $_POST['ticker'], $_POST['code_yahoo']]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => $success]);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Insertion dans la table ordreJFG
|
||||||
|
$stmt = $db->prepare("INSERT INTO ordreJFG (isin, Nom, ticker, code_yahoo) VALUES (?, ?, ?, ?)");
|
||||||
|
$success = $stmt->execute([$_POST['isin'], $_POST['Nom'], $_POST['ticker'], $_POST['code_yahoo']]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => $success]);
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
try {
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
$sql = "UPDATE ordreGF_pied SET
|
||||||
|
Date_op = :date,
|
||||||
|
Quantite = :qte,
|
||||||
|
Prix_brut = :prix,
|
||||||
|
Frais_brocker = :f_b,
|
||||||
|
Frais_etat = :f_e,
|
||||||
|
Frais_autre = :f_a,
|
||||||
|
Ordre = :ordre,
|
||||||
|
Type = :type,
|
||||||
|
Etat = :etat
|
||||||
|
WHERE Id = :id";
|
||||||
|
|
||||||
|
$stmt = $db->prepare($sql);
|
||||||
|
|
||||||
|
$stmt->execute([
|
||||||
|
':date' => $_POST['Date_op'],
|
||||||
|
':qte' => $_POST['Quantite'],
|
||||||
|
':prix' => $_POST['Prix_brut'],
|
||||||
|
':f_b' => $_POST['Frais_brocker'],
|
||||||
|
':f_e' => $_POST['Frais_etat'],
|
||||||
|
':f_a' => $_POST['Frais_autre'],
|
||||||
|
':ordre' => $_POST['Ordre'],
|
||||||
|
':type' => $_POST['Type'],
|
||||||
|
':etat' => $_POST['Etat'],
|
||||||
|
':id' => $_POST['id']
|
||||||
|
]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => true]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo json_encode([
|
||||||
|
'success' => false,
|
||||||
|
'message' => $e->getMessage()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
try {
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Mise à jour de la table ordreJFG_pied
|
||||||
|
$sql = "UPDATE ordreJFG_pied SET
|
||||||
|
Date_op = :date,
|
||||||
|
Quantite = :qte,
|
||||||
|
Prix_brut = :prix,
|
||||||
|
Frais_brocker = :f_b,
|
||||||
|
Frais_etat = :f_e,
|
||||||
|
Frais_autre = :f_a,
|
||||||
|
Ordre = :ordre,
|
||||||
|
Type = :type,
|
||||||
|
Etat = :etat
|
||||||
|
WHERE Id = :id";
|
||||||
|
|
||||||
|
$stmt = $db->prepare($sql);
|
||||||
|
|
||||||
|
$stmt->execute([
|
||||||
|
':date' => $_POST['Date_op'],
|
||||||
|
':qte' => $_POST['Quantite'],
|
||||||
|
':prix' => $_POST['Prix_brut'],
|
||||||
|
':f_b' => $_POST['Frais_brocker'],
|
||||||
|
':f_e' => $_POST['Frais_etat'],
|
||||||
|
':f_a' => $_POST['Frais_autre'],
|
||||||
|
':ordre' => $_POST['Ordre'],
|
||||||
|
':type' => $_POST['Type'],
|
||||||
|
':etat' => $_POST['Etat'],
|
||||||
|
':id' => $_POST['id']
|
||||||
|
]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => true]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo json_encode([
|
||||||
|
'success' => false,
|
||||||
|
'message' => $e->getMessage()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Récupération des données POST
|
||||||
|
$id = $_POST['id'];
|
||||||
|
$nom = $_POST['nom'];
|
||||||
|
$ticker = $_POST['ticker'];
|
||||||
|
|
||||||
|
try {
|
||||||
|
$stmt = $db->prepare("UPDATE ordreGF SET nom = ?, ticker = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$nom, $ticker, $id]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => true]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Récupération des données POST
|
||||||
|
$id = $_POST['id'];
|
||||||
|
$nom = $_POST['nom'];
|
||||||
|
$ticker = $_POST['ticker'];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Mise à jour de la table ordreJFG
|
||||||
|
$stmt = $db->prepare("UPDATE ordreJFG SET Nom = ?, ticker = ? WHERE ID = ?");
|
||||||
|
$stmt->execute([$nom, $ticker, $id]);
|
||||||
|
|
||||||
|
echo json_encode(['success' => true]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
$isin = $_GET['isin'] ?? '';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
$stmt = $db->prepare("SELECT * FROM actions WHERE isin = ?");
|
||||||
|
$stmt->execute([$isin]);
|
||||||
|
$action = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
echo json_encode($action ? ['success' => true, ...$action] : ['success' => false]);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
$isin = $_GET['isin'] ?? '';
|
||||||
|
$db = (new App\Database\Database())->getConnection();
|
||||||
|
|
||||||
|
// Si vous avez aussi une table actions_jfg spécifique, remplacez 'actions' par 'actions_jfg'
|
||||||
|
$stmt = $db->prepare("SELECT * FROM actions WHERE isin = ?");
|
||||||
|
$stmt->execute([$isin]);
|
||||||
|
$action = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
echo json_encode($action ? ['success' => true, ...$action] : ['success' => false]);
|
||||||
+3
-1
@@ -1,9 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Bourse - Page d'Accueil</title>
|
<title>Bourse</title>
|
||||||
<link rel="stylesheet" href="/css/style.css">
|
<link rel="stylesheet" href="/css/style.css">
|
||||||
<?php if (!empty($pageStylesheets) && is_array($pageStylesheets)): ?>
|
<?php if (!empty($pageStylesheets) && is_array($pageStylesheets)): ?>
|
||||||
<?php foreach ($pageStylesheets as $sheet): ?>
|
<?php foreach ($pageStylesheets as $sheet): ?>
|
||||||
@@ -12,6 +13,7 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<link rel="shortcut icon" href="/assets/images/favicon.png" type="image/x-icon">
|
<link rel="shortcut icon" href="/assets/images/favicon.png" type="image/x-icon">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="<?= !empty($bodyClass) ? htmlspecialchars($bodyClass, ENT_QUOTES, 'UTF-8') : '' ?>">
|
<body class="<?= !empty($bodyClass) ? htmlspecialchars($bodyClass, ENT_QUOTES, 'UTF-8') : '' ?>">
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
+58
-59
@@ -17,71 +17,70 @@ $bodyClass = 'menu-page';
|
|||||||
require_once __DIR__ . '/header.php';
|
require_once __DIR__ . '/header.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section class="menu-shell">
|
<section class="menu-shell">
|
||||||
<article class="menu-card">
|
<article class="menu-card">
|
||||||
<header class="menu-card__header">
|
<header class="menu-card__header">
|
||||||
<div>
|
<div>
|
||||||
<h2 class="menu-card__title">Espace de gestion</h2>
|
<h2 class="menu-card__title">Espace de gestion</h2>
|
||||||
<p class="menu-card__subtitle">Accédez aux fonctions clés de l'application financière.</p>
|
<p class="menu-card__subtitle">Accédez aux fonctions clés de l'application financière.</p>
|
||||||
|
</div>
|
||||||
|
<span class="menu-card__badge">v1.0</span>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<form name="menu" class="menu-grid" action="#" method="post" autocomplete="off" novalidate>
|
||||||
|
<button type="button" class="menu-button" data-target="/php/ordreGF.php">
|
||||||
|
<div class="menu-button__content">
|
||||||
|
<span class="menu-button__title">Ordre GF</span>
|
||||||
|
<span class="menu-button__text">Voir et modifier les ordres GF</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="menu-card__badge">v1.0</span>
|
<span class="menu-button__icon">⇄</span>
|
||||||
</header>
|
</button>
|
||||||
|
|
||||||
<form name="menu" class="menu-grid" action="#" method="post" autocomplete="off" novalidate>
|
<button type="button" class="menu-button" data-target="/php/ordreJFG.php">
|
||||||
<button type="button" class="menu-button" data-target="/php/order_gf.php">
|
<div class="menu-button__content">
|
||||||
<div class="menu-button__content">
|
<span class="menu-button__title">Ordre JFG</span>
|
||||||
<span class="menu-button__title">Ordre GF</span>
|
<span class="menu-button__text">Voir et modifier les ordres JFG</span>
|
||||||
<span class="menu-button__text">Voir et modifier les ordres GF</span>
|
</div>
|
||||||
</div>
|
<span class="menu-button__icon">⇄</span>
|
||||||
<span class="menu-button__icon">⇄</span>
|
</button>
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="button" class="menu-button" data-target="/php/order_jfg.php">
|
<button type="button" class="menu-button" data-target="/php/compteGF.php">
|
||||||
<div class="menu-button__content">
|
<div class="menu-button__content">
|
||||||
<span class="menu-button__title">Ordre JFG</span>
|
<span class="menu-button__title">Compte GF</span>
|
||||||
<span class="menu-button__text">Voir et modifier les ordres JFG</span>
|
<span class="menu-button__text">Voir et modifier le compte GF</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="menu-button__icon">⇄</span>
|
<span class="menu-button__icon">💼</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button type="button" class="menu-button" data-target="/php/compteGF.php">
|
<button type="button" class="menu-button" data-target="/php/compteJFG.php">
|
||||||
<div class="menu-button__content">
|
<div class="menu-button__content">
|
||||||
<span class="menu-button__title">Compte GF</span>
|
<span class="menu-button__title">Compte JFG</span>
|
||||||
<span class="menu-button__text">Voir et modifier le compte GF</span>
|
<span class="menu-button__text">Voir et modifier le compte JFG</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="menu-button__icon">💼</span>
|
<span class="menu-button__icon">💼</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button type="button" class="menu-button" data-target="/php/compteJFG.php">
|
<button type="button" class="menu-button" data-target="/php/actions.php">
|
||||||
<div class="menu-button__content">
|
<div class="menu-button__content">
|
||||||
<span class="menu-button__title">Compte JFG</span>
|
<span class="menu-button__title">Actions</span>
|
||||||
<span class="menu-button__text">Voir et modifier le compte JFG</span>
|
<span class="menu-button__text">Créer, voir et modifier les actions</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="menu-button__icon">💼</span>
|
<span class="menu-button__icon">⚡</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button type="button" class="menu-button" data-target="/php/actions.php">
|
<button type="button" class="menu-button" data-target="/php/csv.php">
|
||||||
<div class="menu-button__content">
|
<div class="menu-button__content">
|
||||||
<span class="menu-button__title">Actions</span>
|
<span class="menu-button__title">CSV</span>
|
||||||
<span class="menu-button__text">Créer, voir et modifier les actions</span>
|
<span class="menu-button__text">Importer / exporter les actions</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="menu-button__icon">⚡</span>
|
<span class="menu-button__icon">📁</span>
|
||||||
</button>
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<button type="button" class="menu-button" data-target="/php/csv.php">
|
<p class="menu-note">Giraud Finance : Accès sécurisé. Veillez à fermer votre session après chaque utilisation.</p>
|
||||||
<div class="menu-button__content">
|
</article>
|
||||||
<span class="menu-button__title">CSV</span>
|
</section>
|
||||||
<span class="menu-button__text">Importer / exporter les actions</span>
|
|
||||||
</div>
|
|
||||||
<span class="menu-button__icon">📁</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<p class="menu-note">Giraud Finance : Accès sécurisé. Veillez à fermer votre session après chaque utilisation.</p>
|
<script src="/js/menu.js" defer></script>
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<script src="/js/menu.js" defer></script>
|
|
||||||
|
|
||||||
<?php require_once __DIR__ . '/footer.php'; ?>
|
|
||||||
|
|
||||||
|
<?php require_once __DIR__ . '/footer.php'; ?>
|
||||||
+370
@@ -0,0 +1,370 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
require_once __DIR__ . '/session.php';
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
if (empty($_SESSION['user_id'])) {
|
||||||
|
header('Location: ../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*A supprimer quand la page fonctionnera correctement*/
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
/**************************************************** */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$pageStylesheets = ['/css/ordreGF.css'];
|
||||||
|
$bodyClass = 'ordregf-page';
|
||||||
|
|
||||||
|
$database = new App\Database\Database();
|
||||||
|
$connection = $database->getConnection();
|
||||||
|
|
||||||
|
function fetchOrdreGF(PDO $connection): array
|
||||||
|
{
|
||||||
|
$stmt = $connection->query('SELECT * FROM `ordreGF` ORDER BY `ID` DESC');
|
||||||
|
return $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchOrdreGFPied(PDO $connection, string $masterId): array
|
||||||
|
{
|
||||||
|
$stmt = $connection->prepare('SELECT * FROM `ordreGF_pied` WHERE `Id_entete` = :masterId ORDER BY `Id` ASC');
|
||||||
|
$stmt->execute([':masterId' => $masterId]);
|
||||||
|
return $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$ordres = fetchOrdreGF($connection);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/header.php';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section class="ordregf-shell">
|
||||||
|
<div class="ordregf-card">
|
||||||
|
<header class="ordregf-card-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px;">
|
||||||
|
<h1 class="ordregf-title">Gestion des ordres GF</h1>
|
||||||
|
<div style="display: flex; gap: 10px;">
|
||||||
|
<button type="button" class="ordregf-btn-creer" onclick="document.getElementById('modalCreerOrdre').showModal();">Créer un ordre</button>
|
||||||
|
<button type="button" class="ordregf-btn-menu" onclick="window.location.href='/php/menu.php';">Retour au menu</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="ordregf-table-wrapper">
|
||||||
|
<table class="ordregf-table">
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($ordres as $ordre): ?>
|
||||||
|
<?php
|
||||||
|
$details = fetchOrdreGFPied($connection, (string)$ordre['ID']);
|
||||||
|
$totalQ = 0;
|
||||||
|
|
||||||
|
// Détection d'un ordre annulé
|
||||||
|
$isCanceled = false;
|
||||||
|
|
||||||
|
foreach ($details as $d) {
|
||||||
|
if (strtolower($d['Etat'] ?? '') === 'annulé') {
|
||||||
|
$isCanceled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Calcul du total des quantités actives
|
||||||
|
foreach ($details as $d) {
|
||||||
|
if (strtolower($d['Etat'] ?? '') === 'actif') {
|
||||||
|
$q = (int)($d['Quantite'] ?? 0);
|
||||||
|
$oType = strtolower($d['Ordre'] ?? '');
|
||||||
|
$tOp = strtolower($d['Type'] ?? '');
|
||||||
|
$signe = ($tOp === 'long') ? ($oType === 'achat' ? 1 : -1) : ($oType === 'achat' ? -1 : 1);
|
||||||
|
$totalQ += ($q * $signe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Calcul Plus-Value et Mise à jour statut
|
||||||
|
$plusvalue = 0.0000;
|
||||||
|
|
||||||
|
if ($isCanceled) {
|
||||||
|
$plusvalue = 0;
|
||||||
|
|
||||||
|
if ((float)$ordre['PlusValue'] != 0) {
|
||||||
|
$connection->prepare(
|
||||||
|
"UPDATE ordreGF SET PlusValue = 0 WHERE ID = ?"
|
||||||
|
)->execute([$ordre['ID']]);
|
||||||
|
|
||||||
|
$ordre['PlusValue'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$isSold = (!$isCanceled && $totalQ === 0 && count($details) > 0);
|
||||||
|
|
||||||
|
if ($isSold) {
|
||||||
|
foreach ($details as $detail) {
|
||||||
|
$qte = (int)$detail['Quantite'];
|
||||||
|
$fraisDetail = (float)$detail['Frais_brocker'] + (float)$detail['Frais_etat'] + (float)$detail['Frais_autre'];
|
||||||
|
$oType = strtolower($detail['Ordre']);
|
||||||
|
$prixNet = ($oType === 'vente') ? (float)$detail['Prix_brut'] - $fraisDetail : (float)$detail['Prix_brut'] + $fraisDetail;
|
||||||
|
$tOp = strtolower($detail['Type']);
|
||||||
|
$signePV = ($oType === 'vente') ? 1 : -1;
|
||||||
|
$plusvalue += ($qte * $prixNet * $signePV);
|
||||||
|
}
|
||||||
|
$plusvalue = round($plusvalue, 4);
|
||||||
|
|
||||||
|
// Mise à jour de la plus-value uniquement si nécessaire
|
||||||
|
if (abs((float)$ordre['PlusValue'] - $plusvalue) > 0.0001) {
|
||||||
|
$connection->prepare(
|
||||||
|
"UPDATE ordreGF SET PlusValue = ? WHERE ID = ?"
|
||||||
|
)->execute([$plusvalue, $ordre['ID']]);
|
||||||
|
|
||||||
|
$ordre['PlusValue'] = $plusvalue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si la quantité totale est à zéro, toutes les lignes actives passent en soldé
|
||||||
|
$connection->prepare(
|
||||||
|
"UPDATE ordreGF_pied
|
||||||
|
SET Etat = 'soldé'
|
||||||
|
WHERE Id_entete = ?
|
||||||
|
AND Etat = 'actif'"
|
||||||
|
)->execute([$ordre['ID']]);
|
||||||
|
|
||||||
|
// Recharge les données après modification
|
||||||
|
$details = fetchOrdreGFPied($connection, (string)$ordre['ID']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Désactivation si ordre soldé ou annulé
|
||||||
|
$isDisabled = $isCanceled || abs((float)$ordre['PlusValue']) > 0.0001;
|
||||||
|
|
||||||
|
$disabledAttr = $isDisabled
|
||||||
|
? 'disabled style="opacity:0.5; cursor:not-allowed;"'
|
||||||
|
: '';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr class="ordregf-master-row ordregf-header-style">
|
||||||
|
<td colspan="11" style="font-weight: bold; font-size: 1.1em; color: #fff;">
|
||||||
|
<?php echo htmlspecialchars((string)$ordre['isin']) . ' --- ' . htmlspecialchars((string)$ordre['Nom']) . ' ( ' . htmlspecialchars((string)$ordre['ticker']) . ' )'; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="ordregf-detail-block">
|
||||||
|
<td colspan="11">
|
||||||
|
<table class="ordregf-detail-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Qté</th>
|
||||||
|
<th>Prix Brut</th>
|
||||||
|
<th>Frais</th>
|
||||||
|
<th>Prix Net</th>
|
||||||
|
<th>Eng. Brut</th>
|
||||||
|
<th>Eng. Net</th>
|
||||||
|
<th>Ordre</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Etat</th>
|
||||||
|
<th style="text-align: right;"><button type="button" class="ordregf-btn-creer-petit ordregf-btn-petit" <?= $disabledAttr ?> onclick="document.getElementById('Id_entete_detail').value='<?= $ordre['ID'] ?>'; document.getElementById('modalCreerDetail').showModal();">Créer</button></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$engaBrut = 0;
|
||||||
|
$engaNet = 0;
|
||||||
|
foreach ($details as $detail):
|
||||||
|
$qte = (int)($detail['Quantite'] ?? 0);
|
||||||
|
$prix = (float)($detail['Prix_brut'] ?? 0);
|
||||||
|
$frais = (float)($detail['Frais_brocker'] ?? 0) + (float)($detail['Frais_etat'] ?? 0) + (float)($detail['Frais_autre'] ?? 0);
|
||||||
|
$ordreType = strtolower($detail['Ordre'] ?? '');
|
||||||
|
$prixNet = ($ordreType === 'vente') ? $prix - $frais : $prix + $frais;
|
||||||
|
$date = !empty($detail['Date_op']) ? date('d/m/Y', strtotime($detail['Date_op'])) : '--/--/----';
|
||||||
|
if (strtolower($detail['Etat'] ?? '') === 'actif') {
|
||||||
|
$mult = (strtolower($detail['Type'] ?? '') === 'long' ? 1 : -1) * (strtolower($detail['Ordre'] ?? '') === 'achat' ? 1 : -1);
|
||||||
|
$engaBrut += ($qte * $prix) * $mult;
|
||||||
|
$engaNet += ($qte * $prixNet) * $mult;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?= htmlspecialchars($date) ?></td>
|
||||||
|
<td class="text-right"><?= $qte ?></td>
|
||||||
|
<td class="text-right"><?= number_format($prix, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($frais, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($prixNet, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($qte * $prix, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($qte * $prixNet, 3, ',', ' ') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Ordre'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Type'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Etat'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><button type=" button" class="ordregf-btn-petit ordregf-btn-modifier-petit" <?= $disabledAttr ?> data-detail='<?= htmlspecialchars(json_encode($detail), ENT_QUOTES, 'UTF-8') ?>'>Modifier</button></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php if ($isDisabled): ?>
|
||||||
|
<tr style="background-color: rgba(255, 255, 255, 0.08); font-weight: bold;">
|
||||||
|
<td colspan="6" style="text-align: right;">Plus value :</td>
|
||||||
|
<td style="color: <?= (float)$ordre['PlusValue'] < 0 ? 'red' : 'green' ?>;"><?= number_format((float)$ordre['PlusValue'], 3, ',', ' ') ?></td>
|
||||||
|
<td colspan="4"></td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<tr style="background-color: rgba(255, 255, 255, 0.08); font-weight: bold;">
|
||||||
|
<td style="text-align: right;">TOTAL :</td>
|
||||||
|
<td class="text-right"><?= number_format($totalQ, 0, ',', ' ') ?></td>
|
||||||
|
<?php if ($totalQ == 0): ?>
|
||||||
|
<td class="text-right">0</td>
|
||||||
|
<td class="text-right">0</td>
|
||||||
|
<td class="text-right">0</td>
|
||||||
|
<?php else: ?>
|
||||||
|
<td class="text-right"><?= number_format($engaBrut / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet / $totalQ - $engaBrut / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<?php endif; ?>
|
||||||
|
<td class="text-right"><?= number_format($engaBrut, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet, 3, ',', ' ') ?></td>
|
||||||
|
<td colspan="4"></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Modals -->
|
||||||
|
<dialog id="modalCreerOrdre" class="ordregf-modal">
|
||||||
|
<form id="formCreerOrdre">
|
||||||
|
<h2>Créer un nouvel ordre</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>ISIN</label>
|
||||||
|
<input type="text" id="isinRecherche" name="isin" required>
|
||||||
|
<button type="button" id="btnRechercher">Rechercher</button>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Nom :</label>
|
||||||
|
<input type="text" name="Nom" id="Nom" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ticker :</label>
|
||||||
|
<input type="text" name="ticker" id="ticker" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Code Yahoo :</label>
|
||||||
|
<input type="text" name="code_yahoo" id="code_yahoo" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" id="btnAnnuler">Annuler</button>
|
||||||
|
<button type="submit" id="btnValider" disabled>Valider</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<dialog id="modalCreerDetail" class="ordregf-modal">
|
||||||
|
<form id="formCreerDetail">
|
||||||
|
<input type="hidden" name="Id_entete" id="Id_entete_detail">
|
||||||
|
<h2>Ajouter un mouvement</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Date :</label>
|
||||||
|
<input type="date" name="Date_op" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quantité :</label>
|
||||||
|
<input type="number" name="Quantite" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Prix Brut :</label>
|
||||||
|
<input type="number" step="0.001" name="Prix_brut" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frais</label>
|
||||||
|
<div class="triple">
|
||||||
|
<input type="number" step="0.01" name="Frais_brocker" placeholder="Broker">
|
||||||
|
<input type="number" step="0.01" name="Frais_etat" placeholder="État">
|
||||||
|
<input type="number" step="0.01" name="Frais_autre" placeholder="Autre">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ordre (Achat/Vente) :</label>
|
||||||
|
<select name="Ordre">
|
||||||
|
<option value="achat">achat</option>
|
||||||
|
<option value="vente">vente</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Type (Long/Short) :</label>
|
||||||
|
<select name="Type">
|
||||||
|
<option value="long">long</option>
|
||||||
|
<option value="short">short</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Etat :</label>
|
||||||
|
<select name="Etat">
|
||||||
|
<option value="actif">actif</option>
|
||||||
|
<option value="annulé">annulé</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" onclick="document.getElementById('modalCreerDetail').close()">Annuler</button>
|
||||||
|
<button type="submit">Valider</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<dialog id="modalModifierDetail" class="ordregf-modal">
|
||||||
|
<form id="formModifierDetail">
|
||||||
|
<input type="hidden" name="id" id="edit_id">
|
||||||
|
<input type="hidden" name="Id_entete" id="edit_Id_entete">
|
||||||
|
<h2>Modifier le mouvement</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Date :</label>
|
||||||
|
<input type="date" name="Date_op" id="edit_date" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quantité :</label>
|
||||||
|
<input type="number" name="Quantite" id="edit_quantite" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Prix Brut :</label>
|
||||||
|
<input type="number" step="0.001" name="Prix_brut" id="edit_prix" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frais</label>
|
||||||
|
<div class="triple">
|
||||||
|
<input type="number" step="0.01" name="Frais_brocker" id="edit_frais_broker" placeholder="Broker">
|
||||||
|
<input type="number" step="0.01" name="Frais_etat" id="edit_frais_etat" placeholder="État">
|
||||||
|
<input type="number" step="0.01" name="Frais_autre" id="edit_frais_autre" placeholder="Autre">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ordre :</label>
|
||||||
|
<select name="Ordre" id="edit_ordre">
|
||||||
|
<option value="achat">achat</option>
|
||||||
|
<option value="vente">vente</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Type :</label>
|
||||||
|
<select name="Type" id="edit_type">
|
||||||
|
<option value="long">long</option>
|
||||||
|
<option value="short">short</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Etat :</label>
|
||||||
|
<select name="Etat" id="edit_etat">
|
||||||
|
<option value="actif">actif</option>
|
||||||
|
<option value="annulé">annulé</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" onclick="document.getElementById('modalModifierDetail').close()">Annuler</button>
|
||||||
|
<button type="submit">Enregistrer</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<script src="/js/ordreGF.js" defer></script>
|
||||||
|
|
||||||
|
<?php require_once __DIR__ . '/footer.php'; ?>
|
||||||
@@ -0,0 +1,337 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
require_once __DIR__ . '/session.php';
|
||||||
|
require_once __DIR__ . '/db.php';
|
||||||
|
|
||||||
|
if (empty($_SESSION['user_id'])) {
|
||||||
|
header('Location: ../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*A supprimer quand la page fonctionnera correctement*/
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
/**************************************************** */
|
||||||
|
|
||||||
|
$pageStylesheets = ['/css/ordreJFG.css'];
|
||||||
|
$bodyClass = 'ordrejfg-page';
|
||||||
|
|
||||||
|
$database = new App\Database\Database();
|
||||||
|
$connection = $database->getConnection();
|
||||||
|
|
||||||
|
function fetchOrdreJFG(PDO $connection): array
|
||||||
|
{
|
||||||
|
$stmt = $connection->query('SELECT * FROM `ordreJFG` ORDER BY `ID` DESC');
|
||||||
|
return $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchOrdreJFGPied(PDO $connection, string $masterId): array
|
||||||
|
{
|
||||||
|
$stmt = $connection->prepare('SELECT * FROM `ordreJFG_pied` WHERE `Id_entete` = :masterId ORDER BY `Id` ASC');
|
||||||
|
$stmt->execute([':masterId' => $masterId]);
|
||||||
|
return $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$ordres = fetchOrdreJFG($connection);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/header.php';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section class="ordrejfg-shell">
|
||||||
|
<div class="ordrejfg-card">
|
||||||
|
<header class="ordrejfg-card-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px;">
|
||||||
|
<h1 class="ordrejfg-title">Gestion des ordres JFG</h1>
|
||||||
|
<div style="display: flex; gap: 10px;">
|
||||||
|
<button type="button" class="ordrejfg-btn-creer" onclick="document.getElementById('modalCreerOrdre').showModal();">Créer un ordre</button>
|
||||||
|
<button type="button" class="ordrejfg-btn-menu" onclick="window.location.href='/php/menu.php';">Retour au menu</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="ordrejfg-table-wrapper">
|
||||||
|
<table class="ordrejfg-table">
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($ordres as $ordre): ?>
|
||||||
|
<?php
|
||||||
|
$details = fetchOrdreJFGPied($connection, (string)$ordre['ID']);
|
||||||
|
$totalQ = 0;
|
||||||
|
|
||||||
|
// Détection d'un ordre annulé
|
||||||
|
$isCanceled = false;
|
||||||
|
foreach ($details as $d) {
|
||||||
|
if (strtolower($d['Etat'] ?? '') === 'annulé') {
|
||||||
|
$isCanceled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Calcul du total des quantités actives
|
||||||
|
foreach ($details as $d) {
|
||||||
|
if (strtolower($d['Etat'] ?? '') === 'actif') {
|
||||||
|
$q = (int)($d['Quantite'] ?? 0);
|
||||||
|
$oType = strtolower($d['Ordre'] ?? '');
|
||||||
|
$tOp = strtolower($d['Type'] ?? '');
|
||||||
|
$signe = ($tOp === 'long') ? ($oType === 'achat' ? 1 : -1) : ($oType === 'achat' ? -1 : 1);
|
||||||
|
$totalQ += ($q * $signe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Calcul Plus-Value et Mise à jour statut
|
||||||
|
$plusvalue = 0.0000;
|
||||||
|
if ($isCanceled) {
|
||||||
|
$plusvalue = 0;
|
||||||
|
if ((float)$ordre['PlusValue'] != 0) {
|
||||||
|
$connection->prepare("UPDATE ordreJFG SET PlusValue = 0 WHERE ID = ?")->execute([$ordre['ID']]);
|
||||||
|
$ordre['PlusValue'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$isSold = (!$isCanceled && $totalQ === 0 && count($details) > 0);
|
||||||
|
if ($isSold) {
|
||||||
|
foreach ($details as $detail) {
|
||||||
|
$qte = (int)$detail['Quantite'];
|
||||||
|
$fraisDetail = (float)$detail['Frais_brocker'] + (float)$detail['Frais_etat'] + (float)$detail['Frais_autre'];
|
||||||
|
$oType = strtolower($detail['Ordre']);
|
||||||
|
$prixNet = ($oType === 'vente') ? (float)$detail['Prix_brut'] - $fraisDetail : (float)$detail['Prix_brut'] + $fraisDetail;
|
||||||
|
$tOp = strtolower($detail['Type']);
|
||||||
|
$signePV = ($oType === 'vente') ? 1 : -1;
|
||||||
|
$plusvalue += ($qte * $prixNet * $signePV);
|
||||||
|
}
|
||||||
|
$plusvalue = round($plusvalue, 4);
|
||||||
|
|
||||||
|
if (abs((float)$ordre['PlusValue'] - $plusvalue) > 0.0001) {
|
||||||
|
$connection->prepare("UPDATE ordreJFG SET PlusValue = ? WHERE ID = ?")->execute([$plusvalue, $ordre['ID']]);
|
||||||
|
$ordre['PlusValue'] = $plusvalue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$connection->prepare("UPDATE ordreJFG_pied SET Etat = 'soldé' WHERE Id_entete = ? AND Etat = 'actif'")->execute([$ordre['ID']]);
|
||||||
|
$details = fetchOrdreJFGPied($connection, (string)$ordre['ID']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$isDisabled = $isCanceled || abs((float)$ordre['PlusValue']) > 0.0001;
|
||||||
|
$disabledAttr = $isDisabled ? 'disabled style="opacity:0.5; cursor:not-allowed;"' : '';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr class="ordrejfg-master-row ordrejfg-header-style">
|
||||||
|
<td colspan="11" style="font-weight: bold; font-size: 1.1em; color: #fff;">
|
||||||
|
<?php echo htmlspecialchars((string)$ordre['isin']) . ' --- ' . htmlspecialchars((string)$ordre['Nom']) . ' ( ' . htmlspecialchars((string)$ordre['ticker']) . ' )'; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="ordrejfg-detail-block">
|
||||||
|
<td colspan="11">
|
||||||
|
<table class="ordrejfg-detail-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Qté</th>
|
||||||
|
<th>Prix Brut</th>
|
||||||
|
<th>Frais</th>
|
||||||
|
<th>Prix Net</th>
|
||||||
|
<th>Eng. Brut</th>
|
||||||
|
<th>Eng. Net</th>
|
||||||
|
<th>Ordre</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Etat</th>
|
||||||
|
<th style="text-align: right;"><button type="button" class="ordrejfg-btn-creer-petit ordrejfg-btn-petit" <?= $disabledAttr ?> onclick="document.getElementById('Id_entete_detail').value='<?= $ordre['ID'] ?>'; document.getElementById('modalCreerDetail').showModal();">Créer</button></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$engaBrut = 0;
|
||||||
|
$engaNet = 0;
|
||||||
|
foreach ($details as $detail):
|
||||||
|
$qte = (int)($detail['Quantite'] ?? 0);
|
||||||
|
$prix = (float)($detail['Prix_brut'] ?? 0);
|
||||||
|
$frais = (float)($detail['Frais_brocker'] ?? 0) + (float)($detail['Frais_etat'] ?? 0) + (float)($detail['Frais_autre'] ?? 0);
|
||||||
|
$ordreType = strtolower($detail['Ordre'] ?? '');
|
||||||
|
$prixNet = ($ordreType === 'vente') ? $prix - $frais : $prix + $frais;
|
||||||
|
$date = !empty($detail['Date_op']) ? date('d/m/Y', strtotime($detail['Date_op'])) : '--/--/----';
|
||||||
|
if (strtolower($detail['Etat'] ?? '') === 'actif') {
|
||||||
|
$mult = (strtolower($detail['Type'] ?? '') === 'long' ? 1 : -1) * (strtolower($detail['Ordre'] ?? '') === 'achat' ? 1 : -1);
|
||||||
|
$engaBrut += ($qte * $prix) * $mult;
|
||||||
|
$engaNet += ($qte * $prixNet) * $mult;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?= htmlspecialchars($date) ?></td>
|
||||||
|
<td class="text-right"><?= $qte ?></td>
|
||||||
|
<td class="text-right"><?= number_format($prix, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($frais, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($prixNet, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($qte * $prix, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($qte * $prixNet, 3, ',', ' ') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Ordre'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Type'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><?= htmlspecialchars($detail['Etat'] ?? '') ?></td>
|
||||||
|
<td style="text-align: center"><button type="button" class="ordrejfg-btn-petit ordrejfg-btn-modifier-petit" <?= $disabledAttr ?> data-detail='<?= htmlspecialchars(json_encode($detail), ENT_QUOTES, 'UTF-8') ?>'>Modifier</button></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<tr style="background-color: rgba(255, 255, 255, 0.08); font-weight: bold;">
|
||||||
|
<?php if ($isDisabled): ?>
|
||||||
|
<td colspan="6" style="text-align: right;">Plus value :</td>
|
||||||
|
<td style="color: <?= (float)$ordre['PlusValue'] < 0 ? 'red' : 'green' ?>;"><?= number_format((float)$ordre['PlusValue'], 3, ',', ' ') ?></td>
|
||||||
|
<td colspan="4"></td>
|
||||||
|
<?php else: ?>
|
||||||
|
<td style="text-align: right;">TOTAL :</td>
|
||||||
|
<td class="text-right"><?= number_format($totalQ, 0, ',', ' ') ?></td>
|
||||||
|
<?php if ($totalQ == 0): ?>
|
||||||
|
<td colspan="3" class="text-right">0</td>
|
||||||
|
<?php else: ?>
|
||||||
|
<td class="text-right"><?= number_format($engaBrut / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet / $totalQ - $engaBrut / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet / $totalQ, 3, ',', ' ') ?></td>
|
||||||
|
<?php endif; ?>
|
||||||
|
<td class="text-right"><?= number_format($engaBrut, 3, ',', ' ') ?></td>
|
||||||
|
<td class="text-right"><?= number_format($engaNet, 3, ',', ' ') ?></td>
|
||||||
|
<td colspan="4"></td>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<dialog id="modalCreerOrdre" class="ordrejfg-modal">
|
||||||
|
<form id="formCreerOrdre">
|
||||||
|
<h2>Créer un nouvel ordre</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>ISIN</label>
|
||||||
|
<input type="text" id="isinRecherche" name="isin" required>
|
||||||
|
<button type="button" id="btnRechercher">Rechercher</button>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Nom :</label>
|
||||||
|
<input type="text" name="Nom" id="Nom" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ticker :</label>
|
||||||
|
<input type="text" name="ticker" id="ticker" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Code Yahoo :</label>
|
||||||
|
<input type="text" name="code_yahoo" id="code_yahoo" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" id="btnAnnuler">Annuler</button>
|
||||||
|
<button type="submit" id="btnValider" disabled>Valider</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<dialog id="modalCreerDetail" class="ordrejfg-modal">
|
||||||
|
<form id="formCreerDetail">
|
||||||
|
<input type="hidden" name="Id_entete" id="Id_entete_detail">
|
||||||
|
<h2>Ajouter un mouvement</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Date :</label>
|
||||||
|
<input type="date" name="Date_op" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quantité :</label>
|
||||||
|
<input type="number" name="Quantite" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Prix Brut :</label>
|
||||||
|
<input type="number" step="0.001" name="Prix_brut" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frais</label>
|
||||||
|
<div class="triple">
|
||||||
|
<input type="number" step="0.01" name="Frais_brocker" placeholder="Broker">
|
||||||
|
<input type="number" step="0.01" name="Frais_etat" placeholder="État">
|
||||||
|
<input type="number" step="0.01" name="Frais_autre" placeholder="Autre">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ordre (Achat/Vente) :</label>
|
||||||
|
<select name="Ordre">
|
||||||
|
<option value="achat">achat</option>
|
||||||
|
<option value="vente">vente</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Type (Long/Short) :</label>
|
||||||
|
<select name="Type">
|
||||||
|
<option value="long">long</option>
|
||||||
|
<option value="short">short</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Etat :</label>
|
||||||
|
<select name="Etat">
|
||||||
|
<option value="actif">actif</option>
|
||||||
|
<option value="annulé">annulé</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" onclick="document.getElementById('modalCreerDetail').close()">Annuler</button>
|
||||||
|
<button type="submit">Valider</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<dialog id="modalModifierDetail" class="ordrejfg-modal">
|
||||||
|
<form id="formModifierDetail">
|
||||||
|
<input type="hidden" name="id" id="edit_id">
|
||||||
|
<input type="hidden" name="Id_entete" id="edit_Id_entete">
|
||||||
|
<h2>Modifier le mouvement</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Date :</label>
|
||||||
|
<input type="date" name="Date_op" id="edit_date" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quantité :</label>
|
||||||
|
<input type="number" name="Quantite" id="edit_quantite" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Prix Brut :</label>
|
||||||
|
<input type="number" step="0.001" name="Prix_brut" id="edit_prix" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frais</label>
|
||||||
|
<div class="triple">
|
||||||
|
<input type="number" step="0.01" name="Frais_brocker" id="edit_frais_broker" placeholder="Broker">
|
||||||
|
<input type="number" step="0.01" name="Frais_etat" id="edit_frais_etat" placeholder="État">
|
||||||
|
<input type="number" step="0.01" name="Frais_autre" id="edit_frais_autre" placeholder="Autre">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Ordre :</label>
|
||||||
|
<select name="Ordre" id="edit_ordre">
|
||||||
|
<option value="achat">achat</option>
|
||||||
|
<option value="vente">vente</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Type :</label>
|
||||||
|
<select name="Type" id="edit_type">
|
||||||
|
<option value="long">long</option>
|
||||||
|
<option value="short">short</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Etat :</label>
|
||||||
|
<select name="Etat" id="edit_etat">
|
||||||
|
<option value="actif">actif</option>
|
||||||
|
<option value="annulé">annulé</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="modal-actions" style="margin-top: 20px;">
|
||||||
|
<button type="button" onclick="document.getElementById('modalModifierDetail').close()">Annuler</button>
|
||||||
|
<button type="submit">Enregistrer</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
|
|
||||||
|
<script src="/js/ordreJFG.js" defer></script>
|
||||||
|
|
||||||
|
<?php require_once __DIR__ . '/footer.php'; ?>
|
||||||
+22
-3
@@ -1,6 +1,7 @@
|
|||||||
.
|
.
|
||||||
├── assets
|
├── assets
|
||||||
│ ├── csv
|
│ ├── csv
|
||||||
|
│ │ ├── actions.csv
|
||||||
│ │ ├── autre.csv
|
│ │ ├── autre.csv
|
||||||
│ │ ├── ibex35.csv
|
│ │ ├── ibex35.csv
|
||||||
│ │ ├── nasdaq100.csv
|
│ │ ├── nasdaq100.csv
|
||||||
@@ -12,20 +13,38 @@
|
|||||||
├── composer.json
|
├── composer.json
|
||||||
├── composer.lock
|
├── composer.lock
|
||||||
├── css
|
├── css
|
||||||
|
│ ├── 404.css
|
||||||
|
│ ├── actions.css
|
||||||
|
│ ├── compteGF.css
|
||||||
|
│ ├── compteJFG.css
|
||||||
|
│ ├── csv.css
|
||||||
|
│ ├── menu.css
|
||||||
│ └── style.css
|
│ └── style.css
|
||||||
├── index.php
|
├── index.php
|
||||||
├── js
|
├── js
|
||||||
|
│ ├── actions.js
|
||||||
|
│ ├── compteGF.js
|
||||||
|
│ ├── compteJFG.js
|
||||||
|
│ ├── csv.js
|
||||||
|
│ └── menu.js
|
||||||
├── php
|
├── php
|
||||||
│ ├── 404.php
|
│ ├── 404.php
|
||||||
|
│ ├── actions.php
|
||||||
|
│ ├── compteGF.php
|
||||||
|
│ ├── compteJFG.php
|
||||||
|
│ ├── csv.php
|
||||||
│ ├── db.php
|
│ ├── db.php
|
||||||
|
│ ├── download_csv.php
|
||||||
│ ├── footer.php
|
│ ├── footer.php
|
||||||
│ ├── forgot_password.php
|
│ ├── forgot_password.php
|
||||||
│ ├── header.php
|
│ ├── header.php
|
||||||
│ ├── login_process.php
|
│ ├── login_process.php
|
||||||
|
│ ├── logout.php
|
||||||
│ ├── menu.php
|
│ ├── menu.php
|
||||||
│ ├── register.php
|
│ ├── register.php
|
||||||
│ ├── reset_password.php
|
│ ├── reset_password.php
|
||||||
│ └── session.php
|
│ ├── session.php
|
||||||
|
│ └── update_csv.php
|
||||||
├── structure.txt
|
├── structure.txt
|
||||||
└── vendor
|
└── vendor
|
||||||
├── autoload.php
|
├── autoload.php
|
||||||
@@ -118,6 +137,6 @@
|
|||||||
│ └── SMTP.php
|
│ └── SMTP.php
|
||||||
└── VERSION
|
└── VERSION
|
||||||
|
|
||||||
13 directories, 106 files
|
13 directories, 125 files
|
||||||
|
|
||||||
tree > structure.txt
|
tree > structure.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user