<?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 ;
// entete de la page
include 'menu/header.php';


$DateSaisie_y = $_POST['DateSaisie_y'];
$DateSaisie_m = $_POST['DateSaisie_m'];
$DateSaisie_d = $_POST['DateSaisie_d'];
$Num_certificat=htmlentities($_POST['Num_certificat']);
$Num_abat=htmlentities($_POST['Num_abat']);
$poid_saisie=htmlentities($_POST['poid_saisie']);


$date = date("d-m-Y");

$date_saisie=date("d/m/y", mktime(0,0,0,$DateSaisie_m,$DateSaisie_d,$DateSaisie_y));

echo "<center><br>";
Echo "<table cellspacing=0 cellpadding=0 align=center border=0>";
Echo "<tbody>";
echo "<span class='t-text'><b>Saisies Abattoir</b></span> <b> : </b>";
echo "<a href='saisie_saisieabattoir.php'><b>Saise</b></a> <b> | </b>";
echo "<a href=''><b>Consulter</b></a> <b> | </b>";
echo "<a href=''><b>Modifier</b></a>";
Echo "</td></tr>";
Echo "</tbody>";
Echo "</table>";

echo "<br><font color='#FF0101'>Validation SAISIE ABATTOIR<br><br></font>";

echo "<form id='form1' name='form1' method='post' action='ajout_SaisieAbattoir.php'>";
echo "<table class='t-text' width='250' border='1' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<td>Date Saisie</td>";
echo "<td><input type='text' name='date_saisie' value='$date_saisie' size='15' /></td>";
 
echo "</tr>";
echo "<tr>";
echo "<td>Num Certificat</td>";
echo "<td><input type='text' name='Num_certificat' value='$Num_certificat' size='15' /></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Num Abat</td>";
echo "<td><input type='text' name='Num_abat' value='$Num_abat' size='5' /></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Poid Saisie</td>";
echo "<td><input type='text' name='Poid_Saisie' value='$poid_saisie' size='5' /> Kg</td>";
echo "</tr>";
$sql = "SELECT Poid_entre FROM entreabat WHERE Num_Abatage='$Num_abat'";  
$req = mysqli_query($link, $sql);    
while ($row = mysqli_fetch_assoc($req)) {
        $PoidEntre = $row["Poid_entre"];
    }  
echo "<tr>";
echo "<td>Poid origine</td>";
echo "<td><input type='text' name='PoidEntre' value='$PoidEntre' size='5' /> Kg</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Poid final</td>";
$poidFinal = $PoidEntre - $poid_saisie ;
echo "<td><input type='text' name='PoidFinal' value='$poidFinal' size='5' /> Kg</td>";
echo "</tr>";
echo "</table>";
echo "<br>";
echo "<form id='form1' name='form1' method='post' action='ajout_SaisieAbattoir.php'>";
echo "<input type='hidden' name='DateSaisie_y' value='$DateSaisie_y'/>";
echo "<input type='hidden' name='DateSaisie_m' value='$DateSaisie_m'/>";
echo "<input type='hidden' name='DateSaisie_d' value='$DateSaisie_d'/>";
echo "<input type='submit' value='O.K'>" ;



include 'menu/footer.php';
?>