| Current Path : /home/a/t/a/ataenra/www/ATA/INTRANET/Admin/Gestion_Materiel/TypeProjet/Ensemble/ |
| Current File : /home/a/t/a/ataenra/www/ATA/INTRANET/Admin/Gestion_Materiel/TypeProjet/Ensemble/DelA.php |
<?php
$Del = $dbco->prepare("DELETE FROM ".$table_jointure_access." WHERE ID_join_articles = ".$_GET['IDjoin']."");
$Del->execute();
//on calcul le prix de l'ensemble materiel
$pt = $dbco->query("SELECT SUM(PV_p) AS T FROM ".$table_jointure." WHERE ID_ens ='".$_GET['IDm']."'");
$PT = $pt->fetch();
$pt->closeCursor();
$P1= round($PT['T'], 2);
//on calcul le prix de l'ensemble articles
$pt = $dbco->query("SELECT SUM(PV_articles) AS T FROM ".$table_jointure_access." WHERE ID_ens ='".$_GET['IDm']."'");
$PT = $pt->fetch();
$pt->closeCursor();
$P2= round($PT['T'], 2);
$PTT = $P1+$P2;
//on met a jour le prix du pack
$UP2 = $dbco->prepare("UPDATE $table_ensemble set ID_Ens = :id, ens_pv=:ens_pv where ID_Ens = :id");
$UP2->bindvalue('id',$_GET['IDmat']);
$UP2->bindvalue('ens_pv',$PTT);
$UP2->execute();
header("location:New_Ensemble.php?IDm=".$_GET['IDm']."&A=V");
?>