1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
include '/bdd_jung.php';
include "/Validation/vendor/autoload.php";
use Respect\Validation\Validator as v;
$sql=$bdd->prepare('SELECT offre_de_prix.offreNumero,offre_de_prix.offreDate, offre_de_prix.offreFinDate, clients.clientNom,clients.clientRemise,produits.produitRef,produits.produitPu,produits.produitDescription,categorie.categorieNom,projet.projetNom,commentaires.commentaireNom,offre_de_prix.offreQuantite,offre_de_prix.offreTotal,clients.clientNumero FROM offre_de_prix, clients, produits, categorie, projet, commentaires WHERE offre_de_prix.clientID=clients.clientID AND projet.clientID=clients.clientID AND produits.categorieId=categorie.categorieId ORDER BY offreNumero DESC LIMIT 1');
$reslt=$sql->execute();
$row = $sql->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT);
echo '<div class="form_inscription">';
echo'<h3>formulaire d\'offres de prix, inscription :</h3>';
echo'<form action="" method="post">';
echo'<label>numéro de l\'offre:</label>';
echo"<input type='text' name='offreNumero' value='$row[0]'>";
echo'<br>';
echo'<label>date de l\'offre :</label>';
echo"<input type='date' name='offreDate' value='$row[1]'>";
echo'<br>';
echo'<label>fin de l\'offre : </label>';
echo"<input type='date' name='offreFinDate' value='$row[2]'>";
echo'<br>';
echo'<label for="clientNom">nom du client:</label>';
echo"<input id='clientNom' type='text' name='clientNom' value='$row[3]'>";
echo'<br>';
echo'<label>numero du client:</label>';
echo"<input type='text' name='clientNumero' value='$row[13]'>";
echo'<br>';
echo'<label>Projet :</label>';
echo"<input type='text' name='projetNom' value='$row[9]'>";
echo'<br>';
echo'<label>Remise Client :</label>';
echo"<input type='number' name='clientRemise' value='$row[4]'>%";
echo'<br>';
echo '<label>Référence du produit : </label>';
echo"<input type='text' name='produitRef' value='$row[5]'>";
echo'<br>';
echo'<label>Catégorie du produit :</label>';
echo"<input type='text' name='categorieNom' value='$row[8]'>";
echo'<br>';
echo'<label>Description : </label>';
echo"<input type='text' name='produitDescription' value='$row[7]'>";
echo'<br>';
echo'<label>Quantité : </label>';
echo"<input type='text' name='offreQuantite' value='$row[11]'>";
echo'<br>';
echo'<label>P.U : </label>';
echo"<input type='number' name='produitPu' value='$row[6]'>";
echo'<br>';
echo'<label>Commentaires : </label>';
echo"<input type='text' name='commentaireNom' value='$row[10]'>";
echo'<br>';
echo'<label>Total :</label>';
$quantite=$row[11] ;
$PU=$row[6];
$TOTAL_SUM=$quantite*$PU;
echo"<input for='total' type='text' name='offreTotal' value='$TOTAL_SUM'>";
echo'<br>';
echo'<input type="submit" name="Envoyer" value="Envoyer">';
echo' ';
echo'<input type="submit" name="Modifier" value="Mise à jour">';
echo' ';
echo'<input type="submit" name="enregistrer" value="Enregistrer le pdf">';
echo'</form>';
echo'</div>';
if(isset($_POST['Modifier'])) {
$offreNumero1 = $_POST["offreNumero"];
$offreDate1 = $_POST["offreDate"];
$offreFinDate1 = $_POST["offreFinDate"];
$clientNom1 = $_POST["clientNom"];
$clientNumero1 = $_POST["clientNumero"];
$projetNom1 = $_POST["projetNom"];
$produitRef1 = $_POST["produitRef"];
$categorieNom1 = $_POST["categorieNom"];
$produitDescription1 = $_POST["produitDescription"];
$quantite1 = $_POST["offreQuantite"];
$produitPu1 = $_POST["produitPu"];
$clientRemise1 = $_POST["clientRemise"];
$commentaireNom1 = $_POST["commentaireNom"];
$total1 = $quantite1 * $produitPu1;
echo '<div class="div_form_MAJ_maj">';
echo 'Voulez-vous effectuer cette mise a jour?';
echo '<form action="script/maj_Script_jung.php" method="post">';
echo '<label>numéro de l\'offre:</label>';
echo "<input type='text' name='ofNumero' value='$offreNumero1'>";
echo '<br>';
echo '<label>date de l\'offre :</label>';
echo "<input type='date' name='ofDate' value='$offreDate1'>";
echo '<br>';
echo '<label>fin de l\'offre : </label>';
echo "<input type='date' name='ofFinDate' value='$offreFinDate1'>";
echo '<br>';
echo '<label>nom du client:</label>';
echo "<input type='text' name='cNom' value='$clientNom1'>";
echo '<br>';
echo '<label>numero du client:</label>';
echo "<input type='text' name='cNum' value='$clientNumero1'>";
echo '<br>';
echo '<label>Projet :</label>';
echo "<input type='text' name='projeNom' value='$projetNom1'>";
echo '<br>';
echo '<label>Remise Client :</label>';
echo "<input type='number' name='cRemise' value='$clientRemise1'>%";
echo '<br>';
echo '<label>Référence du produit : </label>';
echo "<input type='text' name='produRef' value='$produitRef1'>";
echo '<br>';
echo '<label>Catégorie du produit :</label>';
echo "<input type='text' name='catNom' value='$categorieNom1'>";
echo '<br>';
echo '<label>Description : </label>';
echo "<input type='text' name='produDescription' value='$produitDescription1'>";
echo '<br>';
echo '<label>Quantité : </label>';
echo "<input type='number' name='quantit' value='$quantite1'>";
echo '<br>';
echo '<label>P.U : </label>';
echo "<input type='number' name='prodPu' value='$produitPu1'>";
echo '<br>';
echo '<label>Commentaires : </label>';
echo "<input type='text' name='commentNom' value='$commentaireNom1'>";
echo '<br>';
echo '<label>Total :</label>';
echo "<input type='number' name='tot' value='$total1'>";
echo '<br>';
echo "<input type='submit' name='OK' value='OK'>";
echo ' ';
echo '<input type="submit" name="retour" value="retour">';
echo '</form>';
echo '</div>';
} |
Partager