2009-06-03 14:07:14 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
$('input[type=checkbox][name=surveillance]').click(function() {
|
2009-05-20 15:49:08 +00:00
|
|
|
if($(this).attr('checked')== true){
|
2009-06-03 14:07:14 +00:00
|
|
|
$('#survForm').css('display','block');
|
2009-05-20 15:49:08 +00:00
|
|
|
}else{
|
2009-06-03 14:07:14 +00:00
|
|
|
$('#survForm').css('display','none');
|
2009-05-20 15:49:08 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2009-12-22 07:59:16 +00:00
|
|
|
var options = {
|
|
|
|
target: '#frmSurv',
|
|
|
|
url: './pages/ajax_surveillance.php',
|
|
|
|
beforeSubmit: showRequest,
|
|
|
|
success: showResponse
|
|
|
|
};
|
2009-06-03 14:07:14 +00:00
|
|
|
|
2009-05-20 15:49:08 +00:00
|
|
|
$('#frmSurv').submit(function() {
|
|
|
|
$(this).ajaxSubmit(options);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
function showRequest(formData, jqForm, options) {
|
2009-06-03 14:07:14 +00:00
|
|
|
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
2009-05-20 15:49:08 +00:00
|
|
|
return true;
|
|
|
|
}
|
2009-12-22 07:59:16 +00:00
|
|
|
|
|
|
|
function showResponse(responseText, statusText) {
|
|
|
|
$('#frmSurv').replaceWith('' + responseText + '');
|
|
|
|
if(statusText == 'success'){ return true; }else{ return false; }
|
|
|
|
}
|
2009-05-20 15:49:08 +00:00
|
|
|
});
|