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 144 145 146 147 148 149 150 151 152
| $sql = 'SELECT * FROM `lgnfact` WHERE `NumFact`= '.$numfact.' ORDER BY `id` ASC ';
$result = $bdd->query($sql);
$resultat=$result->fetchAll(PDO::FETCH_ASSOC);
foreach ($resultat as $row)
{ $a++;
$id=$row['id'];
$designa=$row['designa'];
$tax=$row['taxe'];
echo $htunit=$row['htunit'];
echo '|'.$ht=trim($row['ht']);
echo '['.strlen($row['ht']).']';
echo $ttc=trim($row['ttc']);
echo '['.strlen($row['ttc']).']';
$q=$row['q'];
echo'
<textarea style="display:block" onkeyup="verif(this,1)" cols="40" rows="1" class="input1 xcolor" id="area_'.$a.'" name="designa'.$a.'">'.$designa.' </textarea>
<input class="span2 xcolor1" style="display:block" name="taxe'.$a.'" value="'.$tax.'" type="text" id="tva_'.$a.'" onChange="calcul('.$a.');" >
<input class="span2_2 xcolor3" style="display:block" name="q'.$a.'" value="'.$q.'" type="text" id="q_'.$a.'" onChange="calcul('.$a.');" >
<input class="span3 xcolor2" style="display:block" name="htunit'.$a.'" value="'.$htunit.'" type="text" id="htunit_'.$a.'"onChange="calcul('.$a.');" >
<input class="span3 xcolor2" style="display:block" name="htaxe'.$a.'" value="'.$ht.' " type="text" id="ht_'.$a.'" >
<input class="span4 xcolor" style="display:block" name="taxec'.$a.'" value="'.$ttc.' " type="text" id="ttc_'.$a.'" >
<input class="input5" style="display:block;border-radius:5px;cursor:pointer;" id="btn_efface_'.$a.'" value="X" type="button" onClick=\'erase('.$a.','.$nbr_lgnJS.','.$nbr_lgnJS.');\' >';
}
?>
<script type='text/javascript'>
/*calcultoto();*/
var nlignes = <?php echo $nbr_lgnJS ;?>;
function Ajouter(){
nlignes++;
saisies1.insertAdjacentHTML('BeforeEnd','<textarea onkeyup="verif(this,1)" cols="40" rows="1" class="input1 xcolor" id="area_'+nlignes+'" name="designa'+nlignes+'"></textarea> <select class="span2 xcolor1" name="taxe'+nlignes+'" id="tva_'+nlignes+'" onChange="calcul('+nlignes+');" > <option value="0.00">0.00</option> <option value="1.10"> 10</option><option value="1.20">20</option></select><input class="span2_2 xcolor3" name="q'+nlignes+'" value="" type="text" id="q_'+nlignes+'" onChange="calcul('+nlignes+');" > <input class="span3 xcolor2" name="htunit'+nlignes+'" value="" type="text" id="htunit_'+nlignes+'" onChange="calcul('+nlignes+');" ><input class="span3 xcolor2" name="htaxe'+nlignes+'" value="" type="text" id="ht_'+nlignes+'" onChange="calcul('+nlignes+');" > <input class="span4 xcolor" name="taxec'+nlignes+'" type="text" id="ttc_'+nlignes+'" value="" onChange="calcul2('+nlignes+');" ><input class="input5" style="display:block;border-radius:5px;cursor:pointer;" id="btn_efface_'+nlignes+'" value="X" type="button" onClick="erase(nlignes,nlignes);"> ');};
</script>
<div id="saisies1"> </div>
</div><!--centre_2-->
<!--***************************************************-->
<div class="cont_basfact">
<!-- ===== TOTAL input HT ET TTC ================== -->
<span class="input1 span1_2" > </span>
<span class="span3 span1_2"> </span>
<input class="span2 xbackground" id="" type="text" size="" value="" >
<input class="span2_2 xbackground" id="" type="test" size="" value="" >
<input class="span3 xcolor2" id="totHT" type="text" name ="totHT" size="" value="<?php echo $totht; ?> €" >
<input class="span4 xcolor" id="totTTC" type="text" name ="totTTC" size="" value="<?php echo $totttc ; ?> €" >
<!-- ===== Champ ACOMPTE ================== -->
<span class="input1 span1_2" > </span>
<span class="span3 span1_2"> </span>
<input class="span2 xbackground" id="" type="text" size="" value="" >
<input class="span2_2 xbackground" id="" type="test" size="" value="" >
<input class="span3 xcolor2" id="" type="text" name ="" size="" value="<?php echo 'Acompte =>'; ?>" >
<input class="span4 xcolor" id="ac" type="text" onChange="calcultotoac();" name ="acompte" size="" value="" >
<!-- ===== Champ TOTAL - ACOMPTE Reste A Regler ================== -->
<span class="input1 span1_2" > </span>
<span class="span3 span1_2"> </span>
<input class="span2 xbackground" id="" type="text" size="" value="" >
<input class="span2_2 xbackground" id="" type="test" size="" value="" >
<input class="span3 xcolor2" id="" type="text" name ="" size="" value="<?php echo 'Reste à Régler : '; ?> €" >
<input class="span4 xcolor" id="rar" type="text" name ="rar" size="" value="<?php echo $ttc; ?>€ " >
<div class="contener_btnPageModif ">
<!-- boutonns fin ================== -->
<a class="btn_factdev" title="Supprimer" href="list_fact.php?numfactsup=<?php echo $numfact; ?>" onclick="return confirm('Supprimer la facture ?');">Supprimer facture</a>
<input name="annul" type="button" class="btn_factdev" onclick="location.href='list_fact.php'" value="Annuler" >
<input name="modif" type="submit" class="btn_factdev" value="Enreg.Modif">
</div><!-- contener_btnPageModif -->
</div><!--cont_basfact-->
</form> |