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
| <table id="idVenteJournaliereTab" width="100%" border="1" class="table table-condensed table-striped table-hover display compact">
<thead>
<tr>
<th><i class="fa fa-user-md"></i> Client</th>
<th><i class="icon_calendar"></i> Date</th>
<th><i class="icon_document_alt"></i> Produit</th>
<th><i class="fa fa-list-ol"></i> Quantite</th>
<th><i class="fa fa-money"></i> PrixUnitaire</th>
<th><i class="fa fa-money"></i> MontantTotal(TTC)</th>
</tr>
</thead>
<tbody id="tabVenteDaily">
<script>
$(document).ready(function () {
//-------------------------
//-------S_AJAX
$.ajax({
type: 'GET',
url: '/getAllOrder',
dataType: 'Json',
contentType: 'application/json',
cache: false,
success: function (data) {
var html = '';
var len = data.length;
//-------------------------------TABLE
for (var i = 0; i < len; i++)
{
html += '<tr>';
html += '<td>'+data[i].nomClient+' '+data[i].prenomClient+'</td>' ;
html += '<td>'+data[i].dateCommande+'</td>' ;
html += '<td>'+data[i].nomProduit+'</td>' ;
html += '<td>'+data[i].quantite+'</td>' ;
html += '<td>'+data[i].prixUniteVendue+'</td>' ;
html += '<td>'+data[i].prixSubTotal+'</td>' ;
html += '</tr>' ;
}
//-------------------------------TABLE
$('#tabVenteDaily').html(html);
//--------------------------------------------
console.log(data);
},
error: function (e) {
//S il ya erreur , afficher , notifier erreur
console.log("ERROR:", +e);
}
});//En S.ajax
//-------S_AJAX
});
</script>
</tbody>
</table> |
Partager