first commit
This commit is contained in:
77
assets/modules/frontend/app_frontend_article_service.js
Executable file
77
assets/modules/frontend/app_frontend_article_service.js
Executable file
@@ -0,0 +1,77 @@
|
||||
import 'jquery';
|
||||
|
||||
import 'datatables.net-bs5';
|
||||
|
||||
|
||||
/**************************************Service************************************* */
|
||||
|
||||
//window.getRendezVous = getRendezVous;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var table = $('#dataTablesRdv').DataTable({
|
||||
language: {
|
||||
url: '../../../../assets/json/fr-FR.json',
|
||||
},
|
||||
bFilter: false,
|
||||
bInfo: false,
|
||||
pageLength: 5,
|
||||
dom: 'rtip',
|
||||
autoWidth: false, // might need this
|
||||
});
|
||||
|
||||
$("#btn-show-rdv").click(function() {
|
||||
|
||||
$.post( pathGetListRDV, {}, function( data ) {
|
||||
|
||||
$.each( data, function( key, value ) {
|
||||
var td1 = '<b>'+key+'</b>';
|
||||
|
||||
var td2 = '<div class="row">';
|
||||
$.each( value, function( key, value ) {
|
||||
td2 += '<div class="col-md-3" style="margin-bottom:7px;">';
|
||||
td2 += '<a class="btn btn-yellow" href="'+pathSelectRDV+'?id='+value.idRdv+'">'+value.debut+' - '+value.fin+'</a>';
|
||||
td2 += '</div>';
|
||||
});
|
||||
td2 += '</div>';
|
||||
|
||||
table.row.add([td1, td2]).draw(false);
|
||||
|
||||
});
|
||||
|
||||
}).fail(function(response) {
|
||||
console.error('Error: ' + response.responseText);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**************************************Article************************************* */
|
||||
|
||||
|
||||
$('#addPanier').click(function(){
|
||||
|
||||
var qtyVal = $('#qty-val').val();
|
||||
|
||||
window.open(pathAddArticlePanier+'?qty='+qtyVal, "_self");
|
||||
});
|
||||
|
||||
$('#qty-asc').click(function(){
|
||||
var qtyVal = $('#qty-val').val();
|
||||
if(qtyVal>1){
|
||||
qtyVal--;
|
||||
$('#qty-val').val(qtyVal);
|
||||
}
|
||||
});
|
||||
|
||||
$('#qty-desc').click(function(){
|
||||
var qtyVal = $('#qty-val').val();
|
||||
qtyVal++;
|
||||
$('#qty-val').val(qtyVal);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user