Your IP : 216.73.216.212


Current Path : /home/ataenra/www/ATA/INTRANET/Admin/Gestion_Materiel/TypeProjet/Ensemble/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/Admin/Gestion_Materiel/TypeProjet/Ensemble/Delpack.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['IDmat']."'");
$PT = $pt->fetch();
$pt->closeCursor();
$P1= round($PT['T'], 2); 

//on calcul le prix de l'ensemble materiel
$pt = $dbco->query("SELECT SUM(PV_articles) AS T FROM ".$table_jointure_access." WHERE ID_ens ='".$_GET['IDmat']."'");
$PT = $pt->fetch();
$pt->closeCursor();
$P2= round($PT['T'], 2); 

//Addition Prix Materiel + Prix Pack/Articles/Ouvrages/Mo
$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");
?>