<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $A_NumArt,$i, $result, 
$NbLigne, $mygroupeart, $mysousgroupeart, $semaine, $limitesuivante, 
$limiteprecedente, $limite, $total, $page, $Nom_Client, $semaine ;
// entete de la page
/*
http://192.168.1.200/trace/consult_base_tarifs.php?
ordre=2
Num_Code_Tarifs=13
num_plu=18
*/

include 'menu/header.php';

$num_ordre=$_GET['ordre'];
$Num_Code_Tarifs=$_GET['Num_Code_Tarifs'];
$Num_Plu=$_GET['num_plu'];

//echo "$Num_Code_Tarifs | $Num_Plu | $Prix_HT | $Prix_TTC | $num_ordre<br>";

echo "<center><HR size='1' width='500'>";
echo "<center><b>Base Tarifs</b></center>" ;
echo "<center><HR size='1' width='500'>";

Menu_CSD ($num_ordre) ;
echo "<br>";
//echo "<br>";
echo "<table width='350' border='0' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<td width='50' height='20' valign='center'>
	<div align='center'><span class='w-text'>PLU :</td>";


$myart =new plu;
$select = 'SELECT * FROM `plu` WHERE `Num_PLU`='.$Num_Plu ;
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_plu_base=$myart->Num_PLU ;
  $nom_plu=$myart->PLU ;
}

$Code_Tva = 0 ;
echo "<td width='300' height='20' valign='center'>
	<div align='center'><span class='w-text'>$num_plu_base - $nom_plu</td></span>";
echo "</tr>";
echo "</table>";

echo "<br>";

echo "<table id='t01' width='500' border='1' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>Code Tarif</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>Tarif</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>PV.TTC Client</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>PV.HT</td>";
echo "</tr>";


$sql  = 'SELECT * FROM `Base_Tarifs` WHERE `Num_PLU`='.$num_plu_base.' ORDER BY `Base_Tarifs`.`Num_Code_Tarif` ASC';
$myart =new Base_Tarifs;
$result = mysqli_query($link, $sql);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_Base_Tarifs=$myart->Num_Base_Tarifs ;
  $Num_Code_Tarif=$myart->Num_Code_Tarif ;
  $Num_PLU=$myart->Num_PLU ;
  $Prix_HT =$myart->Prix_HT ;
  $Prix_TTC =$myart->Prix_TTC ;

$sql = "SELECT * FROM categorie_tarif WHERE Num_Code_Tarif='$Num_Code_Tarif'";  
$req = mysqli_query($link, $sql);  
while ($row = mysqli_fetch_assoc($req)) {
        $Code_Tarif = $row["Code_Tarif"];
        $Num_Code_Tarifs_base = $row["Num_Code_Tarif"];
    }     

echo "<tr>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>$Num_Code_Tarifs_base</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>$Code_Tarif</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>$Prix_TTC</td>";
echo "<td width='30' height='20' valign='center'>
	<div align='center'><span class='t-text'>$Prix_HT</td>";
echo "</tr>"; 
 
}
echo "</table>";

// Pied de Page



include 'menu/footer.php';
?>
