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
| $(function() {
$(".reload").live('click', function () {
$('.reset').remove();
var id = $(this).parent('li').attr('id');
$('#Waiting').show(500);
//$('#Ajax_message').hide(0);
// Recharge l'ordonnance TYPE
$.ajax({
type: "POST",
url: "<?php echo site_url('ordotype/reload');?>/"+id,
data: "id="+id,
cache: false,
dataType: 'json',
success: function(data)
{
$('#Waiting').hide();
$('#Submit_ordotype').val('Modifier');
$('#Submit_ordotype').removeClass('save').addClass('update');
$('#Submit_ordotype').after('<input type="submit" name="Form_ordotype" value="Annuler" class="reset" id="Submit_ordotype" />');
$('#Id').remove();
$('#Nom_ordotype').before('<input type="hidden" name="id" value='+data.id+' id="Id">');
$('#Nom_ordotype').val(data.nom);
$('#Contenu').val(data.contenu);
if (data.partage == '1') {
$('#Partage').attr('checked', true);
$('#Partage').val('1');
} else {
$('#Partage').attr('checked', false);
$('#Partage').val('0');
}
}
});
return false;
});
}); |