32 lines
763 B
JavaScript
32 lines
763 B
JavaScript
$(document).ready(function(){
|
|
|
|
$("a.setprofil").click(function(e){
|
|
e.preventDefault();
|
|
var profil = $(this).parent('td').find('select[name=profil] option:selected').val();
|
|
$.post($(this).attr('href'), {idprofil: profil}, function(data){
|
|
if (data!='Erreur'){
|
|
window.location.href = '/';
|
|
}
|
|
});
|
|
});
|
|
|
|
$(document).focusin(function(){
|
|
timer = setInterval(updateInfo, 10000);
|
|
});
|
|
$(document).focusout(function(){
|
|
clearInterval(timer);
|
|
});
|
|
timer = setInterval(updateInfo, 10000);
|
|
});
|
|
|
|
var timer;
|
|
function updateInfo()
|
|
{
|
|
$('tr.encours').each(function(){
|
|
var objet = $(this);
|
|
var id = $(this).attr('id');
|
|
$.getJSON('/index/getinfo', {id: id}, function(data){
|
|
if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
|
|
});
|
|
});
|
|
} |