WIP: bolsa V 1.0
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
+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,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,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,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()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ $nom = $_POST['nom'];
|
|||||||
$ticker = $_POST['ticker'];
|
$ticker = $_POST['ticker'];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stmt = $db->prepare("UPDATE ordres SET nom = ?, ticker = ? WHERE id = ?");
|
$stmt = $db->prepare("UPDATE ordreGF SET nom = ?, ticker = ? WHERE id = ?");
|
||||||
$stmt->execute([$nom, $ticker, $id]);
|
$stmt->execute([$nom, $ticker, $id]);
|
||||||
|
|
||||||
echo json_encode(['success' => true]);
|
echo json_encode(['success' => true]);
|
||||||
|
|||||||
@@ -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,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]);
|
||||||
+4
-5
@@ -17,7 +17,7 @@ $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>
|
||||||
@@ -36,7 +36,7 @@ require_once __DIR__ . '/header.php';
|
|||||||
<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/ordreJFG.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 JFG</span>
|
||||||
<span class="menu-button__text">Voir et modifier les ordres JFG</span>
|
<span class="menu-button__text">Voir et modifier les ordres JFG</span>
|
||||||
@@ -79,9 +79,8 @@ require_once __DIR__ . '/header.php';
|
|||||||
|
|
||||||
<p class="menu-note">Giraud Finance : Accès sécurisé. Veillez à fermer votre session après chaque utilisation.</p>
|
<p class="menu-note">Giraud Finance : Accès sécurisé. Veillez à fermer votre session après chaque utilisation.</p>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script src="/js/menu.js" defer></script>
|
<script src="/js/menu.js" defer></script>
|
||||||
|
|
||||||
<?php require_once __DIR__ . '/footer.php'; ?>
|
<?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'; ?>
|
||||||
Reference in New Issue
Block a user